...
Post an order → https://api.pei.is/docs/ui/index#!/Orders/Orders_SubmitOrder
More detail about posting order is here
The key detail that must be set correctly when using IFrame is SuccessReturnUrl and CancelReturnUrl
Open the payment gateway web in iframe mode on your webpage.
The payment gateway web will handle all 3DS verification so that happens all inside the Iframe.
When the user has made a payment an event from the payment gateway webpage in the Iframe is sent to the parent page.
This event contains information about if the payment was successful or failed and has the error code from Pei regarding and will include additional code and message from acquired if a credit card payment is made.
Event example of a successful credit card payment event
Code Block language json { "codestatusCode" : 200 "message":"Payment Completed", "paymentCompletedisPaymentCompleted" : true, "reference" : "some reference data from merchant", "orderInfo" : { "orderId": "Muixxxdd3qe14dQBAp5wOYTE8kWiVIBjg", "buyer": { "name": "Buyer name", "ssn": "3000493993", "email": "someemail@pei.is", "mobileNumber": "9999999" }, "merchantId": 4, "successReturnUrl": "https://gattinstaging.greidslumidlun.is/iframe/completed?ref=123", "cancelReturnUrl": "https://gattinstaging.greidslumidlun.is/iframe?ref=123", "amount": 7250.0, "isConfirmed": true, "paymentMethod": 1, "items": [ { "7Occ7bxbxN8H4NCvb9UdlQXUUbZHuYFKid": 1641944, "reference" : "some reference data from merchant", "cardActionResult" "name": "Gjöf", "quantity": 1.0, "unitPrice": 7250.0, "amount": 7250.0, } ], "cardActionResult": { "acquirerStatusCode": "00-I", "acquirerMessage": "Authorized." }, "confirmationDate": "2022-12-01T18:55:23.233", "mandateId": null, "maskedCard": "XXXX-XXXX-XXXX-6699", "cardType": "Mastercard", "authorizationCode": "815455 } }
Event example of a failed credit card payment event
Code Block language json { "codestatusCode" : 1002 "message":"Buyer does not have enough .....", "paymentCompleted" : false, "orderId" : "7Occ7bxbxN8H4NCvb9UdlQXUUbZHuYFK", "reference" : "some reference data from merchant", "cardActionResultorderInfo" : { "acquirerStatusCode": "51-I", "acquirerMessage": "Do not honor. details about the order ......" } }
When the payment is successful and postback (webhook) message is sent to the merchant if defined in the order.
Example of postback message
Code Block language json { "orderId": "JqOuxhTtxJaxsxmXQ3JKIVjh2Jg23F5v", "purchaseId": 13593391, "mandateId": "bxex1d67c44e4f1fa03b8cbb97dca85f" }
...
See more information with this link https://api.pei.is/docs/ui/index#!/Orders/OrdersV1_Refund
Info |
---|
Partial refund is not possible until next day after the authorisation has been cleared. |
Responses:
200, Success:
Code Block |
---|
{ "acquirerStatusCode": "00", "acquirerMessage": "Approved." } |
...
Code Block | ||
---|---|---|
| ||
{ "orderId": "i3T0OBxiwjY33tYU43V5o0amXqFTZAllxZ", "purchaseId": 17455210, "merchantId": 4, "merchantName": "1Greidslumidlun ehf.", "merchantParentCompanyName": "Greidslumidlun ehf.", "buyer": { "name": "Some Name", "ssn": "xxxxxxxx", "email": "SomeEmail@pei.is", "mobileNumber": "xxxxxx" }, "amount": 200000.0, "reference": "Merchant reference", "purchaseOptions": { "installmentFrequency": 1 }, "postbackUrl": "https://webhook.site/example", "postbackStatusModel": 2, "successReturnUrl": "", "cancelReturnUrl": "", "items": [ { "id": 3308378, "timestamp": "2022-11-14T14:27:54.49", "code": null, "name": "Nocco", "isActive": true, "quantity": 1.0, "unit": null, "unitPrice": 0.0, "amount": 200000.0, "groupName": null, "isOptional": false, "isDefaultSelected": null } ], "isConfirmed": true, "confirmationDate": "2022-11-14T14:29:13.81", "saleDate": "2022-11-14T14:27:54.487", "paymentMethod": 2, "status": 1, "mandateId": "sgmFXXTNkYthLyzYbQmGTnVj5y3wJTVA", "maskedCard": "XXXX-XXXX-XXXX-1309", "cardType": "Visa", "authorizationCode": "429136" "refundedAmount" : 10000.0 "cardActionResult" : { "acquirerStatusCode": "00", "acquirerMessage": "Approved." } } |
No retry policy from the
...
ValitorPay gateway
The system has been implemented to take into account and handle the No retry policy from ValitorPay.
More information about that can be found on ValitorPay web site https://uat.valitorpay.com/ResponseCodes.html
...