Skip to content

Commit

Permalink
fix typo in receipt key, fix signature when receipt is passed (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Retunsky authored Jan 23, 2025
1 parent c4ae625 commit 587c910
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public function getPaymentUrl()

$this->data['SignatureValue'] = md5($signature);

if (isset($this->data['Receipt'])) {
$this->data['Receipt'] = urlencode(urlencode(json_encode($this->data['Receipt'])));
}

$data = http_build_query($this->data, null, '&');
$custom = http_build_query($this->customParams, null, '&');

Expand Down Expand Up @@ -224,7 +228,7 @@ public function addReceiptData(array $receiptData): self
throw new ReceiptDataException();

$this->receiptData = $receiptData;
$this->data['Recipt'] = $this->receiptData;
$this->data['Receipt'] = $this->receiptData;
return $this;
}

Expand Down

0 comments on commit 587c910

Please sign in to comment.