Handling Payments
To initiate a payment with PayPangea, you can set up a button on your webpage. When this button is clicked, it will trigger the initPayment
method, which is responsible for opening the PayPangea payment interface with the parameters you specify. Here's how you can do it:
Then, add JavaScript to handle the button click and invoke the initPayment
method with all available options:
Options Explained:
amount: The total payment amount, formatted as a string.
token: Specifies the cryptocurrency token to be used for the payment.
currency: The fiat currency equivalent, useful for displaying to users.
tokenaddress: The address for the accepted token, necessary for blockchain transactions.
chain: Identifies the blockchain network (e.g., Ethereum, Binance Smart Chain).
title: A brief title for the payment, visible to the user.
text: Additional description or information about the payment.
successredirectURL: URL to which the user will be redirected after a successful payment.
failredirectURL: URL to which the user will be redirected after a failed payment.
webhookURL: Endpoint URL for your server to receive transaction updates via webhook.
merchantid: Your unique merchant ID of the payment provided by you.
These options allow for a highly customizable payment process, ensuring that you can tailor the experience to match your application's requirements and provide your users with a seamless payment experience.
Last updated