Alipay Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for Alipay method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

For Alipay payments only the following Articles parameters are mandatory to be sent in the request, the rest of them are optional:

  • Name – Article’s name;
  • Quantity – The number of products.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

For more information about status codes, please go to Basic HTTP Status Codes.

Request: 

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h31",
    "Amount": "100",
    "Currency": "CNY",      
    "MethodID": 24,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "BillingAddress": {
      "Country": "CN"
      },        
    "Articles": [
      { 
      "Name": "TEST",
      "Quantity": 1
      }
    ]
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4201852,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181120122556",
        "MerchantTransactionID": "s2ptest_h31",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "CNY",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "MethodID": 24,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": "20181120122556",
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": [
            {
                "MerchantArticleID": null,
                "Name": "TEST",
                "Quantity": 1,
                "Price": null,
                "VAT": null,
                "Discount": null,
                "Type": null,
                "TaxType": null,
                "DiscountValue": null
            }
        ],
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h32",
    "Amount": "100",
    "Currency": "CN",      
    "MethodID": 24,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "BillingAddress": {
      "Country": "CN"
      },
        
    "Articles": [
      { 
      "Name": "TEST",
      "Quantity": 1
      }
    ]
  }
}

Response:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": null,
        "SkinID": null,
        "ClientIP": null,
        "Created": null,
        "MerchantTransactionID": "s2ptest_h32",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "CN",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "MethodID": 24,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": null,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": null,
            "Info": null,
            "Reasons": [
                {
                    "Code": "2",
                    "Info": "Validation failed - Currency (RegEx: ^[A-Z]{3}$)"
                }
            ]
        },
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

Alipay POS Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for Alipay POS method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

For Alipay POS payments the following Details parameters are mandatory to be sent in the request:

  • IsOffline – Offline payment method;
  • StoreName – Store name. Can be null only when the store information is verified;
  • StoreId – Store ID;
  • TerminalID – POS Terminal ID.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

For more information about status codes, please go to Basic HTTP Status Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
    "Payment": {
        "MerchantTransactionID": "AlipayPlus-{{$timestamp}}",
        "Amount": 100,
        "Currency": "CNY",
        "MethodID": 24,
        "ReturnURL": "https://demo2.smart2pay.com/redirect.php",
        "TokenLifetime": 10,
        "BillingAddress": {
            "Country": "CN"
        },
        "Customer": {
            "Email": "test_s2p@test.com",
            "FirstName": "Test",
            "LastName": "Test",
            "Phone": "00000000"
        },
        "Details": {    
      "IsOffline": true,
      "StoreName": "Zara Palace Mall",
      "StoreId": "ZA2345",
      "TerminalID": "T8999"
    }
    }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 6883549,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20240321085116",
        "MerchantTransactionID": "AlipayPlus-1711011077",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "CNY",
        "CapturedAmount": null,
        "ReturnURL": "https://demo2.smart2pay.com/redirect.php",
        "ReturnURLSuccess": null,
        "ReturnURLFailure": null,
        "ReturnURLCancel": null,
        "ReturnURLProcessing": null,
        "Description": "",
        "MethodID": 24,
        "MethodOptionID": null,
        "MethodOptionIdString": null,
        "BankName": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30563,
        "NotificationDateTime": null,
        "Customer": {
            "MerchantCustomerID": null,
            "Email": "test_s2p@test.com",
            "FirstName": "Test",
            "LastName": "Test",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": "00000000",
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "CN"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": {
            "AccountNumber": null,
            "AccountHolder": null,
            "IBAN": null,
            "Address": null,
            "BIC": null,
            "PrepaidCard": null,
            "PrepaidCardPIN": null,
            "ConfirmationCode": null,
            "Store": null,
            "SerialNumbers": null,
            "Wallet": null,
            "ReferenceNumber": null,
            "PayerCountry": null,
            "PayerEmail": null,
            "PayerPhone": null,
            "BankCode": null,
            "Pin": null,
            "BankName": null,
            "BankSortCode": null,
            "BankAccountNumber": null,
            "SocialSecurityNumber": null,
            "BillingCycleStart": null,
            "BillingCycleEnd": null,
            "UnsubscribeInstructions": null,
            "CustomerLoginID": null,
            "PaidAmount": null,
            "PaidCurrency": null,
            "ProviderExchangeRate": 0.0,
            "ProviderBlockChain": null,
            "PayerBankAccountID": null,
            "PayerID": null,
            "CryptoAmount": null,
            "CryptoCurrency": null,
            "CryptoAddress": null,
            "AvailableBalance": null,
            "CurrentBalance": null,
            "Installments": null
        },
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": null,
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": null,
            "SwiftBIC": null,
            "AccountCurrency": null,
            "AccountNumber": null,
            "AccountHolder": null,
            "IBAN": null,
            "Address": null,
            "AmountToPay": null,
            "QRCodeURL": "https://qr.alipayplus.com/showQrImage?code=281666040092tDqC8ZCNM7QoFo49S3Ev4Z0I&picSize=M",
            "Instructions": null,
            "BoletoURL": null,
            "SortCode": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": "20240321190741010003H0005811115",
        "OriginalMerchantTID": null,
        "Unknown": false,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://webapp-apm-globalpay-api-qa.nuvei.com/Home?PaymentToken=E3E8959BED00BC85C70EFE666EF40D29.6883549",
        "Splits": null
    }
}

In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
    "Payment": {
        "MerchantTransactionID": "AlipayPlus-{{$timestamp}}",
        "Amount": 100,
        "Currency": "CNY",
        "MethodID": 24,
        "ReturnURL": "https://demo2.smart2pay.com/redirect.php",
        "TokenLifetime": 10,
        "BillingAddress": {
            "Country": "China"
        },
        "Customer": {
            "Email": "test_s2p@test.com",
            "FirstName": "Test",
            "LastName": "Test",
            "Phone": "00000000"
        },
        "Details": {    
      "IsOffline": true,
      "StoreName": "Zara Palace Mall",
      "StoreId": "ZA2345",
      "TerminalID": "T8999"
    }
    }
}

Response:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 6883560,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20240321090237",
        "MerchantTransactionID": "AlipayPlus-1711011757",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "CNY",
        "CapturedAmount": null,
        "ReturnURL": "https://demo2.smart2pay.com/redirect.php",
        "ReturnURLSuccess": null,
        "ReturnURLFailure": null,
        "ReturnURLCancel": null,
        "ReturnURLProcessing": null,
        "Description": null,
        "MethodID": 24,
        "MethodOptionID": null,
        "MethodOptionIdString": null,
        "BankName": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30563,
        "NotificationDateTime": "20240321090237",
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 4,
            "Info": "Failed",
            "Reasons": [
                {
                    "Code": "147",
                    "Info": "Address details are invalid (BillingAddress)Country - RegEx: ^[a-zA-Z]{2}$;"
                }
            ]
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "OriginalMerchantTID": null,
        "Unknown": false,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": null
    }
}

Alipay POS Test Data

For Alipay payment method there aren’t any test data available, but you can see how it works with the payment flow given below.

Alipay POS Payment Flow

    1. The Customer selects his preferred currency from the list and continues the payment.1 Select currency

You can skip this step by sending in the initial POST the following parameters: SkipHPP=1 and CustomerEmail.

  1. The Customer is redirected to Alipay payment page. The Customer opens Alipay application and scans the QR code.1 Payment version
  2. The payment details are displayed on the client’s Alipay app on their smartphone; the customer confirms the payment by pressing Pay now.
  3. Upon completion of the payment flow, the customer is redirected back to your ReturnURL by pressing the Return to Merchant button1 Return page when the redirection status is Processing

Bank Transfer Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for Bank Transfer method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

In order to display the bank transfer details to your customers on your own page, you can send in the request the CustomerName and Country parameters. Use the information received in Response in the ReferenceDetails object.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

For more information about status codes, please go to Basic HTTP Status Codes.

Request: 

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment":{
    "MerchantTransactionID": "s2ptest_h35",
    "Amount": 400,
    "Currency": "PLN",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "BankTransferTestdetails",
    "MethodID": "1",
    "BillingAddress": {
      "Country": "DE"
    },
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe"
    }
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4178425,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181107093433",
        "MerchantTransactionID": "s2ptest_h35",
        "OriginatorTransactionID": null,
        "Amount": "400",
        "Currency": "PLN",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "BankTransferTestdetails",
        "MethodID": 1,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": {
            "ID": 142823,
            "MerchantCustomerID": null,
            "Email": null,
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "SocialSecurityNumber2": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 420,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "DE"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": "ING Bank",
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": "HPP4178425",
            "SwiftBIC": "INGBDEFF",
            "AccountCurrency": "EUR",
            "AccountNumber": "0010126423",
            "AccountHolder": "Stichting Smart2Pay Escrow Services",
            "IBAN": "DE72 5002 1000 0010 1264 23",
            "AmountToPay": "0.93 EUR",
            "QRCodeURL": null,
            "Instructions": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 1,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=F152AF870FFF05B98A83F7B8C35A81D9.4178425"
    }
}

There is another possibility to initiate a Bank Transfer transaction where you can send your own Reference Number in the request. Checkout the below example with the ReferenceNumber parameter sent in the request together with Customer parameters:

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h39",
    "Amount": 400,
    "Currency": "PLN",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "BankTransferTestdetails",
    "MethodID": "1",
    "BillingAddress": {
      "Country": "DE"
    },
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe"
    },
    "Details": {
      "ReferenceNumber": "your_reference_number"
    }
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4178441,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181107095318",
        "MerchantTransactionID": "s2ptest_h39",
        "OriginatorTransactionID": null,
        "Amount": "400",
        "Currency": "PLN",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "BankTransferTestdetails",
        "MethodID": 1,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": {
            "ID": 142823,
            "MerchantCustomerID": null,
            "Email": null,
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "SocialSecurityNumber2": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 420,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "DE"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": {
            "AccountNumber": null,
            "AccountHolder": null,
            "IBAN": null,
            "BIC": null,
            "PrepaidCard": null,
            "PrepaidCardPIN": null,
            "SerialNumbers": null,
            "Wallet": null,
            "ReferenceNumber": null,
            "PayerCountry": null,
            "PayerEmail": null,
            "PayerPhone": null,
            "BankCode": null,
            "BankName": null,
            "BankSortCode": null,
            "SocialSecurityNumber": null,
            "BillingCycleStart": null,
            "BillingCycleEnd": null,
            "UnsubscribeInstructions": null,
            "CustomerLoginID": null,
            "PaidAmount": null,
            "PaidCurrency": null,
            "ProviderExchangeRate": 0,
            "PayerBankAccountID": null
        },
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": "ING Bank",
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": "your_reference_number",
            "SwiftBIC": "INGBDEFF",
            "AccountCurrency": "EUR",
            "AccountNumber": "0010126423",
            "AccountHolder": "Stichting Smart2Pay Escrow Services",
            "IBAN": "DE72 5002 1000 0010 1264 23",
            "AmountToPay": "0.93 EUR",
            "QRCodeURL": null,
            "Instructions": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 1,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=DDC981EDC0426B8C22F57F88FD8B0FF4.4178441"
    }
}

