Skip to content

Payment

Before this section is started, you need to make sure you have 3D data from the previous section which can be found here

The request to make the payment is made to the endpoint POST /CardPayment. The payload could look something like the example below. Pay special attention to the property cardVerificationData. This is where the data gotten from the callback in POST /CardVerification from the earlier section is inserted.

The headers for the request should look like the example below

{
    "valitorpay-api-version": "2.0",
    "Authorization": "APIKey Demo.0N52a34T51QCxMwMLPb2+kxEkRhEX1xK9iIPzDiNHsU="
}

Here's an example of a request payload

{
  "operation": "Sale",
  "transactionType": "ECommerce",
  "cardNumber": "2223000010311873",
  "expirationMonth": 12,
  "expirationYear": 2030,
  "cvc": "123",
  "additionalData": {
    "merchantReferenceData": "Order-765_484"
  },
  "currency": "ISK",
  "amount": 10000,
  "cardVerificationData": {
    "cavv": "jq6EHIP0PfZEYwAAnuCpB4MAAAA=",
    "mdStatus": "MdAttempt",
    "xid": "nrQGVcVW0CIzw6wsqwIlxLAUTCE=",
    "dsTransId": "f4bd9217-f3dd-4895-a207-bdf489aa5f7a"
  },
  "systemCalling": "MerchantSystemName V1.0",
  "correlationId": "cfb45b06-0752-4fdc-a07b-0b0d921f68b9"
}

Please note

In the above example the amount is set as 10000. The true amount, however, is 100 ISK since the API interprets the last to digits as decimals. The true amount is inserted as 100.00 ISK.

A successful response could look something like this:

{
    "acquirerReferenceNumber": "123456",
    "transactionID": "914217598109",
    "authorizationCode": "238246",
    "transactionLifecycleId": "ABC7291011217",
    "maskedCardNumber": "222300******1873",
    "isSuccess": true,
    "cardInformation": {
        "cardScheme": "M",
        "issuingCountry": "IS",
        "cardUsage": "Credit",
        "cardCategory": "Business-to-Business",
        "outOfScaScope": false,
        "cardProductCategory": null
    },
    "isCardPresent": false,
    "responseCode": "00-I",
    "responseDescription": "Authorized",
    "responseTime": "00:00:02",
    "correlationID": "5aca85c3-847c-4f63-887b-282281e77ef6"
}

You need to pay special attention to the properties responseCode and responseDescription and react accordingly based on what the code is. Please find documenation with response codes in ValitorPay here.

Please note

For more detailed information please refer to the CardPayment endpoint in the ValitorPay specification