<!-- Replace YOUR_API_PUBLIC_KEY by the API public key of your sandbox or live account. --> <form action="index.php" method="POST"> <input type="hidden" name="field" value="test"> <script src="https://cdn.fedapay.com/checkout.js?v=1.1.2" data-public-key="YOUR_API_PUBLIC_KEY" data-button-text="Pay 35000" data-button-class="button-class" data-transaction-amount="35000" data-transaction-description="Transaction description" data-currency-iso="XOF" data-widget-description="Your 100% african store" data-widget-image="https://cdn.fedapay.com/img/marketplace.svg" data-widget-title="Afrimarket"> </script> </form>
This integration uses a
script tag in your form to display a
button that will trigger the payment process when the customer clicks on it.
Do not forget to pass in parameter, the values for the
data- attributes without which, your integration will not work.
data-public-key: specify the API public key of your FedaPay account obtained at its creation
data-transaction-amount: define the amount of the payment to be made by the customer
data-transaction-description: give a brief description of the transaction purpose
data-currency-iso: specify the currency iso to use for the transaction
Refer to the supported currencies by FedaPay for more information.
These are :
data-button-text: to modify the text displayed on your button
data-button-class: customize the button by specifying for this attribute a defined class of your choice such as a bootstrap class
data-widget-description: to make a short description of your platform
data-widget-image: define the logo to display on your form
data-widget-title: indicate your platform name
When using this code, make sure that the data contained in the form reach you server-side by indicating the correct parameter for the attribute
action, which here, for illustrative purpose is
Once the code is integrated, you will need to connect your FedaPay account to Feda Checkout so that the application can create the customers and transactions.
This step is necessary and secures your integration.