In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h36",
    "Amount": 400,
    "Currency": "PLN",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "BankTransferTestdetails",
    "MethodID": "1",
    "BillingAddress": {
      "Country": "Germany"
    },
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe"
    }
  }
}

Response:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4178427,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181107094050",
        "MerchantTransactionID": "s2ptest_h36",
        "OriginatorTransactionID": null,
        "Amount": "400",
        "Currency": "PLN",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "BankTransferTestdetails",
        "MethodID": 1,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": "20181107094050",
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 4,
            "Info": "Failed",
            "Reasons": [
                {
                    "Code": "147",
                    "Info": "Address details are invalid (BillingAddress)Country - RegEx: ^[a-zA-Z]{2}$;"
                }
            ]
        },
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

Cards Russia Refund Request (Fiscalization)

This setup is required for the Merchants that decide to setup the interaction with their online sales register via Yandex.Checkout.

For Cards Russia the refunds can be full and/or partial depending if you have to return all the money to customer or not. A particular case is for Partial refund as you will need to provide additional parameters.

Below there are two examples of a refund request: one for a full refund, where no additional parameters are needed and one for a partial refund, where additional parameters are needed.

Definition: POST /v1/payments/{id}/refunds

Where:
  • {id} – GlobalPay Payment ID

A 201 HTTP response (Created) is returned if the refund was correctly initialized.

Full refund means you can only refund the entire paid amount for the initial transaction. For full refund you only need to send the Amount parameter, like in the below example:

Request:

POST https://paytest.smart2pay.com/v1/payments/300538912/refunds
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Refund": {
    "MerchantTransactionID": "s2ptest_g28_a",
    "Amount": 100
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "Refund": {
    "ID": 16405,
    "Created": "20170803095139",
    "MerchantTransactionID": "s2ptest_g28_a",
    "OriginatorTransactionID": null,
    "InitialPaymentID": 300538912,
    "Amount": "100",
    "Currency": "EUR",
    "Description": null,
    "TypeID": 5,
    "SiteID": 30201,
    "Details": null,
    "Customer": null,
    "BillingAddress": null,
    "BankAddress": null,
    "Articles": null,
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": null
    }
  }
}

For Cards Russia a particular case is for Partial refund as you will need to provide the below additional parameters in request: Merchant Article ID and Quantity, like in the below example:

Request:

POST https://paytest.smart2pay.com/v1/payments/3006154/refunds
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Refund": {
    "MerchantTransactionID": "YandexPartialRefund",
    "Amount": 980,
    "Articles": [
      {
        "MerchantArticleID": "1231",
        "Quantity": 1
      }
    ]
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "Refund": {
    "ID": 0,
    "Created": null,
    "MerchantTransactionID": "YandexPartialRefund",
    "OriginatorTransactionID": null,
    "InitialPaymentID": 3006154,
    "Amount": "980",
    "Currency": null,
    "Description": null,
    "TypeID": 0,
    "SiteID": 30201,
    "Details": null,
    "Customer": null,
    "BillingAddress": null,
    "BankAddress": null,
    "Articles": [
      {
        "MerchantArticleID": "1231",
        "Name": null,
        "Quantity": 1,
        "Price": 0,
        "VAT": 0,
        "Discount": 0,
        "Type": null,
        "DiscountValue": 0
      }
    ],
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": null
    }
  }
}

AlipayHK Preapproval Request

Definition: POST /v1/preapprovals

To initiate a preapproval, you must create a preapproval object. The parameters of the preapproval are sent in the message body as a JSON object. See below an example of a preapproval request for AlipayHK (1143).

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_alipayhk1",
   "Currency": "HKD",
   "Description": "1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 1145,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "HK"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 28082,
        "Created": "20210202165209",
        "MethodID": 1145,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_alipayhk1",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": null,
        "Currency": "HKD",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "1 year subscription",
        "Customer": {
            "ID": 2625948,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 986,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "HK"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/AlipayOSP/Preapproval/PreapprovalLanding.aspx?ID=23265&Hash=030CBF27F3759B369266CCBC5D84C98A",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

AlipayHK Preapproval Flow

AlipayHK Test Data
Data Value
Phone Number: Enter any 10 digit number. Example: 1234567812
Verification code: Enter any 6 digit number. Example: 123456
Payment password: Enter any 6 digit number. Example: 123456
  1. The customer is redirected to AlipayHK page. The customer needs to add their phone number attached to the AlipayHK wallet.
    1 Add phone number
  2. The customer enters the SMS verification code received via mobile phone.
    1 Verification Code
  3. The customer sees the preapproval details, agrees with the AlipayHK Terms and Conditions and confirms the auto-debit user agreement.
    1 Confirm agreement
  4. The customer enters the payment password. For testing purposes, enter any 6 digit number eg. 123456.
    1 Confirm agreement
  5. The customer is redirected to the AlipayHK confirmation page.
    1 Confirmation page
  6. Upon completion of the payment flow, the customer is redirected to your ReturnUrl.1 Return page when the redirection status is processing

AlipayHK Preapproval Notification

We will notify you about the new status of the preapproval to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Preapproval notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=



{
  "Preapproval": {
    "ID": 28082,
    "Created": "20210202165209",
    "MethodID": 1145,
    "SiteID": 30201,
    "MerchantPreapprovalID": "s2ptest_alipayhk1",
    "RecurringPeriod": null,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "1 year subscription",
    "Customer": {
      "ID": 2625948,
      "MerchantCustomerID": null,
      "Email": "jdoe@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 986,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "HK"
    },
    "Status": {
      "ID": 2,
      "Info": null,
      "Reasons": null
    },
    "RedirectURL": null,
    "MethodOptionID": null,
    "PreapprovedFrequency": null,
    "MandateReference": null,
    "Details": null
  }
}

AlipayHK Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For AlipayHK (1145), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured.

Checkout the below example of a recurring payment request for AlipayHK (1145) that is based on the PreapprovalID. Please send in the payment request the Description parameter and Country parameter that should be the same with the one sent in the Preapproval request.

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "PreapprovalID": 28082,
    "MerchantTransactionID": "s2ptest_alipayhk2",
    "Amount": 100,
    "Currency": "HKD",
    "MethodID": 1145,
    "Description": "Recurring payment",
    "BillingAddress": {
    "Country": "HK"
    } 
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 5879765,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20210202171203",
        "MerchantTransactionID": "s2ptest_alipayhk2",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "HKD",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "Recurring payment",
        "MethodID": 1145,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 986,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "HK"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 28082,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": null
    }
}

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "ID": 5879765,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20210202171203",
    "MerchantTransactionID": "s2ptest_alipayhk2",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "HKD",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "Recurring payment",
    "MethodID": 1145,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 986,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "HK"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 28082,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null,
    "Splits": null
  }
}

Dana Preapproval Request

Definition: POST /v1/preapprovals

To initiate a preapproval, you must create a preapproval object. The parameters of the preapproval are sent in the message body as a JSON object. See below an example of a preapproval request for Dana (1136).

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_Dana_Preapproval",
   "Currency": "IDR",
   "Description": "1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 1136,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "ID"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 22265,
        "Created": "20200330142046",
        "MethodID": 1136,
        "SiteID": 30597,
        "MerchantPreapprovalID": "s2ptest_Dana_Preapproval",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": null,
        "Currency": "IDR",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "1 year subscription",
        "Customer": {
            "ID": 2622497,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 657,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "ID"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/AlipayOSP/Preapproval/PreapprovalLanding.aspx?ID=17588&Hash=E16F327FAA01E8292C6B90C650BDC4FD",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

Dana Preapproval Flow

Dana Test Data
Data Value
Phone Number: Enter any 11 digit number. Example: 12345678123
Verification Code: Enter any 6 digit number. Example: 123456
PIN number: Enter any 6 digit number. Example: 123456
  1. The customer is redirected to Dana page. The customer needs to add their phone number attached to the Dana wallet.1 Add phone number
  2. The customer fills in the 5-digit code received via SMS.1 SMS digit code
  3. The customer enters the PIN number.1 SMS 6 digit code
  4. The customer confirms the auto-debit user agreement1 Confirm agreement

Dana Preapproval Notification

We will notify you about the new status of the preapproval to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Preapproval notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Preapproval": {
    "ID": 22265,
    "Created": "20200330142046",
    "MethodID": 1136,
    "SiteID": 30597,
    "MerchantPreapprovalID": "s2ptest_Dana_Preapproval",
    "RecurringPeriod": 0,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "1 year subscription",
    "Customer": {
      "ID": 2622497,
      "MerchantCustomerID": null,
      "Email": "jdoe@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 657,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "ID"
    },
    "Status": {
      "ID": 2,
      "Info": null,
      "Reasons": null
    },
    "RedirectURL": null,
    "MethodOptionID": 0,
    "PreapprovedFrequency": null,
    "MandateReference": null,
    "Details": null
  }
}

Dana Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For Dana (1136), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured.

Checkout the below example of a recurring payment request for Dana (1136) that is based on the PreapprovalID. Please send in the payment request the Description parameter and Country parameter that should be the same with the ones sent in the Preapproval request.

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "PreapprovalID": 22265,
    "MerchantTransactionID": "reccuringPayin-DanaRecurrent",
    "Amount": 100,
    "Currency": "IDR",
    "MethodID": 1136,
    "Description": "recurring payment",
    "BillingAddress": {
      "Country": "ID"
    }
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4937474,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20200330142936",
        "MerchantTransactionID": "reccuringPayin-DanaRecurrent",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "IDR",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "recurring payment",
        "MethodID": 1136,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30597,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 657,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "ID"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 22265,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 4937474,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20200330142936",
    "MerchantTransactionID": "reccuringPayin-DanaRecurrent",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "IDR",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "recurring payment",
    "MethodID": 1136,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30597,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 657,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "ID"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 22265,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

GCash Preapproval Request

Definition: POST /v1/preapprovals

To initiate a preapproval, you must create a preapproval object. The parameters of the preapproval are sent in the message body as a JSON object. See below an example of a preapproval request for GCash (1134).

With GCash, you can create preapprovals that can allow you to form subsequent recurrent payments. This is the most flexible type and allows the merchant to fully control when to initiate the money transfer(s) between the end user’s account and the merchant’s account (credits or debits). The Preapproval call basically creates a transaction representing the end user’s authorization to use their account for payments on the terms set in the request.

