Submit Payment Custom Integration
October 6, 2021 at 9:50 AMThe custom integration is another way to integrate, but does not have all the benefits of the widget like Promise
or client events,
instead it allows you to make a more personalized integration.
This integration use url params to send all the same options described here.
The base url used to start the payment is:
url: https://egiftcert.paynup.com
Then to submit your payment must build the url using query params:
Url example:
https://egiftcert.paynup.com?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGki&orderNumber=12345678&amount=2.50&IPNHandlerUrl=https://yoursite.com/ipn_handler
The payment form can be loaded in an iframe, popup or anything you want to integrate in your site.
Encoded Claim
For more security and to obfuscate your order details in the url params you can optionally encode this params using your API Key. The way you encode this params is similar to create a JWT token described here.
In this case the token payload must contain the following format:
{
"iss": "1C68ADF31EC8F25BC7F2",
"jti": "46c5afb7-24b9-4239-a0b3-16b7810cb87f",
"iat": 1514782800,
"params": {
"redirectUrl": "https://www.example.com/checkout/order-received/123456",
"autoRedirect": true,
"autoRedeem": true,
"allowRedeem": true,
"qrCode": true,
"orderNumber": "123456",
"receiptEmail": "[email protected]",
"amount": "20.50",
"customerName": "Harvey Coulter",
"customerPhone": "+13051231234",
"billingAddress": "3383 Richland Avenue",
"billingCity": "Kemah",
"billingState": "TX",
"billingZipCode": "77565",
"IPNHandlerUrl": "https://www.example.com/egift-ipn",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMjM0NSIsImlhdCI6MTUxNDc4MjgwMCwiaXNzIjoiODg1QTQ0NTYxNDA0NkNEQjNCMkYifQ.weBhi5xK8w6scP2RdLn5ZbS-c8FRoq1Ig2W9B3nV2qs"
}
}
As you can see; we put all the same parameters that we were going to pass in the url inside the params
field of the token.
Then now we only pass one parameter called claim
with the entire token.
Url example:
https://egiftcert.paynup.com?claim=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIxQzY4QURGMzFFQzhGMjVCQzdGMiIsImp0aSI6IjQ2YzVhZmI3LTI0YjktNDIzOS1hMGIzLTE2Yjc4MTBjYjg3ZiIsImlhdCI6MTUxNDc4MjgwMCwicGFyYW1zIjp7InJlZGlyZWN0VXJsIjoiaHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vY2hlY2tvdXQvb3JkZXItcmVjZWl2ZWQvMTIzNDU2IiwiYXV0b1JlZGlyZWN0Ijp0cnVlLCJhdXRvUmVkZWVtIjp0cnVlLCJhbGxvd1JlZGVlbSI6dHJ1ZSwicXJDb2RlIjp0cnVlLCJvcmRlck51bWJlciI6IjEyMzQ1NiIsInJlY2VpcHRFbWFpbCI6ImhhcnZlcnljQGV4YW1wbGUuY29tIiwiYW1vdW50IjoiMjAuNTAiLCJjdXN0b21lck5hbWUiOiJIYXJ2ZXkgQ291bHRlciIsImN1c3RvbWVyUGhvbmUiOiIrMTMwNTEyMzEyMzQiLCJiaWxsaW5nQWRkcmVzcyI6IjMzODMgIFJpY2hsYW5kIEF2ZW51ZSIsImJpbGxpbmdDaXR5IjoiS2VtYWgiLCJiaWxsaW5nU3RhdGUiOiJUWCIsImJpbGxpbmdaaXBDb2RlIjoiNzc1NjUiLCJJUE5IYW5kbGVyVXJsIjoiaHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vZWdpZnQtaXBuIiwidG9rZW4iOiJleUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcWRHa2lPaUl4TWpNME5TSXNJbWxoZENJNk1UVXhORGM0TWpnd01Dd2lhWE56SWpvaU9EZzFRVFEwTlRZeE5EQTBOa05FUWpOQ01rWWlmUS53ZUJoaTV4Szh3NnNjUDJSZExuNVpiUy1jOEZSb3ExSWcyVzlCM25WMnFzIn19.8uHeNXfoD1NyPpO49HS2zPYc5yUFjpq2S9LWm3SDGEk
The eGiftCertificate site check the claim signature to accept only valid payments links.
eGiftCertificate Toolbox
Can play with your credentials using the eGiftCertificate integration toolbox to generate different payments links.
Now you are ready to listen for server side events and integrate the Instant Payment Notification Handler to mark you order based on certificate status.