We have setup a set of RESTful API endpoints that assists you in generating a checkout link and verifying the status of a payment. A documentation of our API can be found here. The below steps describe how to utilize these endpoints to setup YenePay as a payment method using our APIs.
- Get your seller code/ merchant code by registering for a seller account on https://www.yenepay.com. You will get your seller code from your YenePay account management page
- Get your PDT key from the Settings page of your YenePay account management page
- Setup a Pay with YenePay button on your site/app. When your customer clicks this option, your system should get a valid YenePay checkout URL by calling our /api/urlgenerate/getcheckouturl endpoint and redirect the customer to that URL. , request for a YenePay checkout URL by passing the appropriate request payload (which includes your merchant code and PDT key)
- After your customer completes a payment on our checkout page/mobile app, our system will send an Instant Payment Notification to the ipnUrl endpoint you provided when generating the checkout URL in the previous step. When your system receives this notification, make a call to our /api/verify/ipn/ endpoint to verify the authenticity of the notification you received. If you don’t have an endpoint for IPN, then you can also check the payment status from your successUrl endpoint. However, your system will rely on the customer selecting to return to your site/application after completing a payment on our checkout page.
- When a customer selects to return to your site/application after completing a payment on our checkout page, he/she is taken to the successUrl endpoint you specified when generating the checkout URL. When your customer lands on that page, make a call to our /api/verify/pdt/ endpoint to make sure the payment is completed.
To learn more about the endpoints, please go to our API documentation article.