Skip to content

Commit

Permalink
fix: update examples with fetching incomingPayment (#455)
Browse files Browse the repository at this point in the history
* Update verify-payment-example.js

* Update incomingpayment.mdx
  • Loading branch information
sidvishnoi authored May 10, 2024
1 parent 3229192 commit 89ecb24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function verifyPayment(event) {

if (response.ok) {
// The incoming payment was fetched successfully
const { receivedAmount } = JSON.parse(response.json())
const { receivedAmount } = await response.json()
const { amount, assetCode, assetScale } = receivedAmount
console.log(`Received ${assetCode}${amount / Math.pow(10, assetScale)}.`)
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/specification/includes/verify-payment-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function verifyPayment(event) {

if (response.ok) {
// The incoming payment was fetched successfully
const { receivedAmount } = JSON.parse(await response.json())
const { receivedAmount } = await response.json()
const { amount, assetCode, assetScale } = receivedAmount
console.log(`Received ${assetCode}${amount / 10 ** assetScale}.`)
return receivedAmount
Expand Down

0 comments on commit 89ecb24

Please sign in to comment.