A transaction ID is returned to the merchant within the return URL in the Preapproval response/notification. The merchant must store this transaction ID in the end user’s payment profile to allow future recurrent requests.
This ID is active for 2 years and then the token that allows subsequent recurrent payments will be automatically refreshed after this time period.

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_h-1test52",
   "Currency": "PHP",
   "Description": "1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 1134,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "PH"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 22256,
        "Created": "20200330101451",
        "MethodID": 1134,
        "SiteID": 30597,
        "MerchantPreapprovalID": "s2ptest_h-1test52",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": null,
        "Currency": "PHP",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "1 year subscription",
        "Customer": {
            "ID": 2622497,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 644,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "PH"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/AlipayOSP/Preapproval/PreapprovalLanding.aspx?ID=17580&Hash=FC11CEC58D39D2966F2B71603EBA8726",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

GCash Preapproval Flow

GCash Test Data
Data Value
Phone Number: Enter any 10 digit number. Example: 1234567812
Authentication Code: Enter any 6 digit number. Example: 123456
PIN Number: Enter any 4 digit number. Example: 1234
  1. The Customer enters his mobile phone number.1 Enter phone
  2. The Customer enters the authentication code that was send to his mobile phone number.1 Enter Authentication Code
  3. The customer logs in to his GCash account by entering his PIN number.1 Account login
  4. The customer reviews the details and confirms the preapproval.1 Payment password
  5. Upon completion of the payment flow, the customer is redirected to your ReturnUrl.1 Return page when the redirection status is processing

GCash Preapproval Notification

We will notify you about the new status of the preapproval to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Preapproval notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Preapproval": {
    "ID": 22256,
    "Created": "20200330101451",
    "MethodID": 1134,
    "SiteID": 30597,
    "MerchantPreapprovalID": "s2ptest_h-1test52",
    "RecurringPeriod": 0,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "1 year subscription",
    "Customer": {
      "ID": 2622497,
      "MerchantCustomerID": null,
      "Email": "jdoe@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 644,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "PH"
    },
    "Status": {
      "ID": 2,
      "Info": null,
      "Reasons": null
    },
    "RedirectURL": null,
    "MethodOptionID": 0,
    "PreapprovedFrequency": null,
    "MandateReference": null,
    "Details": null
  }
}

GCash Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For GCash (1134), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured.

Checkout the below example of a recurring payment request for GCash (1134) that is based on the PreapprovalID. Please send in the payment request the Description parameter and Country parameter that should be the same with the ones sent in the Preapproval request.

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "PreapprovalID": 22256,
    "MerchantTransactionID": "reccuringPayina-AlipayOSP666",
    "Amount": 100,
    "Currency": "PHP",
    "MethodID": 1134,
    "Description": "recurring payment",
    "BillingAddress": {
    "Country": "PH"
    } 
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4936892,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20200330102706",
        "MerchantTransactionID": "reccuringPayina-AlipayOSP666",
        "OriginatorTransactionID": null,
        "Amount": 100,
        "Currency": "PHP",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "recurring payment",
        "MethodID": 1134,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30597,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 644,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "PH"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 22256,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 4936892,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20200330102706",
    "MerchantTransactionID": "reccuringPayina-AlipayOSP666",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "PHP",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "recurring payment",
    "MethodID": 1134,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30597,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 644,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "PH"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 22256,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

KakaoPay Preapproval Request

Definition: POST /v1/preapprovals

To initiate a preapproval, you must create a preapproval object. The parameters of the preapproval are sent in the message body as a JSON object. See below an example of a preapproval request for KakaoPay (1135).

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_kAKAOPAY_PreapprovalS1",
   "Currency": "KRW",
   "Description": "1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 1135,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "KR"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 22276,
        "Created": "20200331063928",
        "MethodID": 1135,
        "SiteID": 30597,
        "MerchantPreapprovalID": "s2ptest_kAKAOPAY_PreapprovalS1",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": null,
        "Currency": "KRW",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "1 year subscription",
        "Customer": {
            "ID": 2622497,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 657,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "KR"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/AlipayOSP/Preapproval/PreapprovalLanding.aspx?ID=17598&Hash=64B81EAA7FE00CB58E187BE0615CC7BD",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

Kakaopay Preapproval Flow

  1. The customer is redirected to KakaoPay page where the user needs to confirm the terms of the payment.1 Confirm payment
  2. The Customer fills in the 6-digit code received via SMS. For testing purposes, enter any 6 digit number.1 SMS 6 digit code
  3. The customer confirms the auto-debit user agreement1 Confirm agreement

KakaoPay Preapproval Notification

We will notify you about the new status of the preapproval to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Preapproval notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Preapproval": {
    "ID": 22276,
    "Created": "20200331063928",
    "MethodID": 1135,
    "SiteID": 30597,
    "MerchantPreapprovalID": "s2ptest_kAKAOPAY_PreapprovalS1",
    "RecurringPeriod": 0,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "1 year subscription",
    "Customer": {
      "ID": 2622497,
      "MerchantCustomerID": null,
      "Email": "jdoe@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 657,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "ID"
    },
    "Status": {
      "ID": 2,
      "Info": null,
      "Reasons": null
    },
    "RedirectURL": null,
    "MethodOptionID": 0,
    "PreapprovedFrequency": null,
    "MandateReference": null,
    "Details": null
  }
}

KakaoPay Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For KakaoPay (1135), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured.

Checkout the below example of a recurring payment request for KakaoPay (1135) that is based on the PreapprovalID. Please send in the payment request the Description parameter and Country parameter that should be the same with the ones sent in the Preapproval request.

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "PreapprovalID": 22276,
    "MerchantTransactionID": "reccuringPayin-GCashRecurrent526",
    "Amount": 100,
    "Currency": "KRW",
    "MethodID": 1135,
    "Description": "recurring payment",
    "BillingAddress": {
      "Country": "KR"
    } 
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4938078,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20200331072856",
        "MerchantTransactionID": "reccuringPayin-GCashRecurrent526",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "KRW",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "recurring payment",
        "MethodID": 1135,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30597,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 653,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "KR"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 22276,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 4938078,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20200331072856",
    "MerchantTransactionID": "reccuringPayin-GCashRecurrent526",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "KRW",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "recurring payment",
    "MethodID": 1135,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30597,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 653,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "KR"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 22276,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Truemoney Preapproval Request

Definition: POST /v1/preapprovals

To initiate a preapproval, you must create a preapproval object. The parameters of the preapproval are sent in the message body as a JSON object. See below an example of a preapproval request for Truemoney (1143).

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_truemoney3",
   "Currency": "THB",
   "Description": "1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 1143,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "TH"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 28076,
        "Created": "20210202153841",
        "MethodID": 1143,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_truemoney3",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": null,
        "Currency": "THB",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "1 year subscription",
        "Customer": {
            "ID": 2625948,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 1540,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "TH"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/AlipayOSP/Preapproval/PreapprovalLanding.aspx?ID=23259&Hash=50143980E584E7DEE54CBA48BA1EC543",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

Truemoney Preapproval Flow

Truemoney Test Data
Data Value
Phone Number: Enter any 10 digit number. Example: 1234567812
Password: Enter any 4 digit number. Example: 1234
  1. The customer is redirected to Truemoney page. The customer needs to add their phone number attached to the Truemoney wallet and the password.1 Add phone number
  2. The customer confirms the auto-debit user agreement1 Confirm agreement
  3. Upon completion of the payment flow, the customer is redirected to your ReturnUrl.1 Return page when the redirection status is processing

Truemoney Preapproval Notification

We will notify you about the new status of the preapproval to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Preapproval notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=



{
  "Preapproval": {
    "ID": 28076,
    "Created": "20210202153841",
    "MethodID": 1143,
    "SiteID": 30201,
    "MerchantPreapprovalID": "s2ptest_truemoney3",
    "RecurringPeriod": null,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "1 year subscription",
    "Customer": {
      "ID": 2625948,
      "MerchantCustomerID": null,
      "Email": "jdoe@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 1540,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "TH"
    },
    "Status": {
      "ID": 2,
      "Info": null,
      "Reasons": null
    },
    "RedirectURL": null,
    "MethodOptionID": null,
    "PreapprovedFrequency": null,
    "MandateReference": null,
    "Details": null
  }
}

Truemoney Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For Truemoney (1143), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured.

Checkout the below example of a recurring payment request for Truemoney (1143) that is based on the PreapprovalID. Please send in the payment request the Description parameter and Country parameter that should be the same with the ones sent in the Preapproval request.

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "PreapprovalID": 28076,
    "MerchantTransactionID": "s2ptest_truemoney1",
    "Amount": 100,
    "Currency": "THB",
    "MethodID": 1143,
    "Description": "recurring payment",
    "BillingAddress": {
    "Country": "TH"
    } 
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 5879743,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20210202154700",
        "MerchantTransactionID": "s2ptest_truemoney1",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "THB",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "recurring payment",
        "MethodID": 1143,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 1540,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "TH"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 28076,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": null
    }
}

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "ID": 5879743,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20210202154700",
    "MerchantTransactionID": "s2ptest_truemoney1",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "THB",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "recurring payment",
    "MethodID": 1143,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 1540,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "TH"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 28076,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null,
    "Splits": null
  }
}

Touch’n Go eWallet Preapproval Request

Definition: POST /v1/preapprovals

To initiate a preapproval, you must create a preapproval object. The parameters of the preapproval are sent in the message body as a JSON object. See below an example of a preapproval request for Touch’n Go eWallet (1144).

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_tng1",
   "Currency": "MYR",
   "Description": "1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 1144,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "MY"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 28080,
        "Created": "20210202161103",
        "MethodID": 1144,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_tng1",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": null,
        "Currency": "MYR",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "1 year subscription",
        "Customer": {
            "ID": 2625948,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 701,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "MY"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/AlipayOSP/Preapproval/PreapprovalLanding.aspx?ID=23263&Hash=DE44DA5FA939A8B396DDE346A66835D6",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

Touch’n Go eWallet Preapproval Flow

Touch’n Go eWalle Test Data
Data Value
Phone Number: Enter any 10 digit number. Example: 1234567812
PIN Number: Enter any 6 digit number. Example: 123456
  1. The customer is redirected to Touch’n Go page. The customer needs to add their phone number attached to the Touch’n wallet and the 6 digit PIN. For testing purposes, please enter any 6 digit number eg. 123456.
    1 Add phone number
  2. The customer confirms the auto-debit user agreement.
    1 Confirm agreement
  3. The customer is redirected to the Touch’n Go confirmation page.
    1 Add phone number
  4. Upon completion of the payment flow, the customer is redirected to your ReturnUrl.1 Return page when the redirection status is processing

Touch’n Go eWallet Preapproval Notification

We will notify you about the new status of the preapproval to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Preapproval notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=



{
  "Preapproval": {
    "ID": 28080,
    "Created": "20210202161103",
    "MethodID": 1144,
    "SiteID": 30201,
    "MerchantPreapprovalID": "s2ptest_tng1",
    "RecurringPeriod": null,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "1 year subscription",
    "Customer": {
      "ID": 2625948,
      "MerchantCustomerID": null,
      "Email": "jdoe@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 701,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "MY"
    },
    "Status": {
      "ID": 2,
      "Info": null,
      "Reasons": null
    },
    "RedirectURL": null,
    "MethodOptionID": null,
    "PreapprovedFrequency": null,
    "MandateReference": null,
    "Details": null
  }
}

Touch’n Go eWallet Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For Touch’n Go eWallet (1144), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured.

Checkout the below example of a recurring payment request for Touch’n Go eWallet (1144) that is based on the PreapprovalID. Please send in the payment request the Description parameter and Country parameter that should be the same with the ones sent in the Preapproval request.

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "PreapprovalID": 28080,
    "MerchantTransactionID": "s2ptest_tng2",
    "Amount": 100,
    "Currency": "MYR",
    "MethodID": 1144,
    "Description": "Recurring payment",
    "BillingAddress": {
    "Country": "MY"
    } 
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 5879762,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20210202162904",
        "MerchantTransactionID": "s2ptest_tng2",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "MYR",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "Recurring payment",
        "MethodID": 1144,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 701,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "MY"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 28080,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": null
    }
}

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "ID": 5879762,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20210202162904",
    "MerchantTransactionID": "s2ptest_tng2",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "MYR",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "Recurring payment",
    "MethodID": 1144,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 701,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "MY"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 28080,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null,
    "Splits": null
  }
}

