Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Current »

Paymentgateway web Iframe support

This applies to : https://gattinn.pei.is and https://gattin.greidslumidlun.is

When using an Iframe solution in a payment gateway there is a certain flow that must be used

How it works

  1. Post an order → https://api.pei.is/docs/ui/index#!/Orders/Orders_SubmitOrder

    1. More detail about posting order is here

    2. The key detail that must be set correctly when using IFrame is SuccessReturnUrl and CancelReturnUrl

  2. Open the payment gateway web in iframe mode on your webpage.

  3. The payment gateway web will handle all 3DS verification so that happens all inside the Iframe.

  4. When the user has made a payment an event from the payment gateway webpage in the Iframe is sent to the parent page.

    1. 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.

    2. Event example of a successful credit card payment event

      • {
          "code" : 200
          "message":"Payment Completed",
          "paymentCompleted" : true,
          "orderId" : "7Occ7bxbxN8H4NCvb9UdlQXUUbZHuYFK",
          "reference" : "some reference data from merchant",
          "cardActionResult" : {
              "acquirerStatusCode": "00-I",
              "acquirerMessage": "Authorized."
            }
        }
    3. Event example of a failed credit card payment event

      • {
          "code" : 1002
          "message":"Buyer does not have enough .....",
          "paymentCompleted" : false,
          "orderId" : "7Occ7bxbxN8H4NCvb9UdlQXUUbZHuYFK",
          "reference" : "some reference data from merchant",
          "cardActionResult" : {
              "acquirerStatusCode": "51-I",
              "acquirerMessage": "Do not honor. ..."
            }
        }
  5. When the payment is successful and postback (webhook) message is sent to the merchant if defined in the order.

    1. Example of postback message

      1. {
          "orderId": "JqOuxhTtxJaxsxmXQ3JKIVjh2Jg23F5v",
          "purchaseId": 13593391,
          "mandateId": "bxex1d67c44e4f1fa03b8cbb97dca85f"
        }

Diagram of the flow

New Return and Refund response in OrderAPI

We added card acquirer transaction response both on success and failure. Just note that the “cardActionResult” section will only appear in the failure response when the cause of the error is transaction failure or something related to the acquirer action.

The return command is used to fully refund the credit card payment of an order.

See more information with this link https://api.pei.is/docs/ui/index#!/Orders/OrdersV1_Return

Responses:

200, Success:

{
    "acquirerStatusCode": "00",
    "acquirerMessage": "Approved."
}

400, Failure

{​
    "code": "10051",
    "message": "Unknown error occurred",
    "correlationId": "342137fa-88ca-46e1",​
​    "cardActionResult": {​
        "acquirerStatusCode": "51-I",​
        "acquirerMessage": "Do not honor. Correlation ID: e6df6457-a84b-44c2-ae40-3260b4797981"​
    }​
}

The refund command is used for a partial refund of the credit card payment of an order.

See more information with this link https://api.pei.is/docs/ui/index#!/Orders/OrdersV1_Refund

Partial refund is not possible until next day after the authorisation has been cleared.

Responses:

200, Success:

{
    "acquirerStatusCode": "00",
    "acquirerMessage": "Approved."
}

400, Failure

{​
    "code": "10051",
    "message": "Unknown error occurred",
    "correlationId": "342137fa-88ca-46e1",​
​    "cardActionResult": {​
        "acquirerStatusCode": "51-I",​
        "acquirerMessage": "Do not honor. Correlation ID: e6df6457-a84b-44c2-ae40-3260b4797981"​
    }​
}

Returning information about the order, “OrderAPI” “GET Orders”

A few things have been added to the order to provide more information about the order.

See more information on this link https://api.pei.is/docs/ui/index#!/Orders/OrdersV1_GetOrder

Field

Description

Example

status

Contains status information about the order:

Status codes:

  • Unpaid = 0

  • Paid = 1

  • Cancelled = 2

  • Overdue = 3

  • Expired = 4

  • Amortized = 5

  • Unconfirmed = 6

“status” : 1

maskedCard

Contains masked credit card number.

This will only appear if the payment was credit card payment.

“maskedCard” : “XXXX-XXXX-XXXX-1309“

cardType

Credit card type

This will only appear if the payment was credit card payment.

“cardType” : “Visa”

authorizationCode

The authorization code for the payment made with credit card.

This will only appear if the payment was credit card payment.

“authorizationCode” : “429136”

refundedAmount

Refunded amount on a order.

“refundedAmount” : 1000.0

cardActionResult

Section with information from credit card acuirer

"cardActionResult": {
        "acquirerStatusCode": "51-I",
        "acquirerMessage": "Do not honor. ..."
 }

Example of response

{
  "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

Added support for treating Payment slips in the name of the Merchant.

Today almost every payment slip is created in Geiðslumiðlun name and that can be confusing for the buyer to see what he will be paying for and from what merchant.

Now there has been added support to use the merchant B2B bank account to create the payment slip in their name but still use the Greidslumidlun payment gateway.

  • No labels