Integration Guide
How to integrate a payment with YODL.me into a webshop
Development Tasks
🔗 Payment Button
On the checkout page you create a payment button/link to:
https://yodl.me/$handle?amount=..¤cy=..&memo=..
$handle
is your YODL.me linkamount
is the amount of the payment in the minor denomination of the currencycurrency
to indicate the invoice currencymemo
is your order/customer/cart ID, whatever you need to reconcile the payment(on stripe API it's called `client_reference_id`)
✅ Success Redirect Page
When the checkout is completed and the payment is confirmed, YODL.me redirects the user back to the success redirect page hosted on your webshop. This URL is configured in the YODL.me account admin.
The SDK appends to the URL, as query parameters the chainId
and txHash
. So you can engage in post-processing of the payment (similar to the webhook). However as we cannot guarantee that the user really returns to your page, you should still implement webhooks for consistent processing.
⚙️ Webhook
The webhook is called by the YODL.me backend when the payment was confirmed on-chain and when the payment is probabilistically final and unlikely to be reverted. The payload is minimal and only contains:
chainId
txHash
state
of the blockchain transaction:confirmed
orprobabilistic
The Webhook needs to query
yodl.me/api/tx/:chainId/:txHash
to retrieve the payment details:pmt
With the retrieve
pmt.memo
lookup the order/cart/customerVerify in your code that the payment was not tampered with.
Mark payment as complete and do your post processing
💾 Environment Variables
Flow and Sequence Diagram
Last updated