Capture Scenarios for Klarna Payments

Scenario Status / Return Code Description
The transaction has been fully captured.

Only payments with “Authorized” status can be captured.
Status: 2 Success
The payment has been partially captured.

Only payments with “Authorized” status can be captured.
Status: 35 Partially Captured
Retry Capture.

This happens when the request timeouts at Provider; a new capture request has to be initiated.
Return Code: 157 Unable to capture transaction
The transaction could not be captured.

The transaction is not in an Authorized status.
Return Code: 17 Payment is invalid

For a complete list of all the possible Return Code IDs go to our section GlobalPay Return Codes.

See the request – response examples for the above possible scenarios:

Success Status

A payment can only be captured if it has an Authorized status. Once the payment has an Authorized status, you can capture either the full amount or a partial amount of the initial authorized amount for the transaction.

A 200 HTTP response (OK) is returned if the request was completed successfully.

Full capture means you capture the entire authorized amount for the initial transaction.

Request:

POST: https://paytest.smart2pay.com/v1/payments/8061531/capture
Authorization: Basic MzAwNzc6ZXJ2YVJNY1VqcGJXd0dhWit0ayswWGdNdUJDaVRuS2dzSDVCUUJPcUk2a3VFb2FKVnI=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 8061531,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20250217102607",
        "MerchantTransactionID": "XYZtest1739787966",
        "OriginatorTransactionID": null,
        "Amount": "2000",
        "Currency": "EUR",
        "CapturedAmount": "2000",
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "ReturnURLSuccess": null,
        "ReturnURLFailure": null,
        "ReturnURLCancel": null,
        "ReturnURLProcessing": null,
        "Description": null,
        "MethodID": 1078,
        "MethodOptionID": null,
        "MethodOptionIdString": null,
        "BankName": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30563,
        "NotificationDateTime": "20250217102656",
        "Customer": null,
        "BillingAddress": {
            "ID": 18658,
            "City": "Wien",
            "ZipCode": "1060",
            "State": null,
            "Street": "Mariahilfer Strasse 10",
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "AT"
        },
        "ShippingAddress": {
            "ID": 18658,
            "City": "Wien",
            "ZipCode": "1060",
            "State": null,
            "Street": "Mariahilfer Strasse 10",
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "AT"
        },
        "Articles": [
            {
                "MerchantArticleID": "1231",
                "Name": "TEST",
                "Quantity": 1,
                "Price": "2000",
                "VAT": "0",
                "Discount": "0",
                "Type": "5",
                "TaxType": 0,
                "DiscountValue": "0"
            }
        ],
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 2,
            "Info": "Success",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": "a7d087d9-2cfb-4f7f-b767-5d014141aab3",
        "OriginalMerchantTID": null,
        "Unknown": false,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://webapp-apm-globalpay-api-qa.nuvei.com/Home?PaymentToken=8098486DFB91DDC9BBE2B45609F3DA3F.8061531",
        "Splits": null
    }
}

Partially Captured Status

  • Partial capture means you have the possibility to capture a smaller amount than the one from the initial authorized transaction. Partial capture is used when you have sent at least part of the order to the consumer and want to capture the amount for the item(s) that have been shipped. You can perform only one partial capture for an authorized transaction with the limitation that the amount of the partial capture to be smaller or equal than the initial authorized amount. The remaining amount that has not been captured will be returned to the client’s account. There are 3 possibilities to partially capture a payment:
    1. Specify only the captured amount parameter in the query string, in order to partially capture the payment, like in the below example:

      Request:

      POST: https://paytest.smart2pay.com/v1/payments/8061531/capture?amount=50
      Authorization: Basic MzAwNzc6ZXJ2YVJNY1VqcGJXd0dhWit0ayswWGdNdUJDaVRuS2dzSDVCUUJPcUk2a3VFb2FKVnI=
      

      Response:

      HTTP/1.1 200 OK
      Content-Type: application/json; charset=utf-8
      
      {
          "Payment": {
              "ID": 8061528,
              "SkinID": null,
              "ClientIP": null,
              "Created": "20250217101602",
              "MerchantTransactionID": "XYZtest1739787362",
              "OriginatorTransactionID": null,
              "Amount": "2000",
              "Currency": "EUR",
              "CapturedAmount": "100",
              "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
              "ReturnURLSuccess": null,
              "ReturnURLFailure": null,
              "ReturnURLCancel": null,
              "ReturnURLProcessing": null,
              "Description": null,
              "MethodID": 1078,
              "MethodOptionID": null,
              "MethodOptionIdString": null,
              "BankName": null,
              "IncludeMethodIDs": null,
              "ExcludeMethodIDs": null,
              "PrioritizeMethodIDs": null,
              "SiteID": 30563,
              "NotificationDateTime": "20250217101745",
              "Customer": null,
              "BillingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "ShippingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "Articles": [
                  {
                      "MerchantArticleID": "1231",
                      "Name": "TEST",
                      "Quantity": 1,
                      "Price": "2000",
                      "VAT": "0",
                      "Discount": "0",
                      "Type": "5",
                      "TaxType": 0,
                      "DiscountValue": "0"
                  }
              ],
              "Details": null,
              "ReferenceDetails": null,
              "CustomParameters": null,
              "PreapprovalID": null,
              "Status": {
                  "ID": 35,
                  "Info": "PartiallyCaptured",
                  "Reasons": null
              },
              "Fraud": null,
              "MethodTransactionID": "aa2f6a99-35a0-434e-bba4-6fb0a228a0ea",
              "OriginalMerchantTID": null,
              "Unknown": false,
              "TokenLifetime": 10,
              "Capture": null,
              "PreapprovalDetails": null,
              "RedirectURL": "https://webapp-apm-globalpay-api-qa.nuvei.com/Home?PaymentToken=AA7E73E1C498B38E6400E"
          }
      }

    2. Specify the captured amount parameter in the query string and send the appropriate details for the Articles object together with the Shipping and Customer information, like in the below example:

      Request:

      POST: https://paytest.smart2pay.com/v1/payments/8061525/capture?amount=50
      Authorization: Basic MzAwNzc6ZXJ2YVJNY1VqcGJXd0dhWit0ayswWGdNdUJDaVRuS2dzSDVCUUJPcUk2a3VFb2FKVnI=
      
      HTTP/1.1 200 OK
      Content-Type: application/json; charset=utf-8
      
      {
        "Payment": {
          "Articles": [
            {
            "MerchantArticleID": "1231",
            "Quantity": 1
            }
          ]
        }
      }

      Response:

      HTTP/1.1 200 OK
      Content-Type: application/json; charset=utf-8
      
      {
          "Payment": {
              "ID": 8061528,
              "SkinID": null,
              "ClientIP": null,
              "Created": "20250217101602",
              "MerchantTransactionID": "XYZtest1739787362",
              "OriginatorTransactionID": null,
              "Amount": "2000",
              "Currency": "EUR",
              "CapturedAmount": "100",
              "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
              "ReturnURLSuccess": null,
              "ReturnURLFailure": null,
              "ReturnURLCancel": null,
              "ReturnURLProcessing": null,
              "Description": null,
              "MethodID": 1078,
              "MethodOptionID": null,
              "MethodOptionIdString": null,
              "BankName": null,
              "IncludeMethodIDs": null,
              "ExcludeMethodIDs": null,
              "PrioritizeMethodIDs": null,
              "SiteID": 30563,
              "NotificationDateTime": "20250217101745",
              "Customer": null,
              "BillingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "ShippingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "Articles": [
                  {
                      "MerchantArticleID": "1231",
                      "Name": "TEST",
                      "Quantity": 1,
                      "Price": "2000",
                      "VAT": "0",
                      "Discount": "0",
                      "Type": "5",
                      "TaxType": 0,
                      "DiscountValue": "0"
                  }
              ],
              "Details": null,
              "ReferenceDetails": null,
              "CustomParameters": null,
              "PreapprovalID": null,
              "Status": {
                  "ID": 35,
                  "Info": "PartiallyCaptured",
                  "Reasons": null
              },
              "Fraud": null,
              "MethodTransactionID": "aa2f6a99-35a0-434e-bba4-6fb0a228a0ea",
              "OriginalMerchantTID": null,
              "Unknown": false,
              "TokenLifetime": 10,
              "Capture": null,
              "PreapprovalDetails": null,
              "RedirectURL": "https://webapp-apm-globalpay-api-qa.nuvei.com/Home?PaymentToken=AA7E73E1C498B38E6400E"
          }
      }

  • Return Code: 157 – Unable to capture transaction. The transaction could not be captured. Retry Capture. This happens when the request timeouts at Provider.

    Request:

    POST: https://paytest.smart2pay.com/v1/payments/3434068/capture
    Authorization: Basic MzAwNzc6ZXJ2YVJNY1VqcGJXd0dhWit0ayswWGdNdUJDaVRuS2dzSDVCUUJPcUk2a3VFb2FKVnI=
    

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 3434068,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20171123141730",
            "MerchantTransactionID": "testpaymentauthorized",
            "OriginatorTransactionID": null,
            "Amount": "900",
            "Currency": "DKK",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": "test smart2pay",
            "MethodID": 1078,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20171123141847",
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 9,
                "Info": "Authorized",
                "Reasons": [
                    {
                        "Code": 157,
                        "Info": "Unable to capture transaction"
                    }
                ]
            },
            "MethodTransactionID": null,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null
        }
    }

  • Return Code: 17 – Payment is invalid. The transaction could not be captured. The transaction is not in an Authorized status. You can receive this response when the payment you want to Capture is not Authorized or when the payment has already been Captured.

    Request:

    POST: https://paytest.smart2pay.com/v1/payments/8061512/capture
    Authorization: Basic MzAwNzc6ZXJ2YVJNY1VqcGJXd0dhWit0ayswWGdNdUJDaVRuS2dzSDVCUUJPcUk2a3VFb2FKVnI=
    

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8{
        "Payment": {
            "ID": 8061512,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20250217081415",
            "MerchantTransactionID": null,
            "OriginatorTransactionID": null,
            "Amount": null,
            "Currency": null,
            "CapturedAmount": null,
            "ReturnURL": null,
            "ReturnURLSuccess": null,
            "ReturnURLFailure": null,
            "ReturnURLCancel": null,
            "ReturnURLProcessing": null,
            "Description": null,
            "MethodID": 1078,
            "MethodOptionID": null,
            "MethodOptionIdString": null,
            "BankName": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30563,
            "NotificationDateTime": "20250217084539",
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 2,
                "Info": "Success",
                "Reasons": [
                    {
                        "Code": "17",
                        "Info": "Payment is invalid - 8061512"
                    }
                ]
            },
            "Fraud": null,
            "MethodTransactionID": null,
            "OriginalMerchantTID": null,
            "Unknown": false,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null,
            "Splits": null
        }
    }

Multibanco SIBS Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for Multibanco SIBS method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

In order to display the payment details to your customers on your own page, you can send in the request the CustomerName and Country parameters. Use the information received in Response in the ReferenceDetails object.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

For more information about status codes, please go to Basic HTTP Status Codes.

Request: 

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
   "Payment": {
      "MerchantTransactionID": "s2ptest_h40",
      "Amount": "400",
      "Currency": "EUR",
      "ReturnURL": "http://demo.smart2pay.com/redirect.php",
      "Description": "SIBSTestDetails",
      "MethodID": 20,
      "BillingAddress": {
         "Country": "PT"
      },
      "Customer": {
         "FirstName": "John",
         "LastName": "Doe"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4178449,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181107100206",
        "MerchantTransactionID": "s2ptest_h40",
        "OriginatorTransactionID": null,
        "Amount": "400",
        "Currency": "EUR",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "SIBSTestDetails",
        "MethodID": 20,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": {
            "ID": 142823,
            "MerchantCustomerID": null,
            "Email": null,
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "SocialSecurityNumber2": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 705,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "PT"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": null,
            "EntityID": null,
            "EntityNumber": "11302",
            "ReferenceID": null,
            "ReferenceNumber": "022 518 828",
            "SwiftBIC": null,
            "AccountCurrency": null,
            "AccountNumber": null,
            "AccountHolder": null,
            "IBAN": null,
            "AmountToPay": "4 EUR",
            "QRCodeURL": null,
            "Instructions": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 1,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=DAB863DD12A9DB642BF15252CB89CAC2.4178449"
    }
}

PayWithMyBank Preapproval Request

Definition: POST /v1/preapprovals

To initiate a preapproval, you must create a preapproval object. The parameters of the preapproval are sent in the message body as a JSON object. See below an example of a preapproval request for PayWithMyBank (58).

With PayWithMyBank, you can create preapprovals that can allow you to form subsequent recurrent payments. This is the most flexible type and allows the merchant to fully control when to initiate the money transfer(s) between the end user’s account and the merchant’s account (credits or debits). The Preapproval call basically creates a transaction representing the end user’s authorization to use their account for payments on the terms set in the request.

A transaction ID is returned to the merchant within the return URL in the Preapproval response/notification. The merchant must store this transaction ID in the end user’s payment profile to allow future recurrent requests. The amount sent on the initial call defines the maximum aggregate amount that can be captured from the end user’s account across all recurrent calls. A zero-amount value on the Preapproval call removes this upper bound limit. With that setting, the merchant can enable open-ended recurrent scenarios.

For PayWithMyBank preapproval requests CustomerName and CustomerEmail parameters are mandatory in the initial payment request.

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_h-1",
   "PreapprovedMaximumAmount": 20,
   "Currency": "USD",
   "Description": "1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 58,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "US"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 19800,
        "Created": "20190729134913",
        "MethodID": 58,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_h-1",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": "20",
        "Currency": "USD",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "1 year subscription",
        "Customer": {
            "ID": 2625948,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 520,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "US"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/PWMB/Landing/PreapprovalLanding.aspx?ID=15351&Hash=CD3F91C3DF49E901E91240FA42D89A64",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

PayWithMyBank Preapproval Notification

Upon successful approval, we will notify you about the new status of the preapproval to the URL you setup in the Merchant Dashboard.

You need to respond with HTTP Status 204 (No Content)!

Preapproval notification format for PayWithMyBank:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
"Preapproval": {
  "ID": 19800,
  "Created": "20190729134913",
  "MethodID": 58,
  "SiteID": 30201,
  "MerchantPreapprovalID": "s2ptest_h-1",
  "RecurringPeriod": 0,
  "PreapprovedMaximumAmount": "20",
  "Currency": null,
  "ReturnURL": "http://demo.smart2pay.com/redirect.php",
  "Description": "1 year subscription",
  "Customer": {
    "ID": 2625948,
    "MerchantCustomerID": null,
    "Email": "jdoe@gmail.com",
    "FirstName": "John",
    "LastName": "Doe",
    "Gender": null,
    "SocialSecurityNumber": null,
    "Phone": null,
    "Company": null,
    "DateOfBirth": null
  },
  "BillingAddress": {
    "ID": 520,
    "City": null,
    "ZipCode": null,
    "State": null,
    "Street": null,
    "StreetNumber": null,
    "HouseNumber": null,
    "HouseExtension": null,
    "Country": "US"
  },
  "Status": {
    "ID": 2,
    "Info": null,
    "Reasons": null
  },
  "RedirectURL": null,
  "MethodOptionID": 0,
  "PreapprovedFrequency": null,
  "MandateReference": null,
  "Details": null
  }
}

Response:

204 No Content

The message contains a Preapproval object with an updated Status, which can have the following meanings:

PREAPPROVAL STATUS
ID Info Description
1 Pending The customer needs to confirm the preapproval
2 Open The customer confirmed and you can use the preapproval to initiate recurring payments
4 ClosedByCustomer The preapproval is closed and can no longer be used to initiate recurring payments

PayWithMyBank Change a Preapproval

Definition: PATCH /v1/preapprovals/{id}

Where:
  • {id} – GlobalPay Preapproval ID

You can change the attributes of an already created preapproval by applying a PATCH.

Checkout the below example to change a preapproval for PayWithMyBank (58):

Request:

PATCH https://paytest.smart2pay.com/v1/preapprovals/19800
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
 "Preapproval": {
   "MerchantPreapprovalID": "s2ptest_h-1",
   "PreapprovedMaximumAmount": 20,
   "Currency": "USD",
   "Description": "Update: 1 year subscription",
   "ReturnURL": "http://demo.smart2pay.com/redirect.php",
   "MethodID": 58,
   "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "jdoe@gmail.com"
     },
   "BillingAddress": {
      "Country": "US"
      }
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 19800,
        "Created": "20190729134913",
        "MethodID": 58,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_h-1",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": "20",
        "Currency": "USD",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "Update: 1 year subscription",
        "Customer": {
            "ID": 2625948,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 520,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "US"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/PWMB/Landing/PreapprovalLanding.aspx?ID=15352&Hash=8FCF71570B0E7CE025C33B27E34F4493",
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

PayWithMyBank Close a Preapproval

Definition: DELETE /v1/preapprovals/{id}

Where:
  • {id} – GlobalPay Preapproval ID

To close a preapproval, you must send a DELETE action for an existing preapproval object.

Checkout the below example to close a preapproval for PayWithMyBank (58):

Request:

DELETE https://paytest.smart2pay.com/v1/preapprovals/19800
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 19800,
        "Created": "20190729134913",
        "MethodID": 58,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_h-1",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": "20",
        "Currency": "USD",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "Update: 1 year subscription",
        "Customer": {
            "ID": 2625948,
            "MerchantCustomerID": null,
            "Email": "jdoe@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 520,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "US"
        },
        "Status": {
            "ID": 4,
            "Info": "ClosedByCustomer",
            "Reasons": null
        },
        "RedirectURL": null,
        "MethodOptionID": 0,
        "PreapprovedFrequency": null,
        "MandateReference": null,
        "Details": null
    }
}

PayWithMyBank Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For PayWithMyBank (58), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured:

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk={
 "Payment": {
   "PreapprovalID": 19800,
   "MerchantTransactionID": "s2ptest_h-1",
   "Amount": 20,
   "Currency": "USD",
   "MethodID": 58
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4722746,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190729142257",
        "MerchantTransactionID": "s2ptest_h-1",
        "OriginatorTransactionID": null,
        "Amount": "20",
        "Currency": "USD",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "",
        "MethodID": 58,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 19800,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

Please be aware that the final status of the payment can be received in up to 3 business days depending on the customer’s Bank used!

Capture scenarios for PostFinance Card

 

Capture Scenarios Response Status Description Notification Status Description

The transaction has been fully captured.

Only payments with “Authorized” status (9) can be captured.
Intermediary Status: 13 Capture Requested Final Notification Status: 2 Success

The payment has been partially captured.

Only payments with “Authorized” status can be partially captured. The payment has been sent out to be partially captured, but the payment gateway has not yet confirmed that the payment is successful.
Intermediary Status: 13 Capture Requested Final Notification Status: 35 Partially Captured
Capture Failed Scenarios Return Code Description

Retry Capture

This happens when the request timeouts at Provider; a new capture request has to be initiated.
Return Code: 157 Unable to capture transaction

The transaction could not be captured.

The transaction is not in an Authorized status (it has already been fully Captured or Partially Captured).
Return Code: 17 Payment is invalid

For a complete list of all the possible Return Code IDs go to our section GlobalPay Return Codes.

See the request – response examples for the above possible scenarios:

  • Success Status

    A payment can only be captured if it has an Authorized status. Once the payment has an Authorized status (9), you can capture either the full amount or a partial amount of the initial authorized amount for the transaction.

    A 200 HTTP response (OK) is returned if the request was completed successfully.

    Full capture means you capture the entire authorized amount for the initial transaction.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4424180/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4424180,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190320121124",
            "MerchantTransactionID": "PostFinance_55EMI",
            "OriginatorTransactionID": null,
            "Amount": "1000",
            "Currency": "CHF",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20190320121338",
            "Customer": null,
            "BillingAddress": {
                "ID": 7808,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "CH"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 13,
                "Info": "CaptureRequested",
                "Reasons": null
            },
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
        }
    }
    

    We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

    You need to respond with HTTP code 204 (No Content)!

    Payment notification format:

    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
      "Payment": {
        "ID": 4424180,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190320121124",
        "MerchantTransactionID": "PostFinance_55EMI",
        "OriginatorTransactionID": null,
        "Amount": "1000",
        "Currency": "CHF",
        "CapturedAmount": "1000",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 1129,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30151,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
          "ID": 7808,
          "City": null,
          "ZipCode": null,
          "State": null,
          "Street": null,
          "StreetNumber": null,
          "HouseNumber": null,
          "HouseExtension": null,
          "Country": "CH"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
      }
    }
    

  • Partially Captured Status

    Partial capture means you have the possibility to capture a smaller amount than the one from the initial authorized transaction. Partial capture is used when you have sent at least part of the order to the consumer and want to capture the amount for the item(s) that have been shipped.

    You can perform only one partial capture for an authorized transaction with the limitation that the amount of the partial capture to be smaller or equal than the initial authorized amount.

    Specify only the captured amount parameter in the query string, in order to partially capture the payment, like in the below example:

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4424180/capture?amount=500
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4424180,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190320121124",
            "MerchantTransactionID": "PostFinance_55EMI",
            "OriginatorTransactionID": null,
            "Amount": "1000",
            "Currency": "CHF",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20190320121338",
            "Customer": null,
            "BillingAddress": {
                "ID": 7808,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "CH"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 13,
                "Info": "CaptureRequested",
                "Reasons": null
            },
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
        }
    }
    

    We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

    You need to respond with HTTP code 204 (No Content)!

    Payment notification format:

    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk={
      "Payment": {
        "ID": 4424180,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190320121124",
        "MerchantTransactionID": "PostFinance_55EMI",
        "OriginatorTransactionID": null,
        "Amount": "1000",
        "Currency": "CHF",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 1129,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30151,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
          "ID": 7808,
          "City": null,
          "ZipCode": null,
          "State": null,
          "Street": null,
          "StreetNumber": null,
          "HouseNumber": null,
          "HouseExtension": null,
          "Country": "CH"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 35,
          "Info": "PartiallyCaptured",
          "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
      }
    }
    

  • Return Code: 157 – Unable to capture transaction

    The transaction could not be captured. Retry Capture. This happens when the request timeouts at Provider.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4426277/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4426277,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190322135942",
            "MerchantTransactionID": "s2ptest_a3",
            "OriginatorTransactionID": null,
            "Amount": "1000",
            "Currency": "CHF",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": "test test",
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20190322140025",
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 9,
                "Info": "Authorized",
                "Reasons": [
                    {
                        "Code": "157",
                        "Info": "Unable to capture transaction"
                    }
                ]
            },
            "MethodTransactionID": null,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null
        }
    }

  • Return Code: 17 – Payment is invalid

    The transaction could not be captured. The transaction is not in an Authorized status. You can receive this response when the payment you want to Capture is not Authorized or when the payment has already been Captured.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4426219/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8{
        "Payment": {
            "ID": 4426219,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190322125640",
            "MerchantTransactionID": null,
            "OriginatorTransactionID": null,
            "Amount": null,
            "Currency": null,
            "CapturedAmount": null,
            "ReturnURL": null,
            "Description": null,
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": null,
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 13,
                "Info": "CaptureRequested",
                "Reasons": [
                    {
                        "Code": "17",
                        "Info": "Payment is invalid - 4426219"
                    }
                ]
            },
            "MethodTransactionID": null,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null
        }
    }

SEPA Direct Debit Preapproval Request

General information to be known for SEPA Direct Debit:

  • The customer’s bank needs to be enrolled in the SEPA Direct Debit CORE scheme or this service needs to be activated on the customer’s bank account.
  • Ask customer to make sure they have the necessary funds in their account. Up to 80% of payments failures are caused by insufficient amount.
  • According to SEPA Direct Debit rules, the customers can Reverse/Cancel a Direct Debit (claim the money back) in 8 weeks, no questions asked and up to 13 months, if his bank agrees. If this happens, you will receive a Reversed notification with ReasonCode and Reason (R-Transaction) which you should properly handle on your side.
  • For B2B transactions please add the CompanyName parameter.
  • The currency for SEPA Direct Debit CORE is EUR, however the customers can use their account although this is not an EUR account as long as the bank is enrolled in SEPA Direct Debit CORE scheme. In this case, some exchange fees might be charged by their bank.
  • Merchants/Users can decide the actual ExecutionDate of a mandate – they can send the date on which the amount will actually be debited from the Debtor’s account.

Checkout the below example of a preapproval request for SEPA Direct Debit (84), where MethodOptionID parameter is mandatory to be sent in the initial payment request.

Please note that if you have a Company, you also need to send the Company parameter in the request.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

Request:

POST https://paytest.smart2pay.com/v1/preapprovals
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Preapproval": {
    "MerchantPreapprovalID": "s2ptest_h11",
    "Description": "SEPA DD preapproval request",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "MethodID": 84,
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "youremail@gmail.com",
      "Phone": "+31651111111"
    },
    "BillingAddress": {
      "Street": "Brink",
      "StreetNumber": "27c",
      "ZipCode": "1251",
      "City": "Laren",
      "Country": "NL"
    },
    "MethodOptionID": 1
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Preapproval": {
        "ID": 13199,
        "Created": "20181101142508",
        "MethodID": 84,
        "SiteID": 30201,
        "MerchantPreapprovalID": "s2ptest_h11",
        "RecurringPeriod": 0,
        "PreapprovedMaximumAmount": null,
        "Currency": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "SEPA DD preapproval request",
        "Customer": {
            "ID": 135127,
            "MerchantCustomerID": null,
            "Email": "youremail@gmail.com",
            "FirstName": "John",
            "LastName": "Doe",
            "Gender": null,
            "SocialSecurityNumber": null,
            "SocialSecurityNumber2": null,
            "Phone": "+31651111111",
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "ID": 5103,
            "City": "Laren",
            "ZipCode": "1251",
            "State": null,
            "Street": "Brink",
            "StreetNumber": "27c",
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "NL"
        },
        "Status": {
            "ID": 1,
            "Info": "Pending",
            "Reasons": null
        },
        "RedirectURL": "https://europaytest.smart2pay.com/SlimPay/Landing/PreapprovalLanding.aspx?ID=10084&Hash=CD71CA781BD1F59F52F8F0B2D20A807E",
        "MethodOptionID": 1,
        "PreapprovedFrequency": null,
        "MandateReference": null
    }
}

Redirect the customer to the RedirectURL where he will approve the automatic debit. Once the Customer approves the debit, he will receives via email the digital signed mandate.

SEPA Direct Debit Preapproval Notification

Upon successful approval, we will notify you about the new status of the preapproval to the URL you setup in the Merchant Dashboard.

You need to respond with HTTP Status 204 (No Content)!

Preapproval notification for status Open (2):

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Preapproval": {
    "ID": 13199,
    "Created": "20181101142508",
    "MethodID": 84,
    "SiteID": 30201,
    "MerchantPreapprovalID": "s2ptest_h11",
    "RecurringPeriod": 0,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "SEPA DD preapproval request",
    "Customer": {
      "ID": 135127,
      "MerchantCustomerID": null,
      "Email": "youremail@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": null,
      "SocialSecurityNumber2": null,
      "Phone": "+31651111111",
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 5103,
      "City": "Laren",
      "ZipCode": "1251",
      "State": null,
      "Street": "Brink",
      "StreetNumber": "27c",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "NL"
    },
    "Status": {
      "ID": 2,
      "Info": null,
      "Reasons": null
    },
    "RedirectURL": null,
    "MethodOptionID": 0,
    "PreapprovedFrequency": null,
    "MandateReference": "SLMP004606504"
  }
}

Response:

204 No Content

The message contains a Preapproval object with an updated Status, which can have the following meanings:

PREAPPROVAL STATUS
ID Info Description
1 Pending The customer needs to confirm the preapproval
2 Open The customer confirmed and you can use the preapproval to initiate recurring payments
4 ClosedByCustomer The preapproval is closed and can no longer be used to initiate recurring payments

If the mandate is cancelled by the customer or there is an error in the creation process than a notification with the specific reason is sent.

Preapproval notification for status ClosedByCustomer (4):

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Preapproval": {
    "ID": 729222,
    "Created": "20181025083420",
    "MethodID": 84,
    "SiteID": 30025,
    "MerchantPreapprovalID": "preapptestingS4526352",
    "RecurringPeriod": 0,
    "PreapprovedMaximumAmount": null,
    "Currency": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "sample description",
    "Customer": {
      "ID": 341703,
      "MerchantCustomerID": null,
      "Email": "youremail@gmail.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": "",
      "SocialSecurityNumber2": null,
      "Phone": "+40765260000",
      "Company": "Smart2Pay",
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 8438,
      "City": "Iași",
      "ZipCode": "23900000",
      "State": null,
      "Street": "Sf. Lazar",
      "StreetNumber": "1",
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "RO"
    },
    "Status": {
      "ID": 4,
      "Info": null,
      "Reasons": [
        {
          "Code": "246",
          "Info": "Preapproval cancelled by consumer"
        }
      ]
    },
    "RedirectURL": null,
    "MethodOptionID": 0,
    "PreapprovedFrequency": null,
    "MandateReference": null
  }
}

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

SEPA Direct Debit Recurring Payment

Direct Debits can be initiated based on the PreapprovalID received in the Preapproval response. If you wish to have the Direct Debit executed at a specific date, you only need to send in the request the ExecutionDate parameter.

  • Recurring payment request for SEPA Direct Debit (84) that is based on the PreapprovalID (also send in the request the Description parameter and Country parameter that should be the same with the ones sent in the Preapproval request):

    Request:

    POST https://paytest.smart2pay.com/v1/payments/recurrent
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
     "Payment": {
       "PreapprovalID":13199,
       "MerchantTransactionID": "s2ptest_h13",
       "Amount": 100,
       "Currency": "EUR",
       "MethodID": 84,
       "Description":"SEPA DD recurrent payment",
       "BillingAddress": {
         "Country": "NL"
        }
      }
    }

  • Recurring payment request for SEPA Direct Debit (84) that includes ExecutionDate parameter:

    Execution day for a SEPA Direct Debit – the moment funds are transferred from debtor’s bank to the merchant’s SEPA DD account.This can be setup by the Merchant/customer by sending ExecutionDate in the Direct Debit payment request or it can be set by default by the SEPA DD provider (which is usually set at 1-2 days from the Direct Debit payment request date).

    Request:

    POST https://paytest.smart2pay.com/v1/payments/recurrent
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
     "Payment": {
       "PreapprovalID":13165,
       "MerchantTransactionID": "s2ptest_h19",
       "Amount": 100,
       "Currency": "EUR",
       "MethodID": 84,
       "Description":"SEPA recurrent payment with executiondate",
       "BillingAddress": {
         "Country": "NL"
        },
       "ExecutionDate": "20200805"
      }  
    }

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 4167022,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20181101145456",
        "MerchantTransactionID": "s2ptest_h13",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "EUR",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "SEPA DD recurrent payment",
        "MethodID": 84,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 309,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "NL"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 13199,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null
    }
}

SEPA Direct Debit Recurring Payment Notification

You need to respond with HTTP code 204 (No Content)!

Payment notification for status Success (2):

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 4167022,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20181101145458",
    "MerchantTransactionID": "s2ptest_h13",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "EUR",
    "ReturnURL": "",
    "Description": null,
    "MethodID": 84,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 13199,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Response:

204 No Content

The message contains a Payment object with an updated Status, which can have the following meanings:

RECURRING PAYMENT STATUS
ID Info Description
2 Success The transaction is successfully settled by the bank.
4 Failed The transaction has failed.
16 Reversed The customer did not recognize the payment and requested the funds back from his bank.
  • In case of a Failed or Reversed status, you will be given in the notification message the reasons why the payment got to that status. Additional information will be sent in the Reasons Code and Reasons Info fields. For a complete list of possible return codes please see our section GlobalPay Return Codes.

SEPA Direct Debit Return Codes
Return Code Description
221 R-Transaction : AC01 – Account Identifier incorrect (i.e. invalid IBAN of the Debtor).
222 R-Transaction : AC04 – Account closed.
223 R-Transaction : AC06 – Account blocked.
224 R-Transaction : AC13 – Debtor account is a consumer account.
225 R-Transaction : AC13 – Debtor account is a consumer account.
226 R-Transaction : AG02 – Operation code/transaction code/sequence type incorrect, invalid file format.
227 R-Transaction : AM04 – Insufficient funds.
228 R-Transaction : AM05 – Duplicate collection.
229 R-Transaction : BE05 – Identifier of the Creditor Incorrect.
230 R-Transaction : CNOR – Creditor Bank is not registered under this BIC in the CSM.
231 R-Transaction : DNOR – Debtor Bank is not registered under this BIC in the CSM.
232 R-Transaction : FF01 – File Format incomplete or invalid.
233 R-Transaction : MD01 – No mandate.
234 R-Transaction : MD02 – Mandate data missing or incorrect.
235 R-Transaction : MD06 – Disputed authorized transaction.
236 R-Transaction : MD07 – Debtor Deceased.
237 R-Transaction : MS02 – Refusal by the Debtor.
238 R-Transaction : MS03 – Reason not specified.
239 R-Transaction : RC01 – Bank Identifier (BIC) Incorrect.
240 R-Transaction : RR01 – Regulatory Reason.
241 R-Transaction : RR02 – Regulatory Reason.
242 R-Transaction : RR03 – Regulatory Reason.
243 R-Transaction : RR04 – Regulatory Reason.
244 R-Transaction : SL01 – Specific Service offered by the Debtor Bank.

Payment notification for status Failed with reason code and description.

Payment notification for status Failed (4):

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 4157363,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20181029134811",
    "MerchantTransactionID": "testCORE00001",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "EUR",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "test Smart2Pay",
    "MethodID": 84,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30151,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 1720,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "NL"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 13165,
    "Status": {
      "ID": 4,	
      "Info": "Failed",
      "Reasons": [
        {	
          "Code": "227",
          "Info": "R-Transaction : AM04 - Insufficient funds"
        }	
      ]	
    },	
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Response:

204 No Content

Payment notification for status Reversed with reason code and description.

Payment notification for status Reversed (16):

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 4157363,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20181029134811",
    "MerchantTransactionID": "testCORE00001",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "EUR",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "test Smart2Pay",
    "MethodID": 84,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30151,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 1720,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "NL"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 13165,
    "Status": {
      "ID": 16,	
      "Info": "Reversed",
      "Reasons": [
        {	
          "Code": "235",
          "Info": "R-Transaction : MD06 - Disputed authorized transaction."
        }	
      ]	
    },	
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Response:

204 No Content

SEPA Direct Debit Timeline

Checkout the below SEPA Direct Debit Timeline explained:

  • D-14: Pre-notification for recurrent Direct Debits;
  • D-2: The merchant initiates a SEPA DD – the payment has status Open. If the Direct debit request fails for technical reasons (e.g connection time out), the payment status moves to Failed with ReasonCode and Reason. This is not an incident (R-transaction), it is only a technical failure of the request;
  • D-1: The provider submits the SEPA DD into the network. If the SEPA DD is initiated early in the morning, then it will be submitted in the network in the same day D-1;
  • D: The D day is known as the Execution day for a SEPA Direct Debit – funds are transferred from debtor’s bank to the merchant’s SEPA DD account.;
  • D -> D+5: the payment remains Open unless an incident (R-Transaction) is reported. If an incident – reject, refusal, return – is registered, a notification for status Failed with ReasonCode and Reason (including the R-Transaction code) will be sent to the merchant;
  • D+6: If no incident occurred until D+5, the transaction is settled and the SEPA DD updates to status Success. Now the merchant can provide the product/service to the customer;
  • D+6 -> D+8 weeks / D+13 months: If the customer does not recognize the Direct Debit, he can claim the money back in 8 weeks, no questions asked and up to 13 months, if the customer’s bank agrees. This situation is also considered an incident (R-Transaction). If this happens, you will receive a Reversed notification with ReasonCode and Reason (including the R-Transaction) which you should properly handle on your side.

All days should be considered banking days!

Pre-notification:

Debtor pre-notification: is a 14 days notification period (this can be reduced upon debtor agreement).

This pre-notification must include the following information: the payment due date, the payment amount, the Unique Mandate Reference and the merchant Creditor Identifier. There is no requirement regarding the method of communication, meaning that this can be done through agreement on General Terms and Conditions, it can be solely written on an invoice, it can be displayed in an online customer account.

WeChat POS Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for WeChat POS method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

For WeChat POS payments the IsOffline parameter set to true is mandatory to be sent in the request:

  • IsOffline – Offline payment method;

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

For more information about status codes, please go to Basic HTTP Status Codes.

Request: 

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_k2",
    "Amount": 11,
    "Currency": "CNY",      
    "MethodID": 1066,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "Customer": {    
      "Email": "youremail@email.com"   
    },
    "BillingAddress": {
      "Country": "CN"
      }
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "Payment": {
    "ID": 4116540,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20181009113622",
    "MerchantTransactionID": "s2ptest_k2",
    "OriginatorTransactionID": null,
    "Amount": "11",
    "Currency": "CNY",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "",
    "MethodID": 1066,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 340,
      "MerchantCustomerID": null,
      "Email": "youremail@email.com",
      "FirstName": null,
      "LastName": null,
      "Gender": null,
      "SocialSecurityNumber": null,
      "SocialSecurityNumber2": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
      },
    "BillingAddress": {
      "ID": 291,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "CN"
      },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": {
      "BankCode": null,
      "BankName": null,
      "EntityID": null,
      "EntityNumber": null,
      "ReferenceID": null,
      "ReferenceNumber": null,
      "SwiftBIC": null,
      "AccountCurrency": null,
      "AccountNumber": null,
      "AccountHolder": null,
      "IBAN": null,
      "QRCodeURL": "weixin://wxpay/bizpayurl?pr=qXY38eE",
      "Instructions": null
      },
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": null
      },
    "MethodTransactionID": null,
    "TokenLifetime": 10,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=73EF92D30E6E3D90ED2E9FE4A9238FC3.4116540"
  }
}

In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_k4",
    "Amount": 11,
    "Currency": "CN",      
    "MethodID": 1066,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "Customer": {    
      "Email": "youremail@email.com"   
    },
    "BillingAddress": {
      "Country": "CN"
    }
  }
}

Response:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
  "Payment": {
    "ID": null,
    "SkinID": null,
    "ClientIP": null,
    "Created": null,
    "MerchantTransactionID": "s2ptest_k4",
    "OriginatorTransactionID": null,
    "Amount": "11",
    "Currency": "CN",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 1066,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": null,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": null,
      "Info": null,
      "Reasons": [
      {
        "Code": 2,
        "Info": "Validation failed - Currency (RegEx: ^[A-Z]{3}$)"
        }
      ]
    },
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

WeChat POS Test Data

For WeChat payment method there aren’t any test data available, but you can see how it works with the payment flow given below.

WeChat POS Payment Flow

  1. The customer selects his preferred currency from the list and enters his email address.

    1 Enter email

  2. You can skip this step by sending in the initial POST the following parameters: SkipHPP=1 and CustomerEmail.

  3. The Customer is redirected to WeChat payment page.

    1 WeChat payment page

  4. The Customer opens WeChat application and scans the QR code.

    1 QR code scanning

  5. The payment details are displayed and the customer confirms by using the payment password.

    1 Payment confirmation

  6. The payment is confirmed.

    1 Payment successful

  7. Upon completion of the payment flow, the customer is redirected back to your ReturnURL.

    1 Return page when the redirection status is Processing

Yandex.Money Refund Request (Fiscalization)

This setup is required for the Merchants that decide to setup the interaction with their online sales register via Yandex.Checkout.

For Yandex.Money the refunds can be full and/or partial depending if you have to return all the money to customer or not. A particular case is for Partial refund as you will need to provide additional parameters.

Below there are two examples of a refund request: one for a full refund, where no additional parameters are needed and one for a partial refund, where additional parameters are needed.

Definition: POST /v1/payments/{id}/refunds

Where:
  • {id} – GlobalPay Payment ID

A 201 HTTP response (Created) is returned if the refund was correctly initialized.

Full refund means you can only refund the entire paid amount for the initial transaction. For full refund you only need to send the Amount parameter, like in the below example:

Request:

POST https://paytest.smart2pay.com/v1/payments/3005389123/refunds
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Refund": {
    "MerchantTransactionID": "s2ptest_g28_b",
    "Amount": 100
   }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "Refund": {
    "ID": 1640512,
    "Created": "20170803095139",
    "MerchantTransactionID": "s2ptest_g28_b",
    "OriginatorTransactionID": null,
    "InitialPaymentID": 3005389123,
    "Amount": "100",
    "Currency": "EUR",
    "Description": null,
    "TypeID": 5,
    "SiteID": 30201,
    "Details": null,
    "Customer": null,
    "BillingAddress": null,
    "BankAddress": null,
    "Articles": null,
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": null
    }
  }
}

For Yandex.Money a particular case is for Partial refund as you will need to provide the below additional parameters in request: Merchant Article ID and Quantity, like in the below example:

Request:

POST https://paytest.smart2pay.com/v1/payments/3006154123/refunds
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Refund": {
    "MerchantTransactionID": "YandexPartialRefund",
    "Amount": 980,
    "Articles": [
      {
        "MerchantArticleID": "1231",
        "Quantity": 1
      }
    ]
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "Refund": {
    "ID": 0,
    "Created": null,
    "MerchantTransactionID": "YandexPartialRefund",
    "OriginatorTransactionID": null,
    "InitialPaymentID": 3006154123,
    "Amount": "980",
    "Currency": null,
    "Description": null,
    "TypeID": 0,
    "SiteID": 30201,
    "Details": null,
    "Customer": null,
    "BillingAddress": null,
    "BankAddress": null,
    "Articles": [
      {
        "MerchantArticleID": "1231",
        "Name": null,
        "Quantity": 1,
        "Price": 0,
        "VAT": 0,
        "Discount": 0,
        "Type": null,
        "DiscountValue": 0
      }
    ],
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": null
    }
  }
}

Capture scenarios for Paypal

Capture Scenarios Response Status Description Notification Status Description
The transaction has been fully captured.

Only payments with “Authorized” status (9) can be captured.
Final Status: 2 Success Final Notification Status: 2 Success
The payment has been partially captured.

Only payments with “Authorized” status can be partially captured. The payment has been sent out to be partially captured, but the payment gateway has not yet confirmed that the payment is successful.
Final Status: 35 Partially Captured Final Notification Status: 35 Partially Captured
Capture Failed Scenarios Return Code Description
The transaction could not be captured.

The transaction is not in an Authorized status (it has already been fully Captured or Partially Captured).
Return Code: 17 Payment is invalid

For a complete list of all the possible Return Code IDs go to our section GlobalPay Return Codes.

See the request – response examples for the above possible scenarios:

  • Success Status

    A payment can only be captured if it has an Authorized status. Once the payment has an Authorized status (9), you can capture either the full amount or a partial amount of the initial authorized amount for the transaction.

    A 200 HTTP response (OK) is returned if the request was completed successfully.

    Full capture means you capture the entire authorized amount for the initial transaction.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4813936/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4813936,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20191121152453",
            "MerchantTransactionID": "s2ptest_p1",
            "OriginatorTransactionID": null,
            "Amount": 100,
            "Currency": "EUR",
            "CapturedAmount": "100",
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 94,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30201,
            "NotificationDateTime": "20191121152731",
            "Customer": null,
            "BillingAddress": {
                "ID": 452,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "ES"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 2,
                "Info": "Success",
                "Reasons": null
            },
            "Fraud": null,
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=917D36F62AAA2BE344A324E612A0B5CC.4813936"
        }
    }

    We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

    You need to respond with HTTP code 204 (No Content)!

    Payment notification format:

    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
        "Payment": {
            "ID": 4813936,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20191121152453",
            "MerchantTransactionID": "s2ptest_p1",
            "OriginatorTransactionID": null,
            "Amount": 100,
            "Currency": "EUR",
            "CapturedAmount": "100",
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 94,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30201,
            "NotificationDateTime": "20191121152731",
            "Customer": null,
            "BillingAddress": {
                "ID": 452,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "ES"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 2,
                "Info": "Success",
                "Reasons": null
            },
            "Fraud": null,
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=917D36F62AAA2BE344A324E612A0B5CC.4813936"
        }
    }

  • Partially Captured Status

    Partial capture means you have the possibility to capture a smaller amount than the one from the initial authorized transaction. Partial capture is used when you have sent at least part of the order to the consumer and want to capture the amount for the item(s) that have been shipped.

    You can perform only one partial capture for an authorized transaction with the limitation that the amount of the partial capture to be smaller or equal than the initial authorized amount.

    Specify only the captured amount parameter in the query string, in order to partially capture the payment, like in the below example:

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4813937/capture?amount=50
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4813937,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20191121153210",
            "MerchantTransactionID": "s2ptest_p2",
            "OriginatorTransactionID": null,
            "Amount": 100,
            "Currency": "EUR",
            "CapturedAmount": "50",
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 94,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30201,
            "NotificationDateTime": "20191121153324",
            "Customer": null,
            "BillingAddress": {
                "ID": 452,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "ES"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 35,
                "Info": "PartiallyCaptured",
                "Reasons": null
            },
            "Fraud": null,
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=387EE786392FE554A86CA9E3F3EF1E09.4813937"
        }
    }

    We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

    You need to respond with HTTP code 204 (No Content)!

    Payment notification format:

    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk={
        "Payment": {
            "ID": 4813937,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20191121153210",
            "MerchantTransactionID": "s2ptest_p2",
            "OriginatorTransactionID": null,
            "Amount": 100,
            "Currency": "EUR",
            "CapturedAmount": "50",
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 94,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30201,
            "NotificationDateTime": "20191121153324",
            "Customer": null,
            "BillingAddress": {
                "ID": 452,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "ES"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 35,
                "Info": "PartiallyCaptured",
                "Reasons": null
            },
            "Fraud": null,
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=387EE786392FE554A86CA9E3F3EF1E09.4813937"
        }
    }

  • Return Code: 17 – Payment is invalid

    The transaction could not be captured. The transaction is not in an Authorized status. You can receive this response when the payment you want to Capture is not Authorized or when the payment has already been Captured.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4813935/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8{
        "Payment": {
            "ID": 4813935,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20191121151256",
            "MerchantTransactionID": "s2ptest_paypal2",
            "OriginatorTransactionID": null,
            "Amount": "100",
            "Currency": "EUR",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 94,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30201,
            "NotificationDateTime": "20191121151441",
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 2,
                "Info": "Success",
                "Reasons": [
                    {
                        "Code": "17",
                        "Info": "Payment is invalid - 4813935"
                    }
                ]
            },
            "Fraud": null,
            "MethodTransactionID": null,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null
        }
    }

Klarna Debit Risk Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for Klarna Debit Risk method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

For Klarna Debit Risk payments only the following Amount, Currency, Country parameters are mandatory to be sent in the request, the rest of them are optional:

  • Amount – Order amount;
  • Currency – Purchase currency;
  • Country – Purchase country.

For a smoother user experience, we recommend always sending the Method ID 1183.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

For more information about status codes, please go to Basic HTTP Status Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAxOTk6OG16L0lsZkpaejIyVVhVUlFSeXRvdExQQ3pkWVJQekVmNHpyNDdBUWROWWxiUUxpTWc=

{
    "Payment": {
        "Amount": 100,
        "Currency": "GBP",
        "OriginatorTransactionID": "12345",
        "MethodID": "1183",
        "Description": "test",
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "MerchantTransactionID": "KlarnaPayments-{{$timestamp}}",
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": 100,
                "VAT": 10,
                "Discount": 0,
                "Type": 5,
                "TaxType": "0"
            }
        ],
        "BillingAddress": {
            "HouseExtension": "25",
            "HouseNumber": "22",
            "Street": "Great Russell",
            "StreetNumber": "1",
            "City": "London",
            "Region": "St. Jaoum es",
            "Phone": "00447516300001",
            "ZipCode": "WC1B 3DG",
            "Country": "GB"
        },
        "Customer": {
            "email": "test@test.com",
            "Phone": "00447516300001",
            "FirstName": "Doe",
            "LastName": "John"
        },
        "TokenLifetime": 10
    }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 27146999,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20240517091703",
        "MerchantTransactionID": "KlarnaPayments-1715937424",
        "OriginatorTransactionID": "12345",
        "Amount": "100",
        "Currency": "GBP",
        "CapturedAmount": null,
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "ReturnURLSuccess": null,
        "ReturnURLFailure": null,
        "ReturnURLCancel": null,
        "ReturnURLProcessing": null,
        "Description": "test",
        "MethodID": 1183,
        "MethodOptionID": null,
        "MethodOptionIdString": null,
        "BankName": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30199,
        "NotificationDateTime": null,
        "Customer": {
            "MerchantCustomerID": null,
            "Email": "test@test.com",
            "FirstName": "Doe",
            "LastName": "John",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": "00447516300001",
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "City": "London",
            "ZipCode": "WC1B 3DG",
            "State": null,
            "Street": "Great Russell",
            "StreetNumber": "1",
            "HouseNumber": "22",
            "HouseExtension": "25",
            "Country": "GB"
        },
        "ShippingAddress": null,
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": "100",
                "VAT": "10",
                "Discount": "0",
                "Type": "5",
                "TaxType": 0,
                "DiscountValue": "0"
            }
        ],
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "OriginalMerchantTID": null,
        "Unknown": false,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://gw-apm-globalpayapi.nuvei.com/Home?PaymentToken=3C1FBA02E352FA06F5EE3C7FE524D0F8.27146999",
        "Splits": null
    }
}

In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAxOTk6OG16L0lsZkpaejIyVVhVUlFSeXRvdExQQ3pkWVJQekVmNHpyNDdBUWROWWxiUUxpTWc=

{
    "Payment": {
        "Amount": 200,
        "Currency": "GBP",
        "OriginatorTransactionID": "12345",
        "MethodID": "1183",
        "Description": "test",
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "MerchantTransactionID": "KlarnaPayments-{{$timestamp}}",
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": 100,
                "VAT": 10,
                "Discount": 0,
                "Type": 5,
                "TaxType": "0"
            }
        ],
        "BillingAddress": {
            "HouseExtension": "25",
            "HouseNumber": "22",
            "Street": "Great Russell",
            "StreetNumber": "1",
            "City": "London",
            "Region": "St. Jaoum es",
            "Phone": "00447516300001",
            "ZipCode": "WC1B 3DG",
            "Country": "GB"
        },
        "Customer": {
            "email": "test@test.com",
            "Phone": "00447516300001",
            "FirstName": "Doe",
            "LastName": "John"
        },
        "TokenLifetime": 10
    }
}

Response:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 27147115,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20240517130108",
        "MerchantTransactionID": "KlarnaPayments-1715950869",
        "OriginatorTransactionID": null,
        "Amount": "200",
        "Currency": "GBP",
        "CapturedAmount": null,
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "ReturnURLSuccess": null,
        "ReturnURLFailure": null,
        "ReturnURLCancel": null,
        "ReturnURLProcessing": null,
        "Description": "test",
        "MethodID": 1183,
        "MethodOptionID": null,
        "MethodOptionIdString": null,
        "BankName": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30199,
        "NotificationDateTime": "20240517130109",
        "Customer": {
            "MerchantCustomerID": null,
            "Email": "test@test.com",
            "FirstName": "Doe",
            "LastName": "John",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": "00447516300001",
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "City": "London",
            "ZipCode": "WC1B 3DG",
            "State": null,
            "Street": "Great Russell",
            "StreetNumber": "1",
            "HouseNumber": "22",
            "HouseExtension": "25",
            "Country": "GB"
        },
        "ShippingAddress": null,
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": "100",
                "VAT": "10",
                "Discount": "0",
                "Type": "5",
                "TaxType": 0,
                "DiscountValue": "0"
            }
        ],
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 4,
            "Info": "Failed",
            "Reasons": [
                {
                    "Code": "118",
                    "Info": "Amount invalid"
                }
            ]
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "OriginalMerchantTID": null,
        "Unknown": false,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": null
    }
}

Klarna Debit Risk – Test Data

In order for you to test the Klarna Debit Risk payment method successfully, please use the below test data.

Test Data
DataValue
Email for Austria:
  • Approved: customer@email.at
  • Denied: customer+denied@email.at
  • Email for Germany:
  • Approved: customer@email.de
  • Denied: customer+denied@email.de
  • Email for United Kingdom:
  • Approved: customer@email.uk
  • Denied: customer+denied@email.uk
  • First Name:Enter any name. Example: Doe
    Last Name:Enter any name. Example: Test
    Phone Number for Austria:
  • Approved: +4306762600456
  • Denied: +4306762600745
  • Phone Number for Germany:
  • Approved: +49017614284340
  • Denied: +49017610927312
  • Phone Number for United Kingdom:
  • Approved: +447755564318
  • Denied: +447355505530
  • CityEnter any city. Example: London
    StreetEnter any street. Example: Great Russell
    Zip CodeEnter any valid zip code. Example: WC1B 3DG
    Available countries:AT, DE, GB
    Article Type:4 = Discount, 5 = Physical, 6 = Shipping_fee, 7 = Sales_tax, 8 = Digital, 9 = Gift_card, 10 = Store_credit, 11 = Surcharge
    Additional Test Data required from the customer on the provider’s page
    CountryDate of Birth
    Austria (AT):Format is Day/Month/Year (DD-MM-YYYY) Enter any date.
    Germany (DE):Format is Day/Month/Year (DD-MM-YYYY) Enter any date.
    United Kingdom: (GB):Format is Day/Month/Year (DD-MM-YYYY) Enter any date.

    For more details about the specific personal details required please go to our section: Payment flows per country.

    Klarna Debit Risk Payment Flow

    1. This is considered a standard payment flow where the customer has selected the United Kingdom as the country. If the customer hasn’t provided in the first step one of the required personal details: email, first name and last name, he will provide this info on a intermediary page. In order to continue, the customer also needs to agree to storing and processing his/her personal information used in the payment flow. Customer Details
    2. The customer needs to press on the ‘Pay with Klarna’ button. Confirm and pay
    3. The customer needs to provide Username and Password, for test purposes it can be used “Test” and “12345” and press on the ‘Continue’ button. Scan to pay
    4. The customer needs to provide the OTP code, for test purposes it can be used ‘12345’ and press on the ‘Continue’ button.Testbank
    5. If the details are filled correctly by the customer, the transaction is completed and you will receive a notification with the success status. Meanwhile, the customer is redirected to your ReturnURL.Payment confirmation pending