Roles Administration

The first user created for a merchant (the one created from the registration form) has a default role assigned. This role (Administrator) has all the access rights existent in the GlobalPay system.

69

Click on Add a New Role button and you can create a new role. In the new form that opens, in the General section, you need to provide a role name and a description to the role.

69

In the Access Rights section you can assign access rights for the new role. When finished, click Save and your role will be created. The role you have just created is visible in the grid. You can create as many roles as you like.

70

If you want to remove or add new access rights to a role, or simply modify the name or the description you can click on the Edit button from the grid. And, of course, you can delete the roles you don’t need anymore using the Delete button from the grid.

71

Users Administration

When entering this section you will see in the grid your user and all the users you have created. These are all the users associated with your Merchant ID.

72

Click on Add a New User button and you can create a new user. In the new form that opens, in the General section, you need to provide a User Name and a User Email.

73

In the Roles section you can assign specific roles for the new user. You can assign to the new user one or more of the roles you have previously created.

73_1

In the Sites section you can assign specific websites to the new user. When finished, click Save and your new user will be created. Click Save and the new user will be saved and he will receive an email with the password. The User you have just created is visible in the grid. You can create as many users as you like.

73_2

Please note that a new user can also be created via API by submitting a POST HTTP request.

If you want to change user name or user email, remove or add roles or update the websites assign to an already created user, you need to click on the Edit button in the grid.

And, of course, you can delete the user accounts that do not serve you anymore using the Delete button from the grid.

74

In the Edit section you can also generate a new password for that specific user. When clicking Generate new password an email will be sent to that user with the new password.

74_1

Please be aware that if you assign a user a certain role (that contains specific access rights), that user will only have access to that restricted area defined by that role (and implicitly by the access rights).

Example:

You provide User1 with Role1 that includes NotificationURL-Update access right and Signature-Update access right. This means that User1 will only see two tabs when entering the dashboard: Account and Configuration. And he will have the right to generate a new signature and modify the Notification URL.

An update access right implicitly contains the view access right.

Example:

If the user has only one role that only contains the access right Signature-Update, that user will be able to see the Signature section and update the signature.

If the user has only one role that contains only Signature-view, that user will be able to access the Signature section, but won’t be able to update the signature.

Payment Methods

Here you will find a complete list of all the payment methods, you can easily verify the list of payment methods assigned to your merchant account or to request and activate new payment methods of your choice.

When you access the Payment Methods tab you will see a complete list of all the payment methods available for your merchant account. You have the possibility to search for specific payment methods using different search filters and to see the description for each payment method.

You can search for a specific payment method using the search filters available: payment method’s status, name, description, guaranteed status and countries available.

A very important step during the configuration process is setting up your payment methods. In this section you will be able to configure the preferred way to receive your payments and setup your desired payment methods. The payment methods are selected for an account when the account is created, but they can also be changed at any time needed.

There are a few possible actions available, in order for you to have a better management over your merchant account, that are explained below:

  • Request a new payment method:

    Using the first search filter from the top of the page, choose Can Request option from the dropdown list. A list of all the available payment methods that you can request for your account will appear.

    Once you find the desired payment method, click the “+” Request sign in front of it to add it to your account,

    A confirmation message will be displayed.

    After you have requested the payment method, you need to wait for Smart2pay approval of the payment method. Also, you can check the list of all your requested payment methods by using the first search filter from the top of the page. Choose Approval in Progress option from the dropdown list and a list of all your requested payment methods for your account will appear.

  • Activate a payment method:

    Using the first search filter from the top of the page, choose Can Activate option from the dropdown list. A list of all the payment methods assigned to your account that you can activate will appear.

    Once you find the desired payment method, click the Activate option in front of it to activate it.

    A confirmation message will be displayed.

    You need to wait for Smart2pay approval for the activation of the payment method. Also, you can check the list of all your payment methods that are waiting activation by using the first search filter from the top of the page. Choose Activation in Progress option from the dropdown list and a list of all your payment methods waiting activation will appear.

  • Deactivate a payment method:

    Using the first search filter from the top of the page, choose My Methods option from the dropdown list. A list of all the payment methods activated for your account will appear.

    If you want to deactivate a specific payment method, click the Deactivate option in front of it.

    A confirmation message will be displayed.

  • Ask for availability of a payment method:

    For some payment methods you need to ask our support team for more details regarding its availability. You can check the list of all the payment methods that need further guidance from our support team by using the first search filter from the top of the page. Choose Ask Availability option from the dropdown list and a list of all the payment methods that need further guidance from our support team will appear.

  • Unavailable payment methods:

    Some payment methods may be currently unavailable due to different external factors. You can check the list of all the unavailable payment methods by using the first search filter from the top of the page. Choose Unavailable option from the dropdown list and a list of all the unavailable payment methods will appear.

  • Rejected payment methods:

    If the request of a payment method will have a negative outcome we will let you know. You can check the list of all the rejected payment methods by using the first search filter from the top of the page. Choose Rejected option from the dropdown list and a list of all the rejected payment methods will appear.

iDEAL Implementation guide

iDEAL, one of the most used online banking method in the Netherlamds, allows the customer to buy securely on the Internet, directly from his bank account opened at one of the major Dutch banks: ABN AMRO, SNS Bank, RegioBank, Rabobank, Knab, Moneyou, ASN Bank, Triodos Bank, ING, Rabobank, Van Lanschot Bankiers,Knab, Bunq, Moneyou and Handelsbanken.

iDEAL was developed by the Dutch banking community in order to facilitate easier payment for online products and services. iDEAL enables direct and secure real-time online payments between bank accounts of Consumers and iDEAL Merchants. The main characteristics of iDEAL are:

  • Real-time payment through accepted and trusted Internet banking that is already familiar to Consumers;
  • Real-time payment authorisation for the Consumer and real-time confirmation to the Merchant by the Acquiring bank, followed by the irrevocable transfer of funds to the Merchant;
  • Suitability for online delivery (e.g. downloads, mobile top-ups), offline delivery (e.g. goods) and time-critical payments (e.g. airline tickets);
  • Offers the flexibility to make payments for many different purposes (e.g. charitable donations, telephone/e-mail orders).

Please ask support@smart2pay.com for the latest iDEAL Merchant Implementation Guide (MIG) and the necessary operation manuals.

iDEAL Four Party Model

When talking about iDeal transaction, one must know that there are at least four parties involved:

  • The Consumer: buys a product or service online from a Merchant that offers the iDEAL payment method
  • The Merchant: sells products or services online to Consumers
  • The Issuer (the Consumers’ bank): the Consumer executes iDEAL payments in his Internet banking environment – through his Issuer
  • The Acquirer (the Merchant’s bank): the Merchant accepts iDEAL payments – through his Acquirer

    Additional parties can be involved in an iDEAL transaction:

  • The Merchant can, for example, use a Payment Service Provider (PSP) to establish the connection with its Acquiring bank. When this PSP receives/collects the payments before they are paid to the Merchant, this is called a “Collecting PSP” (CPSP). In this case the Collecting PSP acts as the Merchant for the purpose of the iDEAL payments and holds the iDEAL contract with the Acquiring bank on behalf of one or multiple other Merchants.
Issuer Selection List Presentation

To ensure that the Consumer experience of an iDEAL transaction is consistent and recognizable through all Merchant websites; all Merchants have to comply with certain presentation standards:

  • All Issuers in the DirectoryResponse (to be collected at least monthly) have to be shown in a list (e.g. dropdown list or list of radio buttons) in alphabetic order and exactly as presented in the DirectoryResponse message.
  • The list should be accompanied by the instruction phrase “Kies uw bank” (UK: “Choose your bank”). In case of an HTML SELECT, the first element in the list states this instruction phrase and is selected by default (to prevent accidental Issuer selection).
  • It is not allowed to exclude or grey out any active Issuers from the Issuer list. In case of a new Issuer, the Issuer list should be updated wihtin one month (preferably earlier).
  • It is recommended to configure the HTML “value” field of the items in the list box to be the issuerID (BIC) of the corresponding Issuer, because this value is used in subsequent messages (TransactionRequest).
  • The Merchant may preselect an Issuer only to allow for an improved user experience (e.g. if the Consumer has previously initiated an iDEAL payment with a specific Issuer). The Consumer must however always be offered the possibility to alter the preselected Issuer.

An example of a correct presentation of the Issuer selection list is shown in the figure:

iDEAL banners and logo’s

Merchants that want to use a banner on their website to promote iDEAL can download the most recent banners at http://www.ideal.nl/en/payee/logos-banners/. These banners need to be installed only once, since the URL will always refer to the latest version of the banner containing the right logos of the participating Issuing banks.

The iDEAL logo must be used by anyone who offers iDEAL as a payment method, informing customers from the beginning that they can pay with iDEAL.

The iDEAL logo may only be used in the provided form and colour. The use of other colours is not permitted.

For more information and instructions for using the iDEAL logo, checkout the manual iDEAL logo.

POLi Test Data (Australia)

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

POLi Test Data
Data Value
User DemoShopper
Password DemoShopper

POLi Payment Flow (Australia)

  1. The Customer selects his Bank from the list and proceeds with the payment.

    1 Select bank

  2. The Customer enters the login details. He must fill the form with his Username and password and click the Login button.

    1 Login details

  3. The Customer needs to select the bank account he wants to transfer money from and click the Continue button.

    1 Select bank account

  4. The customer is redirected to the provider’s confirmation page where he sees the payment summary and details. He completes the transaction by clicking on the Confirm button.

    1 Transaction confirmation

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

    1 Return page when the redirection status is a success

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
    }
}

API Idempotence

Idemptotence is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application.

When talking about API calls, idempotency means that if you attempt an operation twice or more, only the first attempt will be processed. Idempotence prevents the processing of duplicate requests by using unique keys.

If a network connection error or a timeout error appears when creating a card payment, you can do a retry. But still, in this case, there is the possibility that the card payment has already been created, leading you only to generate a duplicate payment when you do the retry.

In order to avoid this undesired scenario, we have implemented a new piece of functionality using Unique Keys, which make it safe to retry non-idempotent API requests. These Unique Keys (Idempotence keys) ensure that no matter the number of retries for a specific call only one response action is executed, and the payment is not duplicated.

Our API supports idempotence for safely retrying requests and guarantees that the operation is performed only once. Therefore, if you create a card payment that fails due to a network connection error, you can retry the request with the same idempotence key to guarantee that only a single card payment is created.

Idempotence keys are unique value generated keys, for example UUIDs, that you submit as a request header and guarantee that only one resource will be created regardless of how many times a request is sent to the server.

Idempotence keys can be generated using your own preferred method or any appropriately random string. Still, we recommend to generate your own Unique Keys (Idempotence keys) using V4 UUIDs.

For card payments we’ll always send back the same response for requests made with the same key, and keys can’t be reused with different request parameters. The keys are stored for a period of 24 hours.

You can also visit our Smart2Pay SDK .NET section for more information on how you can generate and plug in your Unique Key Generator.

Alipay 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 Payment Flow

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

    1 Select currency

  2. Once the customer arrives at the provider’s page he has two choices: to continue with the payment using the mobile version or using the desktop version.

    1 Payment version

  3. The customer logs in to his Alipay account by entering his email address and password.

    1 Account login

  4. The customer confirms the payment by entering the payment password.

    1 Payment password

  5. The payment is processing.

    1 Payment processing

  6. In a few seconds the customer will be redirected back to your ReturnURL.

    1 Return page when the redirection status is a success

WeChat 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 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

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

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
    }
}

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

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 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;
  • D+2: 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.

For more information about the reasons of a wrong request response, please go to our section: GlobalPay Return Codes.

SEPA Direct Debit Recurring Payment

Based on the PreapprovalID received, Direct Debits can be initiated.

Checkout the below example of a recurring payment request for SEPA Direct Debit (84) 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":13199,
   "MerchantTransactionID": "s2ptest_h13",
   "Amount": 100,
   "Currency": "EUR",
   "MethodID": 84,
   "Description":"SEPA DD recurrent payment",
   "BillingAddress": {
     "Country": "NL"
    }
  }
}

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
    }
}

Smart2Pay Android SDK Configuration for Kotlin

Now that you have imported the Smart2Pay.SDK package into your app, you need to follow the below steps in order to configure your Mobile SDK for Android in Kotlin language.

If you are using Java go to our section: Smart2Pay Mobile SDK Configuration using Java language.

First of all you need to start using and install the Kotlin plugin for Android development. For more information, please visit: Getting started with Android and Kotlin.

Configure Kotlin in your project by following the steps below:

  • Click Tools | Kotlin | Configure Kotlin in Project.
  • Select Android.
  • Check if all modules and the selected Kotlin version are correct.
  • Press OK and Kotlin is now part of your Java project.
  1. [APP] Create an order to your server

    //sample code, put your own logic of creating an order to your server
    val orderParameters = HashMap<String, Any>()
            orderParameters["amount"] = "10"
            orderParameters["currency"] = "CNY"
            orderParameters["methodID"] = paymentManager.getMethodId(payment.type).toString()
    
            val paymentsRequest = PaymentsRequest(RequestManager.instance)
            paymentsRequest.setRequestBody(orderParameters)
            paymentsRequest.callback =
                    object : PaymentsRequest.Callback {
                        override fun onSuccess(paymentId: Int, paymentsResponse: String) {
                            payment.id = paymentId
                            payment.instructions = paymentsResponse
                            paymentManager.pay(payment)
                        }
    
                        override fun onFailure() {
    
                        }
                    }
            paymentsRequest.enqueue()
    
  2. [SERVER] Once the order is created on your server, from the server create a Payment using our REST API and specifying isMobileApp: true.

    
    {
      "Payment": {
        "MerchantTransactionID": "{{tester}}-{{env}}-{{time}}-{{rand}}",
        "Amount": "100",
        "Currency": "CNY",
        "ReturnURL": "https://www.merchant.com/return",
        "MethodID" : "24",
        "Customer":{
          "Email": "john.doe@isp.com"
        },
        "Details":{
        "IsMobileApp": true
        }
    
      }
    }
    
  3. [SERVER] Our server responds with Instructions field which you need to pass to the app.

    {
      "Payment": {
        "ID": 4164863,
        "MethodID": 24,
        […]
        },
        "ReferenceDetails": {
    […]
          "Instructions": "_input_charset=\"utf-8\"&appenv=\"system=android^version=3.0.1.2\"&body=\"Alipay Payment\"&currency=\"USD\"&forex_biz=\"FP\"&notify_url=\"https://europaytest.smart2pay.com/Alipay/Landing/AlipayNotificationURL.aspx\"&out_trade_no=\"s2ptest200336\"&partner=\"2088201612260077\"&payment_type=\"1\"&rmb_fee=\"1\"&secondary_merchant_id=\"GP1045\"&secondary_merchant_industry=\"5946\"&secondary_merchant_name=\"demo iasi test\"&seller_id=\"2088201612260077\"&service=\"mobile.securitypay.pay\"&subject=\"Alipay Payment\"&supplier=\"demo iasi test\"&sign=\"vRQ1ouMvn0rJUCxSEi91RLJcS0NU7mojYfJpfT8gxtctF8jfJ4x6uN8t0ETdDdmGziqP7IsYHTSAHdFLHGO4hQdovyzJMna42nc9DcfMMlhTX7ZVCa7rUuieBWcW0ek8w3DxojrWnWT9lM3lUQZVLsY1CjXFGJ126x4TnjrA86w%3d\"&sign_type=\"RSA\""
          },
        "Status": {
          "ID": 1,
          "Info": "Open",
          "Reasons": null
          },
          […]
      }
    }
    
  4. [APP] Pass the instructions from the response to the payment object together with the payment type and Activity.

    override fun onSuccess(paymentId: Int, paymentsResponse: String) {
                            payment.id = paymentId
                            payment.instructions = paymentsResponse
                            payment.activity = this@MainActivity
                            […]
                            }
    
  5. [APP] Call Smart2Pay Mobile SDK by calling pay() function from the paymentManager object.

    override fun onSuccess(paymentId: Int, paymentsResponse: String) {
                            [...]
                            paymentManager.pay(payment)
                            }
    

    The information needed inside the Payment object of our mobile SDK:

    class Payment {
        enum class PaymentProvider {
            NONE,
            ALIPAY,
            WECHAT
        }
        var id: Int = 0
        var type = PaymentProvider.NONE
        var instructions: String = "" 
        var activity: Activity
    }

    When pasting this into your code the imports should go automatically or you can add them manually:

    import com.smart2pay.sdk.PaymentManager
    import com.smart2pay.sdk.models.Payment
  6. [SDK] Our SDK triggers Alipay or WeChat application

  7. [User] The user completes the payment

  8. [SDK] Alipay or WeChat application passes the status to our mobile SDK

  9. [APP] Our SDK calls one of the two callbacks onPaymentSuccess or onPaymentFailure, depending on the payment result.

    Make sure the activity uses the Interface:

    PaymentManager.PaymentManagerEventListener

    For example your activity could look like this:

    class MainActivity : AppCompatActivity(), PaymentManager.PaymentManagerEventListener {

    Add these two functions to get the callbacks from the Payment Manager:

    override fun onPaymentFailure(payment: Payment) {
    }
    override fun onPaymentSuccess(payment: Payment) {
    }
  10. [APP] Inside onPaymentSuccess, before displaying the result to the user and providing the service you need to do a server verification by calling from the server our payment verification API. Call your server from the App to ask for the verification result.

  11. [SERVER] You need to pass the Smart2Pay payment ID and the message received from Smart2Pay mobile SDK.

    POST {{entryPoint}}/{{version}}/payments/{id}/verify
    
    {
       "message": "partner=\"2088101568358171\"&out_trade_no=\"0819145412-6177\"&subject=\"test\"&body=\"testtest\"&total_fee=\"0.01\"&notify_url=\"http://notify.msp.hk/notify.htm\"&service=\"mobile.securitypay.pay\"&payment_type=\"1\"&_input_charset=\"utf-8\"&it_b_pay=\"30m\"&success=\"true\"&sign_type=\"RSA\"&sign=\"hkFZr+zE9499nuqDNLZEF7W75RFFPsly876QuRSeN8WMaUgcdR00IKy5ZyBJ4eldhoJ/2zghqrD4E2G2mNjs3aE+HCLiBXrPDNdLKCZgSOIqmv46TfPTEqopYfhs+o5fZzXxt34fwdrzN4mX6S13cr3UwmEV4L3Ffir/02RBVtU="
    }
    
  12. [SERVER] Our API checks the transaction and replies back with the status of the verification:

    {
        "status": "Success"
    }
    
  13. [SERVER] If the “status” is Success you can deliver the goods or services. Pass this result to the App.

  14. [APP] Display the payment result to the user.

  15. [SERVER] As a backup for any client communication issues, Smart2Pay will also send to your server a backend notification as documented here: Payment Notification.

Configuration is done! SDK is fully functional in your app!

Smart2Pay Android SDK Configuration for Java

Now that you have imported the Smart2Pay.SDK package into your app, you need to follow the below steps in order to configure your Mobile SDK for Android in Java language.

If you are using Kotlin go to our section: Smart2Pay Mobile SDK Configuration using Kotlin language.

  1. [APP] Create an order to your server

    //sample code, put your own logic of creating an order to your server
    order order = new Order()
    order.setAmount(1);
    order.setCurrency("CNY");
    order.setType(Payment.PaymentProvider.ALIPAY); //or Payment.PaymentProvider.WECHAT
    order.create();
    
  2. [SERVER] Once the order is created on your server, from the server create a Payment using our REST API and specifying isMobileApp: true.

    {
      "Payment": {
        "MerchantTransactionID": "{{tester}}-{{env}}-{{time}}-{{rand}}",
        "Amount": "100",
        "Currency": "CNY",
        "ReturnURL": "https://www.merchant.com/return",
        "MethodID" : "24",
        "Customer":{
          "Email": "john.doe@isp.com"
        },
        "Details":{
          "IsMobileApp": true
        }
      }
    }
    
  3. [SERVER] Our server responds with Instructions field which you need to pass to the app.

    {
      "Payment": {
        "ID": 4164863,
        "MethodID": 24,
        […]
        },
        "ReferenceDetails": {
    […]
          "Instructions": "_input_charset=\"utf-8\"&appenv=\"system=android^version=3.0.1.2\"&body=\"Alipay Payment\"&currency=\"USD\"&forex_biz=\"FP\"&notify_url=\"https://europaytest.smart2pay.com/Alipay/Landing/AlipayNotificationURL.aspx\"&out_trade_no=\"s2ptest200336\"&partner=\"2088201612260077\"&payment_type=\"1\"&rmb_fee=\"1\"&secondary_merchant_id=\"GP1045\"&secondary_merchant_industry=\"5946\"&secondary_merchant_name=\"demo iasi test\"&seller_id=\"2088201612260077\"&service=\"mobile.securitypay.pay\"&subject=\"Alipay Payment\"&supplier=\"demo iasi test\"&sign=\"vRQ1ouMvn0rJUCxSEi91RLJcS0NU7mojYfJpfT8gxtctF8jfJ4x6uN8t0ETdDdmGziqP7IsYHTSAHdFLHGO4hQdovyzJMna42nc9DcfMMlhTX7ZVCa7rUuieBWcW0ek8w3DxojrWnWT9lM3lUQZVLsY1CjXFGJ126x4TnjrA86w%3d\"&sign_type=\"RSA\""
        },
        "Status": {
          "ID": 1,
          "Info": "Open",
          "Reasons": null
          },
       […]
      }
    }
    
  4. [APP] Get the instructions from the server response.

    String instructions = order.getInstructions();
  5. [APP] Call Smart2Pay Mobile SDK by creating a Payment object, passing the Activity, payment type and instructions. Then trigger the payment using a PaymentManager object.

    Payment payment = new Payment();
        payment.setInstructions(instructions);
        payment.setType(Payment.PaymentProvider.ALIPAY);
        payment.setActivity(this);
    
        PaymentManager paymentManager = new PaymentManager();
        paymentManager.pay(payment);

    The information needed inside the Payment object of our mobile SDK:

    class Payment {
        enum PaymentProvider {
            NONE,
            ALIPAY,
            WECHAT
        };
        int ID;
        PaymentProvider type;
        String instructions;
        Activity activity;
    }

    When pasting this into your code the imports should go automatically or you can add them manually:

    import com.smart2pay.sdk.PaymentManager;
    import com.smart2pay.sdk.models.Payment;
  6. [SDK] Our SDK triggers Alipay or WeChat application

  7. [User] The user completes the payment

  8. [SDK] Alipay or WeChat application passes the status to our mobile SDK

  9. [APP] Our SDK calls one of the two callbacks onPaymentSuccess or onPaymentFailure, depending on the payment result.

    Make sure the activity uses the Interface:

    PaymentManager.PaymentManagerEventListener

    For example your activity could look like this:

    public class MainActivity extends AppCompatActivity implements PaymentManager.PaymentManagerEventListener {

    Add these two functions to get the callbacks from the Payment Manager:

    @Override
    public void onPaymentSuccess(Payment payment) {
        
    }
    @Override
    public void onPaymentFailure(Payment payment) {
        
    }
  10. [APP] Inside onPaymentSuccess, before displaying the result to the user and providing the service you need to do a server verification by calling from the server our payment verification API. Call your server from the App to ask for the verification result.

  11. [SERVER] You need to pass the Smart2Pay payment ID and the message received from Smart2Pay mobile SDK.

    POST {{entryPoint}}/{{version}}/payments/{id}/verify
    
    {
       "message": "partner=\"2088101568358171\"&out_trade_no=\"0819145412-6177\"&subject=\"test\"&body=\"testtest\"&total_fee=\"0.01\"&notify_url=\"http://notify.msp.hk/notify.htm\"&service=\"mobile.securitypay.pay\"&payment_type=\"1\"&_input_charset=\"utf-8\"&it_b_pay=\"30m\"&success=\"true\"&sign_type=\"RSA\"&sign=\"hkFZr+zE9499nuqDNLZEF7W75RFFPsly876QuRSeN8WMaUgcdR00IKy5ZyBJ4eldhoJ/2zghqrD4E2G2mNjs3aE+HCLiBXrPDNdLKCZgSOIqmv46TfPTEqopYfhs+o5fZzXxt34fwdrzN4mX6S13cr3UwmEV4L3Ffir/02RBVtU="
    }
  12. [SERVER] Our API checks the transaction and replies back with the status of the verification:

    {
        "status": "Success"
    }
    
  13. [SERVER] If the “status” is Success you can deliver the goods or services. Pass this result to the App.

  14. [APP] Display the payment result to the user.

  15. [SERVER] As a backup for any client communication issues, Smart2Pay will also send to your server a backend notification as documented here: Payment Notification.

Configuration is done! SDK is fully functional in your app!

Smart2Pay Android SDK Installation

You need to follow the below steps to build an in-app payment flow using Smart2Pay.SDK.Payment, a class designed to make building your app’s checkout flow as easy as possible.

  1. Download the smart2pay.aar file located at: https://github.com/Smart2Pay/SDK-Android-Release/tree/master/releases.
  2. Place the .aar file in the app/libs folder.
  3. Add this to your app Gradle file and click on the Sync Now button.
    dependencies {
        api files('libs/smart2pay.aar')
    }

Now the SDK is in the app we can actually use it in the code. Continue with configuring your SDK: Smart2Pay Android SDK configuration for Java or Smart2Pay Android SDK configuration for Kotlin.

Smart2Pay Mobile SDK

By using Smart2Pay SDK for mobile, you can quickly integrate more payment options directly in your mobile application. Our SDK provides one unique interface to both Alipay and WeChat in-app payments.

The payments are initiated by the user from the mobile app and the initial message is sent by your server to our REST API in the usual way (see Create a payment), plus sending an additional parameter IsMobileApp: true. We will respond back with the Instructions field that needs to be passed from your app to our SDK. Our SDK handles the various calls to Alipay or WeChat apps and returns the control to your app for the final verification of the status.

You can download our mobile SDK for Android and iOS together with demo projects from Github:

For more details regarding the installation and the configuration of the SDK, please go to the below sections:

Tingg Test Data

In order for you to test Tingg payment method available in Nigeria, please use the below test data.

Tingg (Nigeria) Test Data
Data Value
Phone 23485844338

Tingg (Nigeria) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives all the details needed to complete the payment.

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

    1 Return page when the redirection status is a success

NIBSS Test Data

In order for you to test NIBSS payment method available in Nigeria, please use the below test data.

NIBSS (Nigeria) Test Data
Data Value
Phone 23485844338

NIBSS (Nigeria) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives all the details needed to complete the payment.

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

    1 Return page when the redirection status is a success

PesaLink (Kenya) Test Data

In order for you to test PesaLink payment method available in Kenya, please use the below test data.

PesaLink (Kenya) Test Data
Data Value
Phone 255653560949

PesaLink (Kenya) Payment Flow

  1. The customer fills in his personal details, including: his first and last name, email address and phone number. Then, the customer chooses the desired bank from the provided list.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

M-Pesa (Ghana) Test Data

In order for you to test M-Pesa payment method available in Ghana, please use the below test data.

M-Pesa (Ghana) Test Data
Data Value
Phone 02092332540

M-Pesa (Ghana) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

MTN (Ghana) Test Data

In order for you to test MTN payment method available in Ghana, please use the below test data.

MTN (Ghana) Test Data
Data Value
Phone 04517108710

MTN (Ghana) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

MTN Test Data

In order for you to test MTN payment method available in Uganda, please use the below test data.

MTN Test Data
Data Value
Phone 256387676229

For MTN payment method available in Ghana, you can see how it works with the payment flow given here: MTN (Ghana) Payment Flow.

MTN (Uganda) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

Tigo Pesa Test Data

In order for you to test Tigo Pesa payment method available in Ghana, please use the below test data.

Tigo Pesa (Ghana) Test Data
Data Value
Phone 02787560500

Tigo Pesa (Ghana) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

Equitel Test Data

In order for you to test Equitel payment method available in Kenya, please use the below test data.

Equitel (Kenya) Test Data
Data Value
Phone 254725362916

Equitel (Kenya) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

Airtel Money (Uganda) Test Data

In order for you to test Airtel Money payment method available in Uganda, please use the below test data.

Airtel Money (Uganda) Test Data
Data Value
Phone 256428789696

Airtel Money (Uganda) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

Airtel Money (Ghana) Test Data

In order for you to test Airtel Money payment method available in Ghana, please use the below test data.

Airtel Money (Ghana) Test Data
Data Value
Phone 02622595320

Airtel Money (Ghana) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

Airtel Money (Kenya) Test Data

In order for you to test Airtel Money payment method available in Kenya, please use the below test data.

Airtel Money (Kenya) Test Data
Data Value
Phone 254725362916

Airtel Money (Kenya) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

Airtel Money Test Data

In order for you to test Airtel Money payment method available in Tanzania, please use the below test data.

Airtel Money (Tanzania) Test Data
Data Value
Phone 255737306783

Please click on the appropriate link below, to see how Airtel Money payment method works in Kenya, Ghana and Uganda:

Airtel Money (Tanzania) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

M-Pesa (Tanzania) Test Data

In order for you to test M-Pesa payment method available in Tanzania, please use the below test data.

M-Pesa (Tanzania) Test Data
Data Value
Phone 255653560949

M-Pesa (Tanzania) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

M-Pesa Test Data

In order for you to test M-Pesa payment method, please use the below test data.

M-Pesa Test Data
Data Value
Phone 254716737623

Please click on the appropriate link below, to see how M-Pesa payment method works in Tanzania and Ghana:

  1. M-Pesa (Tanzania) Payment Flow;
  2. M-Pesa (Ghana) Payment Flow.

M-Pesa (Kenya) Payment Flow

  1. The customer fills in his first and last name, his email address and his phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

  3. The customer receives a push notification to his mobile and confirms the payment.

    1 Payment instructions

  • In case the customer has not received the M-Pesa prompt on his phone, there is another possibility to complete a M-Pesa payment flow by following the instructions:
  1. The customer opens the SIM Tool Kit and selects “M-Pesa” menu.

    1 Payment instructions

  2. The customer selects “Lipa na M-Pesa”.

    1 Payment instructions

  3. The customer selects the “Pay Bill” option.

    1 Payment instructions

  4. The customer enters his business number.

    1 Payment instructions

  5. The customer enters his account number.

    1 Payment instructions

  6. The customer needs to enter the amount.

    1 Payment instructions

  7. The customer needs to enter his M-Pesa PIN number and press “OK” button to complete the payment.

    1 Payment instructions

  8. The customer receives the payment details. If the details are correct he needs to press “OK” button to confirm the payment.

    1 Payment instructions

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

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 and the customer confirms the payment.

    1 Payment confirmation

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

    1 Return page when the redirection status is Processing

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
  }
}

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 – 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": "s2ptest_k3",
    "Amount": 11,
    "Currency": "CNY",      
    "MethodID": 24,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "Customer": {    
      "Email": "youremail@email.com"   
    },
    "BillingAddress": {
      "Country": "CN"
      },
    "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": 4116562,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20181009113914",
    "MerchantTransactionID": "s2ptest_k3",
    "OriginatorTransactionID": null,
    "Amount": "11",
    "Currency": "CNY",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "",
    "MethodID": 24,
    "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": "",
      "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=16D936ADDF2358BBDB4F4C1A151E3F4C.4116562"
  }
}

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_k5",
    "Amount": 11,
    "Currency": "CNY",      
    "MethodID": 24,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "Customer": {    
      "Email": "youremail@email.com"   
    },
    "BillingAddress": {
      "Country": "China"
      },
    "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": 4117087,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20181009125002",
    "MerchantTransactionID": "s2ptest_k5",
    "OriginatorTransactionID": null,
    "Amount": "11",
    "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": "20181009125002",
    "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
  }
}

Alliance Online Test Data

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

Alliance Online Payment Flow

  1. The customer enters his email address, name and phone number.

    1 Customer details

  2. The customer is shown the details of his payment and proceeds to pay with Alliance Online.

    1 Payment details

  3. The customer logs in to his account and completes the payment.

    1 Account login

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

    1 Return page when the redirection status is a success

Settlement invoice reports

    The Settlement invoice reports are a great tool that allows you to verify each transaction and activity in detail, including:


  • Any type of fee that applies at transaction level is reported with great granularity;
  • Information about all the payment methods traded are available in only one report;
  • The report is the confirmation that the payout to you has been made and thus can be reconciled with the entry into the bank account.

Settlement invoice reports are available in XLS, PDF and CSV format. The settlement invoices reports are generated depending on the settlement cycle of each payment method.

Examples of our standard weekly and monthly settlement cycles are provided below:

    Weekly settlement cycle

    The settlement invoice follows our standards weekly settlement cycle, which means that all transactions processed from Friday (day 1) – Thursday (day 7) period, and settled to Smart2Pay (before and after day 7) are invoiced and settled to your account on the following Tuesday (day 12):

  • Transactions period: Friday, May 18th, 2018 00:00 UTC (day 1) – Thursday, May 24th, 2018 23:59 UTC (day 7);
  • Invoice date: Tuesday, May 29th (day 12).

    Monthly settlement cycle

    The settlement invoice follows our standards monthly settlement cycle, which means that all transactions processed from July 1st to July 31st period, and settled to Smart2Pay (before and after July 31st) are invoiced and settled to your account between August 20 – 25th:

  • Transactions period: July 1st, 2018 00:00 UTC (day 1) – July 31st, 2018 23:59 UTC (last day of the month);
  • Invoice date: August 20 – 25th.

Below there are examples of Settlement invoice reports in all supported formats:

The XLS and PDF files are sent by e-mail to a group of people in your organization. Please send an e-mail to support@smart2pay.com and inform which people should be receiving this e-mail.

    The XLS file of each settlement invoice contains details about the successful transactions invoiced per payment method and per SiteID, the fees applied per payment method for each SiteID and the general Smart2Pay account fees. The information appears on separate sheets, as follows:

  • SettlementInvoice = a summary of all information listed in the settlement invoice;

  • Payments = total gross amounts (transactions) you processed via different payment methods and total refunds;

  • Transaction Fees = the fees charged for transactions processed  (according to the signed agreement);

  • Different sheets with transactions processed via a specific payment method (one for each). All payment methods sheets contain certain details per transaction to reconcile them with your system (e.g. PaymentID, InputDateTime, Amount, Currency, Status, Exchange rate, Amount in EUR).

  • Enquiries|Refunds|Reversed|CFTs = details about refunds, payment enquiries, chargebacks, etc.

  • Preapprovals|Mandates = details about preapprovals and mandates.

The CSV files are uploaded on an SFTP server where you can download them from and process them automatically. Please request login details from support@smart2pay.com.

1 Settlement invoice report

The Settlement invoice report file contains the following fields:

  • GPaymentId
    GPaymentId
    Definition
    The ID of the payment in Europay system (can be empty if you are using GlobalPay).
    Type
    int
    – ID of the payment in Europay system (can be empty if you are using GlobalPay);
  • PaymentId
    PaymentId
    Definition
    GlobalPay transaction ID, a unique number that identifies the transaction in the GlobalPay system.
    Type
    int
    Regex
    ^\d{1,12}$
    – ID of the payment in GlobalPay system;
  • Type
    Type
    Definition
    Describes the entry type:
    - Entries depending on a transaction (row has GPaymentID and/or PaymentID): Payment, Refund, Chargeback, Chargeback Reversal, Enquiry;
    - Generic entries: Monthly fee, Account Setup Fee, Account Opening Fee, Account Closing Fee, Account and Transactions Fee VAT, Repatriation Fee, IOF, etc.;
    Type
    string
    – Describes the entry type:
    1. Entries depending on a transaction (row has GPaymentID and/or PaymentID): Payment, Refund, Chargeback, Chargeback Reversal, Enquiry;
    2. Generic entries: Monthly fee, Account Setup Fee, Account Opening Fee, Account Closing Fee, Account and Transactions Fee VAT, Repatriation Fee, IOF, etc.;
  • PaymentMethodName
    PaymentMethodName
    Definition
    The name of the payment method used for the current transaction.
    Type
    string
    – The name of the payment method used for current transaction;
  • CustomerName
    CustomerName
    Definition
    When available, the Customer Name is being displayed in this field.
    Type
    string
    – When available, the Customer Name is being displayed in this field;
  • MerchantName
    MerchantName
    Definition
    Your merchant alias in our system.
    Type
    string
    – Your merchant alias in our system;
  • MerchantId
    MerchantId
    Definition
    Your Merchant Transaction ID – can be used for reconciliation.
    Type
    string
    – Your Merchant Transaction ID – can be used for reconciliation;
  • GtId
    GtId
    Definition
    Oobsolete ID that is not used anymore
    – obsolete ID that is not used anymore;
  • IssuerName
    IssuerName
    Definition
    When available, this field contains the name of the buyer bank.
    Type
    string
    – When available, this field contains the name of the buyer bank;
  • IdealTrxId
    IdealTrxId
    Definition
    For iDeal transactions only, it contains the ID of the transaction from the provider.
    Type
    int
    – For iDeal transactions only, it contains the ID of the transaction from the provider;
  • Country
    Country
    Definition
    Customer‘s country. Format is according to ISO-3166-1 alpha-2, a two-letter code.
    Type
    string
    Regex
    ^[a-zA-Z]{2}$
    – When available, it containts the customer billing country;
  • InputDateTime
    InputDateTime
    Definition
    The data and time when the transaction was initiated in our system (UTC).
    Type
    datetime
    – The data and time when the transaction was initiated in our system (UTC);
  • Amount
    Amount
    Definition
    The amount of the transaction in the currency in which the transaction was initiated
    Type
    int
    Regex
    ^\d{1,12}$
    – The amount of the transaction in the currency in which the transaction was initiated;
  • Currency
    Currency
    Definition
    The currency in which the transaction was initiated. Format is according to ISO 4217, a three-letter code.
    Type
    string
    Regex
    ^[A-Z]{3}$
    – The currency in which the transaction was initiated;
  • Status
    Status
    Definition
    The status of the transaction. Can be one of: Open, Success, Captured, Paid, Partially Captured, Failed, Cancelled, Expired, Dispute Lost, Dispute Won.
    Type
    string
    – The status of the transaction. Can be one of: Open, Success, Captured, Paid, Partially Captured, Failed, Cancelled, Expired, Dispute Lost, Dispute Won.
  • ExchangeRate
    ExchangeRate
    Definition
    The exchange rate used to convert from Currency to Settlement Currency (Reference Currency).
    – The exchange rate used to convert from Currency to Settlement Currency (Reference Currency);
  • CalculatedAmount
    CalculatedAmount
    Definition
    The amount of the transaction in the Settlement Currency (Reference Currency).
    Type
    int
    Regex
    ^\d{1,12}$
    – The amount of the transaction in the Settlement Currency (Reference Currency);
  • ReferenceCurrency
    ReferenceCurrency
    Definition
    Your settlement currency for the current transaction. Format is according to ISO 4217, a three-letter code.
    Type
    string
    Regex
    ^[A-Z]{3}$
    – Your settlement currency for the current transaction;
  • PaymentMethodFee
    PaymentMethodFee
    Definition
    The payment method fee charged for the current transaction.
    – The payment method fee charged for the current transaction;
  • TransactionFeePerSuccess
    TransactionFeePerSuccess
    Definition
    The transaction fee that is applied for successful transactions (completed).
    – The transaction fee that is applied for successful transactions (completed);
  • TransactionFeePerAttempt
    TransactionFeePerAttempt
    Definition
    The transaction fee that is applied for each successful and unsuccessful transaction processed through Smart2Pay.
    – The transaction fee that is applied for each successful and unsuccessful transaction processed through Smart2Pay;
  • IssuedFee
    IssuedFee
    Definition
    An additional transaction fee used for specific payment methods
    – An additional transaction fee used for specific payment methods;
  • LocalVatFee
    LocalVatFee
    Definition
    The local value-added tax (VAT) applied for Payment Method Fee and/or for transaction’s value for specific countries, depending on the case.
    – The local value-added tax (VAT) applied for Payment Method Fee and/or for transaction’s value for specific countries, depending on the case;
  • VAT
    VAT
    Definition
    Value-added tax (VAT) charged by Smart2Pay for PaymentMethodFee, TransactionFeePerSuccess, TransactionFeePerAttempt and Account Fees according to EU Vat regulations if necessary – field currently not used, but the information is available as additional rows at the bottom of the file.
    – Value-added tax (VAT) charged by Smart2Pay for PaymentMethodFee, TransactionFeePerSuccess, TransactionFeePerAttempt and Account Fees according to EU Vat regulations if necessary – field currently not used, but the information is available as additional rows at the bottom of the file;
  • InvoiceNumber
    InvoiceNumber
    Definition
    The number of the invoice
    – The number of the invoice;
  • InvoiceDate
    InvoiceDate
    Definition
    The date the invoice was issued
    Type
    datetime
    – The date the invoice was issued.
  • SpecificDetails
    SpecificDetails
    Definition
    Specific details provided.
    Type
    string
    – Specific details provided;

Transactional reports

The transactional reports generated can be uploaded periodically on our SFTP server where you can download them from and process them automatically. Please request login details from support@smart2pay.com.

The transactional reports are available in CSV format. By default these reports are generated every Friday (weekly) but upon request the frequency can be changed to daily.

Below there are examples of transactional reports in CSV format:

  • All transactions initiated, no matter the status of the payment: MerchantDemo_ATTEMPTS_2018_07_07;

    The generated transactional report contains transactions with all the statuses we process for your merchant account.

  • The transactions with Success status: MerchantDemo_SUCCESS_2018_07_07;

    In case a transaction was exported with a status (any status except Success), but at a later time the status changed to Success (and only Success), GlobalPay will notify again the payment with the success status and the payment will be exported in a separate report (the format is the same) and the report filename ends in “_success”.

  • The list of refunds: MerchantDemo_REFUNDS_2018_07_07;
  • The list of refunds for SmartCards payment method: MerchantDemo_SMARTCARDS_REFUNDS_2018_07_07.

1 Transactional report

The transactional report file with Success transactions contains the following information:

  • Id
    Id
    Definition
    GlobalPay transaction ID, a unique number that identifies the transaction in the GlobalPay system.
    Type
    int
    Regex
    ^\d{1,12}$
    – GlobalPay transaction ID, a unique number that identifies the transaction in the GlobalPay system;
  • MerchantTransactionID
    MerchantTransactionID
    Definition
    Merchant Transaction ID, a number that uniquely identifies a transaction in your system.
    Type
    string
    Regex
    ^[0-9a-zA-Z_-]{1,50}$
    – Merchant Transaction ID, a number that uniquely identifies a transaction in your system;
  • InputDateTime
    InputDateTime
    Definition
    Date and time when the transaction was created in GlobalPay system.
    Type
    datetime
    – Date and time when the transaction was created in GlobalPay system;
  • Status
    Status
    Definition
    The status of the transaction. It can have the following values: Open, Success, Cancelled, Failed, Expired, Authorized.
    Type
    string
    – The status of the transaction. It can have the following values: Open, Success, Cancelled, Failed, Expired, Authorized;
  • MerchantAmount
    MerchantAmount
    Definition
    The amount of the transaction.
    Type
    int
    Regex
    ^\d{1,12}$
    – The amount of the transaction;
  • MerchantCurrency
    MerchantCurrency
    Definition
    The currency in which the transaction was initiated. Format is according to ISO 4217, a three-letter code.
    Type
    string
    Regex
    ^[A-Z]{3}$
    – The currency in which the transaction was initiated;
  • MethodID
    MethodID
    Definition
    The ID of the payment method.
    Type
    int
    Regex
    ^([0-9]{1,10})$
    – The ID of the payment method;
  • ReportedByBOTOperatorDate
    ReportedByBOTOperatorDate
    Definition
    The date when the transaction was exported in a SFTP/CSV file.
    Type
    datetime
    – The date when the transaction was exported in a SFTP/CSV file;
  • CapturedAmount
    CapturedAmount
    Definition
    The payment‘s captured amount.
    Type
    int
    Regex
    ^\d{1,12}$
    – The payment‘s captured amount;
  • MethodName
    MethodName
    Definition
    The name of the payment method used.
    Type
    string
    – The name of the payment method used;
  • PaymentStateDefID
    PaymentStateDefID
    Definition
    The ID of the payment status. It can have the following values: 1 - Open, 2 - Success, 3 - Cancelled, 4 - Failed, 5 - Expired, 9 - Authorized.
    Type
    int
    – The ID of the payment status;
  • SpecificDetails
    SpecificDetails
    Definition
    Specific details provided.
    Type
    string
    – Specific details provided;
  • ReconciliationProviderID
    ReconciliationProviderID
    Definition
    A payment identification ID used at the provider’s end.
    Type
    int
    – A payment identification ID used at the provider’s end;
  • ProviderTransactionID
    ProviderTransactionID
    Definition
    Internal ID used for payment notification within our system.
    Type
    int
    – Internal ID used for payment notification within our system;
  • MerchantAlias
    MerchantAlias
    Definition
    Your merchant alias in our system.
    Type
    string
    – Your merchant alias in our system;
  • MerchantSiteID
    MerchantSiteID
    Definition
    GlobalPay website ID, a unique number that identifies the website in the GlobalPay system.
    Type
    int
    Regex
    ^\d{1,12}$
    – The ID of your site in our system;
  • MerchantSiteAlias
    MerchantSiteAlias
    Definition
    Site alias, an alternative name that identifies the website in the GlobalPay system.
    Type
    string
    Regex
    ^.{1,255}$
    – Your site alias in our system;
  • RootProviderTransactionID
    RootProviderTransactionID
    Definition
    The transaction ID from the provider.
    Type
    int
    – The transaction ID from the provider;
  • Country
    Country
    Definition
    Customer‘s country. Format is according to ISO-3166-1 alpha-2, a two-letter code.
    Type
    string
    Regex
    ^[a-zA-Z]{2}$
    – When available, it containts the customer billing country.

Dashboard reports

The Dashboard reports contain a complete list of all the transactions made with the payment methods assigned to your merchant account. You have the possibility to search for specific payments using different criteria, to see the details of the payment invoice and fees, and to export your payments into an XLS file. These reports can be exported from GlobalPay Dashboard.

For more information regarding Dashboard reports, please visit our dedicated section: GlobalPay Merchant Dashboard.

Tigo Test Data

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

Tigo Payment Flow

  1. The customer fills in the Phone number.

    1 Payment instructions

  2. The customer receives the details needed to complete the payment.

    1 Payment instructions

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

    1 Return page when the redirection status is a success

Ininal Test Data

For Ininal payment method test data is available on demand. Please contact our support department at support@smart2pay.com for more information.

Ininal Payment Flow

  1. The customer enters his phone number and his email address.

    1 Enter customer details

  2. The customer receives a 6-digit verification code at the phone number that he previously added. He needs to enter the 6-digit code and click the Confirm button.

    1 SMS Verification

  3. The Customer enters his Ininal card information and confirms the payment.

    1 Payment confirmation

  4. Upon completion of the payment flow, the customer is redirected to your ReturnUrl.

    1 Return page when the redirection status is a success

Cards Turkey Test Data

For Cards Turkey payment method test data is available on demand. Please contact our support department at support@smart2pay.com for more information.

Cards Turkey Payment Flow

  1. The customer enters his phone number and his email address.

    1 Enter customer details

  2. The customer receives a 6-digit verification code at the phone number that he previously added. He needs to enter the 6-digit code and click the Confirm button.

    1 SMS Verification

  3. The Customer enters his credit card details and confirms the payment.

    1 Payment confirmation

  4. Upon completion of the payment flow, the customer is redirected to your ReturnUrl.

    1 Return page when the redirection status is a success

BKM Express Test Data

For BKM Express payment method test data is available on demand. Please contact our support department at support@smart2pay.com for more information.

BKM Express Payment Flow

  1. The customer enters his phone number and his email address.

    1 Enter customer details

  2. The customer receives a 6-digit verification code at the phone number that he previously added. He needs to enter the 6-digit code and click the Confirm button.

    1 SMS Verification

  3. The Customer logs in to his BKM Express account with his email address and password.

    1 Account login

  4. The customer verifies the payment information and the user details and completes the transaction by clicking on the Perform Payment button.

    1 Perform payment

  5. Upon completion of the payment flow, the customer is redirected to your ReturnUrl.

    1 Return page when the redirection status is a success

Bank Transfer Turkey Test Data

For Bank Transfer Turkey payment method test data is available on demand. Please contact our support department at support@smart2pay.com for more information.

Bank Transfer Turkey Payment Flow

  1. The customer enters his phone number and his email address.

    1 Enter customer details

  2. The customer chooses the desired bank from the list provided.

    1 SMS Verification

  3. The customer enters his phone number and the verification code and clicks on the Approve button.

    1 SMS Verification

  4. The customer will receive a message that the bank information were sent to his mobile phone via sms. He just needs to write his GPM registered mobile phone to explain his payment.

    1 Perform payment

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
    }
  }
}

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
    }
  }
}

Online Banking Vietnam Test Data

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

Online Banking Vietnam Payment Flow

  1. The customer enters his Email Address (the below page can be skipped by sending the parameter in the payment request).

    1 Enter Email Address

  2. The customer has to choose his preferred payment option from the given list.

    1 Choose payment option

  3. The customer needs to enter the necessary credit card information: Name of the Cardholder, Card Number and Expiration Date. Then he needs to confirm the payment.

    1 Code via text message

  4. The customer receives a message that the payment was successfully processed.

    1 Payment successfully processed

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

    1 Return page when the redirection status is a success

Cards Vietnam Test Data

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

Cards Vietnam Payment Flow

  1. The customer enters his Email Address (the below page can be skipped by sending the parameter in the payment request).

    1 Enter Email Address

  2. The customer has to choose his preferred payment option from the given list.

    1 Choose card

  3. The customer needs to enter the necessary credit card information and billing information. Then he needs to confirm the payment.

    1 Code via text message

  4. The customer receives a message that the payment was successfully processed.

    1 Payment successfully processed

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

    1 Return page when the redirection status is a success

VTC Pay Wallet Test Data

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

VTC Pay Wallet Payment Flow

  1. The customer enters his Email Address (the below page can be skipped by sending the parameter in the payment request).

    1 Enter Email Address

  2. The customer logs in to his VTC Pay Wallet account by using his account number and password.

    1 Account login

  3. The customer will receive a a code via text message to his phone number which he needs to enter to confirm the payment.

    1 Code via text message

  4. The customer receives a message that the payment was successfully processed.

    1 Payment successfully processed

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

    1 Return page when the redirection status is a success

VTC Pay Test Data

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

VTC Pay Payment Flow

  1. The customer enters his Email Address (the below page can be skipped by sending the parameter in the payment request).

    1 Enter Email Address

  2. The customer has to choose his preferred payment method from the list.

    1 Choose payment method

  3. After choosing the payment method the customer logs in to his VTC Pay account by using his account number and password.

    1 Account login

  4. The customer will receive a a code via text message to his phone number which he needs to enter to confirm the payment.

    1 Code via text message

  5. The customer receives a message that the payment was successfully processed.

    1 Payment successfully processed

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

    1 Return page when the redirection status is a success

Local Bank Transfer 2 API – refund flow

Full or partials Local Bank Transfer 2 API refunds are made by using Initiate Refund button from Payments tab.

The Initiate Refund button is displayed only for transactions with status Success.

50

A pop-up window with the transaction details will be displayed. The Refund Merchant Transaction ID is automatically generated. You can change this ID by introducing your ID value.

If you want to perform a full refund you will have to fill Refund Amount with the same amount as Payment Amount.

In the case you want to perform a partial refund you have to fill the Refund Amount with a smaller amount than the Payment Amount. You can perform more than one refund for a transaction with the limitation that the sum of partial refunds to be smaller or equal than the initial paid amount.

51

The refunds for most LATAM payment methods are made by our local provider. In order for the refund to be processed the customer bank details are required and there are 2 possibilities:

  • the Customer bank details are sent in full in the request. In this case, the refund should be processed within 48 hours.

  • the Customer bank details are not sent in request. However, in this case, the local provider will contact the customer in order to obtain the bank details so the refund can be performed.

A confirmation message, that the refund request has been successfully sent, will be displayed:

52

You can see the complete list of all of your refunds in the Refunds tab.

54

Get the number of installments per country

You can get information about the number of installments available per country and BIN (Bank Identification Number) by using the following GET HTTP request.

Definition: GET /v1/installments?country={countryCode}&bin={bin}

Where:
  • {bin} – The Bank’s Identification Number

Request:

GET https://securetest.smart2pay.com/v1/installments?country=AR&bin=512345
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Country": "AR",
    "BIN": "512345",
    "CardBrand": "MasterCard",
    "CardSubBrand": "MasterCard",
    "Installments": [
    {
      "Number": "3",
      "Rate": "1097"
    },
    {
      "Number": "6",
      "Rate": "1951"
    },
    {
      "Number": "9",
      "Rate": "3146"
    },
    {
      "Number": "12",
      "Rate": "4211"
    }
  ]
}

Cancel a Credit Card Token

Definition: POST /v1/card/token/{value}/cancel

Where:
  • {value} – the value of the credit card token used for Recurring Payments

You have the possibility to cancel a credit card token by using the above action.

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

Request:

POST https://securetest.smart2pay.com/v1/card/token/B531AFAC800FD51A9CCF67D0CC7B24A4/cancel
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "CardAuthentication": { 
    "Card": {
      "HolderName": "John Doe",
      "Number": "VISA-1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019"
    },
    "CreditCardToken": {
      "Value": "B531AFAC800FD51A9CCF67D0CC7B24A4",
      "Active": "false"
    },
    "Status": {
      "ID": 3,
      "Info": "Canceled",
      "Reasons": []
    }
  }
}

Get information on a specific card token

Definition: GET /v1/card/token/{value}

Where:
  • {value} – the value of the credit card token used for Recurring Payments

You can get more information about a specific credit card token by using an action based on GET HTTP request. Please be aware that only a limited amount of details for each token will be provided.

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

Request:

GET https://securetest.smart2pay.com/v1/card/token/B531AFAC800FD51A9CCF67D0CC7B24A4
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "CardAuthentication": {                 
    "Card": {
      "HolderName": "John Doe",
      "Number": "VISA-1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019"
    },
    "CreditCardToken": {
      "Value": "B531AFAC800FD51A9CCF67D0CC7B24A4",
      "Active": "true"
    }                            
  }
}

Generate a Credit Card Token

To initiate Recurring Card Payments, you must generate first a credit card token. The credit card token can be obtained in two ways:

  • by initiating a payment request with GenerateCreditCardToken parameter set to true. For more detailed information, please go to our section Recurring Card Payments;
  • by using the following action for Card Authentication based on POST HTTP request:

Definition: POST /v1/card/authenticate

By using the Card Authentication request with all the necessary details for customer and for credit card, a token element will be sent in the response, containing the value of the newly created credit card token. The token received in the response can be used to initiate future Recurring Payments.

Request:

POST https://securetest.smart2pay.com/v1/card/authenticate
Authorization: Basic MTAxMDpnYWJp

{
  "CardAuthentication": {
    "Customer": {
      "FirstName": "John",
      "LastName": "Doe",
      "Email": "testing2@test.com",
      "SocialSecurityNumber": "00003456789"
      },
    "BillingAddress": {
      "Country": "BR"
      },
    "Card": {
      "HolderName": "John Doe",
      "Number": "4111111111111111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019",
      "SecurityCode": "312"
    }
  }
}

Response:

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

{
  "CardAuthentication": {
    "Customer": {
      "ID": 0,
      "MerchantCustomerID": null,
      "Email": "testing2@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": "00003456789",
      "Phone": null,
      "Company": null
      },
    "BillingAddress": {
      "ID": 0,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "BR"
      },
    "Card": {
      "HolderName": "John Doe",
      "Number": "VISA-1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019"
      },
    "CreditCardToken": {
      "Value": "B531AFAC800FD51A9CCF67D0CC7B24A4",
      "Active": "true"
    },
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": []
    }
  }
}

Resilience

By default the SDK supports Automatic Retries with Exponential Delay and Circuit Breaker.

The default configuration values for Retry and Circuit Breaker are the following:

Retry Configuration
Retry Count 3 Retries 3 times
DelayExponentialFactor 2 Wait time between retries is Math.Pow(2, retryAttempt)
Circuit Breaker Configuration
CircuitBreaker FailureThreshold 0.7 Break on >=70% actions result in handled exception
SamplingDuration TimeSpan.FromSeconds(60) Over any 60 seconds period
MinimumThroughput 16 Provided at least 16 actions in the 60 seconds period
DurationOfBreak TimeSpan.FromSeconds(60) Break for 60 seconds

If you want to change these values you will have to create your own Resilience configuration reference:

var configuration = new ResilienceConfiguration
        {
            Retry = new RetryConfiguration
            {
                Count = 5, // Retries 3 times
                DelayExponentialFactor = 5 // Wait time between retries is Math.Pow(2, retryAttempt)
            },
            CircuitBreaker = new CircuitBreakerConfiguration
            {
                FailureThreshold = 0.5, // Break on >=50% actions result in handled exceptions
                SamplingDuration = TimeSpan.FromSeconds(30), // over any 30 seconds period
                MinimumThroughput = 10, // provided at least 10 actions in the 30 seconds period.
                DurationOfBreak = TimeSpan.FromSeconds(90) // Break for 90 seconds.
            }
        };
        };


var httpClientBuilder = new HttpClientBuilder(() => AuthenticationConfiguration).WithResilienceConfiguration(configuration);

Idempotence

Our API supports idempotence for safely retrying requests and guarantees that the operation is performed only once. For example, if you create a card payment that fails due to a network connection error, you can retry the request with the same idempotence key to guarantee that only a single card payment is created.

The SDK by default uses Guid.NewGuid().ToString() to generate Unique Keys. We strongly recommend to generate your own Unique Keys using V4 UUIDs or another appropriately random string.

For card payments we’ll always send back the same response for requests made with the same key, and keys can’t be reused with different request parameters. Keys expire after 24 hours.

This is how you can plug in your Unique Key Generator:

var uniqueKeyGenerator = new Func<string>(() => {/* write your custom unique key generator logic and return a string */});
var httpClientBuilder = new HttpClientBuilder(() => AuthenticationConfiguration).WithIdempotencyKeyGenerator(uniqueKeyGenerator);

After you perform a Create Payment this is how you can obtain the Unique Key:

var createPaymentResult = await paymentService.InitiatePaymentAsync(paymentRequest);
var uniquKey = createPaymentResult.HttpRequest.Headers.GetIdempotencyToken();

INotificationCallback Interface

Notification Callback Interface
Documentation Method
Alternative Payment Notification Task<bool> AlternativePaymentNotificationCallbackAsync(ApiAlternativePaymentResponse alternativePaymentNotification);
Card Payment Notification Task<bool> CardPaymentNotificationCallbackAsync(ApiCardPaymentResponse cardPaymentNotification);
Refund Notification Task<bool> RefundNotificationCallbackAsync(ApiRefundResponse refundNotification);
Preapproval Notification Task<bool> PreapprovalNotificationCallbackAsync(ApiPreapprovalResponse preapprovalNotification);
Card Payout Notification Task<bool> CardPayoutNotificationCallbackAsync(ApiCardPayoutResponse cardPayoutNotification);
Chargebacks API Task<bool> DisputeNotificationCallbackAsync(ApiDisputeResponse disputeNotification);
Task<bool> InvalidFormatNotificationCallbackAsync(InvalidFormatNotification invalidFormatNotification);
This callback will be raised if the notification body is not in a correct Json format. You will be able to see the Exception and the Notification Body. We just recommend you to log them and not to implement any logic in this callback.
Task<bool> UnknownTypeNotificationCallbackAsync(UnknownTypeNotification unknownTypeNotification);
This callback will be raised if the notification body is in a correct Json format, but we cannot determine the type of notification. We just recommend you to log it and not to implement any logic in this callback.

Smart2Pay SDK .NET Notification

We offer you the possibility to receive notifications for every type of service used. We will notify you about the status changes to the Notification URL you setup in the Merchant Dashboard.

In order to receive notifications you need to expose REST – endpoint which accepts POSTs.

You need to implement the INotificationCallback Interface. The interface exposes asynchronous methods that return Task<bool> and uses true/false values to indicate success/failure.

Please make sure to handle your exceptions; if the SDK catches an exception it will consider that the callback has failed. The SDK will return Http 204 (No content) if the callback succeeds or it will return Http 500 (Internal Server Error) if the callback returns false or if an exception is caught.

In your POST action handler you will need an reference of INotificationProcessor type, you will need to read the Notification Body as a string and pass that string as an argument to ProcessNotificationBodyAsync method.

For more information, please visit our sections on GitHub: ASP.NET Core 1.1 and ASP.NET WebApi. Please note that examples do not implement security, but you will have to do it in your application.

To ensure that a notification has been securely processed you will need to validate the authorization header using your SiteID and API Key in the same manner you compute the authorization header for a request. For more details, please go to Authentication section.

Also, you will have to whitelist Smart2Pay’s IPs for Test and Live Environment.
Here you will find the complete list of GlobalPay’s Environments and IPs.

Refund Service

Refund Service
Documentation Method Supports cancellation Supports idempotency
Get information on a specific refund Task<ApiResult<ApiRefundResponse>> GetRefundAsync(long paymentId, int refundId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiRefundResponse>> GetRefundAsync(long paymentId, int refundId); No No
Get a list of refunds of a specific payment Task<ApiResult<ApiRefundListResponse>> GetRefundListAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiRefundListResponse>> GetRefundListAsync(long paymentId); No No
Get the status of a refund for a card payment Task<ApiResult<ApiCardRefundStatusResponse>> GetRefundStatusAsync(long paymentId, int refundId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardRefundStatusResponse>> GetRefundStatusAsync(long paymentId, int refundId); No No
Create a Refund Task<ApiResult<ApiRefundResponse>> CreateRefundAsync(long paymentId, ApiRefundRequest refundRequest, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiRefundResponse>> CreateRefundAsync(long paymentId, ApiRefundRequest refundRequest); No No
Task<ApiResult<ApiRefundResponse>> CreateRefundAsync(long paymentId, ApiRefundRequest refundRequest, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiRefundResponse>> CreateRefundAsync(long paymentId, ApiRefundRequest refundRequest, string idempotencyToken); No Yes
Get refund types for a certain payment Task<ApiResult<ApiRefundTypeListResponse>> GetRefundTypesAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiRefundTypeListResponse>> GetRefundTypesAsync(long paymentId); No No
Get refund types (filtered) Task<ApiResult<ApiRefundTypeListResponse>> GetRefundTypesAsync(short paymentMethodId, string countryCode, string currency, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiRefundTypeListResponse>> GetRefundTypesAsync(short paymentMethodId, string countryCode, string currency); No No

Preapproval Service

Preapproval Service
Documentation Method Supports cancellation Supports idempotency
Get information on a specific Preapproval Task<ApiResult<ApiPreapprovalResponse>> GetPreapprovalAsync(int preapprovalId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPreapprovalResponse>> GetPreapprovalAsync(int preapprovalId); No No
Get a list of preapprovals Task<ApiResult<ApiPreapprovalListResponse>> GetPreapprovalListAsync(CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPreapprovalListResponse>> GetPreapprovalListAsync(); No No
Get all payments associated with a preapproval Task<ApiResult<ApiPaymentListResponse>> GetPreapprovalPaymentsAsync(int preapprovalId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPaymentListResponse>> GetPreapprovalPaymentsAsync(int preapprovalId); No No
Create a Preapproval Task<ApiResult<ApiPreapprovalResponse>> CreatePreapprovalAsync(ApiPreapprovalRequest preapprovalRequest, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPreapprovalResponse>> CreatePreapprovalAsync(ApiPreapprovalRequest preapprovalRequest); No No
Task<ApiResult<ApiPreapprovalResponse>> CreatePreapprovalAsync(ApiPreapprovalRequest preapprovalRequest, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiPreapprovalResponse>> CreatePreapprovalAsync(ApiPreapprovalRequest preapprovalRequest, string idempotencyToken); No Yes
Change a Preapproval Task<ApiResult<ApiPreapprovalResponse>> ChangePreapprovalAsync(int preapprovalId, ApiPreapprovalRequest preapprovalRequest, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPreapprovalResponse>> ChangePreapprovalAsync(int preapprovalId, ApiPreapprovalRequest preapprovalRequest); No No
Task<ApiResult<ApiPreapprovalResponse>> ChangePreapprovalAsync(int preapprovalId, ApiPreapprovalRequest preapprovalRequest, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiPreapprovalResponse>> ChangePreapprovalAsync(int preapprovalId, ApiPreapprovalRequest preapprovalRequest, string idempotencyToken); No Yes
Close a Preapproval Task<ApiResult<ApiPreapprovalResponse>> ClosePreapprovalAsync(int preapprovalId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPreapprovalResponse>> ClosePreapprovalAsync(int preapprovalId); No No

Card Payout Service

Card Payout Service
Documentation Method Supports cancellation Supports idempotency
Get a list of Payouts Task<ApiResult<ApiCardPayoutListResponse>> GetPayoutListAsync(CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPayoutListResponse>> GetPayoutListAsync(); No No
Get a list of payouts (filtered) Task<ApiResult<ApiCardPayoutListResponse>> GetPayoutListAsync(CardPayoutFilter filter, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPayoutListResponse>> GetPayoutListAsync(CardPayoutFilter filter); No No
Get the status of a Payout Task<ApiResult<ApiCardPayoutStatusResponse>> GetPayoutStatusAsync(long payoutId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPayoutStatusResponse>> GetPayoutStatusAsync(long payoutId); No No
Get information on a specific Payout Task<ApiResult<ApiCardPayoutResponse>> GetPayoutAsync(long payoutId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPayoutResponse>> GetPayoutAsync(long payoutId); No No
Create a Payout Task<ApiResult<ApiCardPayoutResponse>> CreatePayoutAsync(ApiCardPayoutRequest payoutRequest, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPayoutResponse>> CreatePayoutAsync(ApiCardPayoutRequest payoutRequest); No No
Task<ApiResult<ApiCardPayoutResponse>> CreatePayoutAsync(ApiCardPayoutRequest payoutRequest, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiCardPayoutResponse>> CreatePayoutAsync(ApiCardPayoutRequest payoutRequest, string idempotencyToken); No Yes

Alternative Payment Service

Alternative Payment Service
Documentation Method Supports cancellation Supports idempotency
Get information on a specific payment Task<ApiResult<ApiAlternativePaymentResponse>> GetPaymentAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiAlternativePaymentResponse>> GetPaymentAsync(long paymentId); No No
Get a list of payments Task<ApiResult<ApiAlternativePaymentListResponse>> GetPaymentListAsync(CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiAlternativePaymentListResponse>> GetPaymentListAsync(); No No
Get a list of filtered payments Task<ApiResult<ApiAlternativePaymentListResponse>> GetPaymentListAsync(AlternativePaymentsFilter filter, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiAlternativePaymentListResponse>> GetPaymentListAsync(AlternativePaymentsFilter filter); No No
Create a Payment Task<ApiResult<ApiAlternativePaymentResponse>> CreatePaymentAsync(ApiAlternativePaymentRequest paymentRequest, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiAlternativePaymentResponse>> CreatePaymentAsync(ApiAlternativePaymentRequest paymentRequest); No No
Task<ApiResult<ApiAlternativePaymentResponse>> CreatePaymentAsync(ApiAlternativePaymentRequest paymentRequest, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiAlternativePaymentResponse>> CreatePaymentAsync(ApiAlternativePaymentRequest paymentRequest, string idempotencyToken); No Yes
Capture a Payment Task<ApiResult<ApiAlternativePaymentResponse>> CapturePaymentAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiAlternativePaymentResponse>> CapturePaymentAsync(long paymentId); No No
Task<ApiResult<ApiAlternativePaymentResponse>> CapturePaymentAsync(long paymentId, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiAlternativePaymentResponse>> CapturePaymentAsync(long paymentId, string idempotencyToken); No Yes
Cancel a Payment Task<ApiResult<ApiAlternativePaymentResponse>> CancelPaymentAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiAlternativePaymentResponse>> CancelPaymentAsync(long paymentId); No No
Task<ApiResult<ApiAlternativePaymentResponse>> CancelPaymentAsync(long paymentId, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiAlternativePaymentResponse>> CancelPaymentAsync(long paymentId, string idempotencyToken); No Yes
Create a Recurring Payment Task<ApiResult<ApiAlternativePaymentResponse>> CreateRecurrentPaymentAsync(ApiAlternativePaymentRequest paymentRequest, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiAlternativePaymentResponse>> CreateRecurrentPaymentAsync(ApiAlternativePaymentRequest paymentRequest); No No
Task<ApiResult<ApiAlternativePaymentResponse>> CreateRecurrentPaymentAsync(ApiAlternativePaymentRequest paymentRequest, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiAlternativePaymentResponse>> CreateRecurrentPaymentAsync(ApiAlternativePaymentRequest paymentRequest, string idempotencyToken); No Yes

Payment Method Service

Payment Method Service
Documentation Method Supports cancellation Supports idempotency
Payment Methods API Task<ApiResult<ApiPaymentMethodResponse>> GetPaymentMethodAsync(short paymentMethodId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPaymentMethodResponse>> GetPaymentMethodAsync(short paymentMethodId); No No
Task<ApiResult<ApiPaymentMethodListResponse>> GetPaymentMethodsListAsync(CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPaymentMethodListResponse>> GetPaymentMethodsListAsync(); No No
Task<ApiResult<ApiPaymentMethodListResponse>> GetPaymentMethodsListAsync(string countryCode, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPaymentMethodListResponse>> GetPaymentMethodsListAsync(string countryCode); No No
Task<ApiResult<ApiPaymentMethodListResponse>> GetAssignedPaymentMethodsListAsync(CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPaymentMethodListResponse>> GetAssignedPaymentMethodsListAsync(); No No
Task<ApiResult<ApiPaymentMethodListResponse>> GetAssignedPaymentMethodsListAsync(string countryCode, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiPaymentMethodListResponse>> GetAssignedPaymentMethodsListAsync(string countryCode); No No

Exchange Rate Service

Exchange Rate Service
Documentation Method Supports cancellation Supports idempotency
Get Exchange Rates Task<ApiResult<ApiExchangeRateResponse>> GetExchangeRateAsync(string fromCurrency, string toCurrency, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiExchangeRateResponse>> GetExchangeRateAsync(string fromCurrency, string toCurrency); No No

Card Payment Service

Card Payment Service
Documentation Method Supports cancellation Supports idempotency
Get the status of a card payment Task<ApiResult<ApiCardPaymentStatusResponse>> GetPaymentStatusAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentStatusResponse>> GetPaymentStatusAsync(long paymentId); Yes No
Get information on a specific payment Task<ApiResult<ApiCardPaymentResponse>> GetPaymentAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentStatusResponse>> GetPaymentAsync(long paymentId); Yes No
Get a list of payments Task<ApiResult<ApiCardPaymentListResponse>> GetPaymentListAsync(CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentListResponse>> GetPaymentListAsync(); Yes No
Get a list of direct card payments (filtered) Task<ApiResult<ApiCardPaymentListResponse>> GetPaymentListAsync(CardPaymentsFilter filter, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentListResponse>> GetPaymentListAsync(CardPaymentsFilter filter); Yes No
Create a Payment Task<ApiResult<ApiCardPaymentResponse>> CreatePaymentAsync(ApiCardPaymentRequest paymentRequest, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentResponse>> CreatePaymentAsync(ApiCardPaymentRequest paymentRequest); No No
Task<ApiResult<ApiCardPaymentResponse>> CreatePaymentAsync(ApiCardPaymentRequest paymentRequest, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiCardPaymentResponse>> CreatePaymentAsync(ApiCardPaymentRequest paymentRequest, string idempotencyToken); No Yes
Capture a Payment Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId); No No
Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId, string idempotencyToken); No Yes
Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId, long amount, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId, long amount); No No
Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId, long amount, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiCardPaymentResponse>> CapturePaymentAsync(long paymentId, long amount, string idempotencyToken); No Yes
Cancel a Payment Task<ApiResult<ApiCardPaymentResponse>> CancelPaymentAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentResponse>> CancelPaymentAsync(long paymentId); No No
Task<ApiResult<ApiCardPaymentResponse>> CancelPaymentAsync(long paymentId, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiCardPaymentResponse>> CancelPaymentAsync(long paymentId, string idempotencyToken); No Yes
Fraud Check – Payment Challenged Task<ApiResult<ApiCardPaymentResponse>> AcceptChallengeAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentResponse>> AcceptChallengeAsync(long paymentId); No No
Task<ApiResult<ApiCardPaymentResponse>> AcceptChallengeAsync(long paymentId, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiCardPaymentResponse>> AcceptChallengeAsync(long paymentId, string idempotencyToken); No Yes
Fraud Check – Payment Challenged Task<ApiResult<ApiCardPaymentResponse>> RejectChallengeAsync(long paymentId, CancellationToken cancellationToken); Yes No
Task<ApiResult<ApiCardPaymentResponse>> RejectChallengeAsync(long paymentId); No No
Task<ApiResult<ApiCardPaymentResponse>> RejectChallengeAsync(long paymentId, string idempotencyToken, CancellationToken cancellationToken); Yes Yes
Task<ApiResult<ApiCardPaymentResponse>> RejectChallengeAsync(long paymentId, string idempotencyToken); No Yes

Multiple Websites Management

If you have multiple websites from where you initiate payments to our system, there are two posibilities for managing your websites.

First one, is to manage your websites via the API and this is described next!

Second one, is to manage your websites via Merchant Dashboard. You can define more sites with distinct API Keys from the Merchant Dashboard, Configuration tab, Add a New Site. This allows you to manage multiple websites under the same merchant account.

MerchantTransactionID must be unique for each website!

Smart2Pay SDK .NET Services

Use HttpClient Builder to obtain a HttpClient Object, which you can use to initialize the services. With the HttpClient already created and the BaseAddress you can create a service instance.

Smart2Pay offers 2 environments you can use to interact with our payment platform: Test and Live.

Alternative Payment Methods Test Entry Point: https://paytest.smart2pay.com
Alternative Payment Methods Live Entry Point: https://pay.smart2pay.com

Credit Cards Test Entry Point: https://securetest.smart2pay.com
Credit Cards Live Entry Point: https://secure.smart2pay.com

See below examples on how to create a credit card payment request and a payment request for an alternative payment method of your choice.

  • You can create a credit card payment request by calling a function with the appropriate parameters given below:

    
    var baseAddress = new Uri("https://securetest.smart2pay.com");
    IHttpClientBuilder httpClientBuilder = new HttpClientBuilder(() => new AuthenticationConfiguration
    {
    	SiteId = 33258,
    	ApiKey = "JOPxYQftN9xICry9koMuER6L4SrszVHI8SLh9Q83n964tFa2GK"
    });
    var httpClient = httpClientBuilder.Build();
    var paymentService = new S2p.RestClient.Sdk.Services.CardPaymentService(httpClient, baseAddress);
    
    var paymentRequest = new CardPaymentRequest
    {
    	MerchantTransactionID = MerchantTransactionID,
    	Amount = 9000,
    	Currency = "USD",
    	ReturnURL = "http://demo.smart2pay.com/redirect.php",
    	Description = DescriptionText,
    	StatementDescriptor = "bank statement message",
    	Card = new CardDetailsRequest
    	{
    		HolderName = "John Doe",
    		Number = "4111111111111111",
    		ExpirationMonth = "02",
    		ExpirationYear = "2022",
    		RequireSecurityCode = false
    	},
    	BillingAddress = new Address
    	{
    		City = "Iasi",
    		ZipCode = "7000-49",
    		State = "Iasi",
    		Street = "Sf Lazar",
    		StreetNumber = "37",
    		HouseNumber = "5A",
    		HouseExtension = "-",
    		Country = "BR"
    	},
    	Capture = false,
    	Retry = false,
    	GenerateCreditCardToken = false,
    	PaymentTokenLifetime = 5
    }.ToApiCardPaymentRequest();
    
    var createPaymentResult = await paymentService.CreatePaymentAsync(paymentRequest);
    var createPaymentResponse = createPaymentResult.Value.Payment;
    
  • You can create a payment request for an alternative payment method by calling a function with the appropriate parameters given below:

    
    var baseAddress = new Uri("https://paytest.smart2pay.com");
    IHttpClientBuilder httpClientBuilder = new HttpClientBuilder(() => new AuthenticationConfiguration
    {
    	SiteId = 45614,
            ApiKey = "rAwLLh3rQk3uNTOPHpqydrEOdAGsRzZChCd4uyXsXoGE2tkoYA"
    });
    var httpClient = httpClientBuilder.Build();
    var paymentService = new S2p.RestClient.Sdk.Services.AlternativePaymentService(httpClient, baseAddress);
    
    var paymentRequest = new AlternativePaymentRequest()
    {
    	MerchantTransactionID = MerchantTransactionID,
    	Amount = 11,
    	Currency = "CNY",
    	MethodID = 1066,
    	ReturnURL = "http://demo.smart2pay.com/redirect.php",
    	TokenLifetime = 10,
    	Customer = new Customer
    	{
    		Email = "john@doe.com"
    	},
    	BillingAddress = new Address
    	{
    		Country = "CN"
    	}
    }.ToApiAlternativePaymentRequest();
    
    var createPaymentResult = await paymentService.CreatePaymentAsync(paymentRequest);
    var createPaymentResponse = createPaymentResult.Value.Payment;
    

For a complete list of Integration Tests examples, please go to our section on Github: SDK .NET Integration Tests.

Full Smart2Pay SDK .NET Reference

By using the HttpClient Builder you can obtain an HttpClient which is ready to send Http Request across the network.

With the HttpClient already created and the BaseAddress you can create a service instance.

The library exposes the following services: Card Payment Service, Card Payout Service, Exchange Rate Service, Payment Method Service, Alternative Payment Service, Preapproval Service, Refund Service, INotificationCallback.

Smart2Pay offers 2 environments you can use to interact with our payment platform: Test and Live.

Alternative Payment Methods Test Entry Point: https://paytest.smart2pay.com
Alternative Payment Methods Live Entry Point: https://pay.smart2pay.com

Credit Cards Test Entry Point: https://securetest.smart2pay.com
Credit Cards Live Entry Point: https://secure.smart2pay.com

Smart2Pay SDK .NET Logging

Smart2pay’s SDK provide support for logging using LoggerProvider which enables you to use the logging framework of your choice as a provider.

You need to implement ILogger interface and supply a Logging factory. A Logging factory is just a Func which should return the same Logger for a given stringKey.

See the below example of how to register the Logger Factory:

LoggingDefault.Provider.RegisterLoggerFactory(key => {/* please add your custom logger factory code here */ })

Please register the factory only once in the start method of your application!

Smart2Pay SDK .NET Configuration

First you need to create and initialize a HttpClient configured to accept JSON responses and also an Authentication Provider (using the Site ID and API Key obtained for your test merchant account).

The HttpClient Builder enables the below mandatory and optional configuration points. The only mandatory configuration point is AuthenticationProvider, the next configuration points are optional and let you have more control over the services.

Use HttpClient Builder to obtain a HttpClient Object, which you can use to initialize the services.

Please create only one HttpClient and use it for the entire life of your apllication. For more information, please visit: https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client.

Smart2Pay SDK .NET Installation

Supporting .NET Standard 1.3+, .NET Core 1.1+, and .NET Framework 4.6.1+. If you need other versions, please contact us via support@smart2pay.com.

Install Smart2pay.RestClient.SDK.NET via NuGet. Run the following command line in the Package Manager Console:

PM> Install-Package S2p.RestClient.SDK

If you do not have NuGet, you can download the package from here: https://www.nuget.org/.

Depencies used:

Smart2Pay SDK .NET

Start integration with GlobalPay payment platform using Smart2Pay SDK .NET.

Download Smart2Pay SDK .NET available now on NuGet.org. Source code available on GitHub.

Please note that in order to test a full end-to-end transaction you will require a valid Smart2Pay test account which you can obtain at: https://docs.smart2pay.com/s2p-register/. After you registered a test account at docs.smart2pay.com, use the API Key and the Site ID found at Getting Started > Integration Roadmap > Integration Site and configure your SDK.

Creating your test merchant account

Go to https://docs.smart2pay.com/s2p-register/ and complete the form. You will receive an email which will setup a password for your account.

Log into your account and go to Getting Started > Integration Roadmap > Integration Site.

Use the Site ID and the API Key found on that page to configure your test SDK environment.

In order to test a full end-to-end transaction you need to configure your SDK. For more information, please go to: Smart2Pay SDK .NET Installation.

3D Secure

3D Secure is a security protocol used as an additional layer of security for online credit card transactions prior to authorization in order to prevent fraud. 3D Secure comes from the three-domain model used to provide the additional layer of secure authentication between the financial authorization process and online authentication process. The service is provided by Visa and MasterCard under the name Verified by Visa and MasterCard SecureCode.

3D Secure enables customers to validate transactions they make over the internet by requesting an authentication method (usually a a password-based method sent over mobile or email address is used), thus reducing the risk of fraudulent use by unauthorized individuals.

3D Secure Payment Notification

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.

  • For a payment with Success 3D Secure Authentication, you will receive the below notification:

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

    Payment notification format:

    Authorization: Basic MTAxMDpnYWJp
    
    {
      "Payment": {
        "ID": 203771,
        "ClientIP": null,
        "SkinID": null,
        "Created": "20180509114444",
        "MerchantTransactionID": "s2ptest_1002",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "EUR",
        "CapturedAmount": "0",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "S2P 3Dsecure test",
        "StatementDescriptor": null,
        "MethodID": 6,
        "MethodOptionID": null,
        "SiteID": 1010,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Card": {
          "HolderName": "John Doe",
          "Number": "Ends with 0004",
          "ExpirationMonth": "5",
          "ExpirationYear": "2021"
        },
        "CreditCardToken": null,
        "Status": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
        },
        "MethodTransactionID": null,
        "PaymentTokenLifetime": null,
        "Capture": false,
        "Retry": false,
        "RedirectURL": null,
        "3DSecure": true,
        "Fraud": null
      }
    }
    

    Response:

    204 No Content
  • For a Failed 3D Secure Authentication, you will receive the below notification:

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

    Payment notification format:

    Authorization: Basic MTAxMDpnYWJp
    
    {
      "Payment": {
        "ID": 203772,
        "ClientIP": null,
        "SkinID": null,
        "Created": "20180509114626",
        "MerchantTransactionID": "s2ptest_1003",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "EUR",
        "CapturedAmount": "0",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "S2P 3Dsecure test",
        "StatementDescriptor": null,
        "MethodID": 6,
        "MethodOptionID": null,
        "SiteID": 10101,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Card": {
          "HolderName": "John Doe",
          "Number": "Ends with 0004",
          "ExpirationMonth": "5",
          "ExpirationYear": "2021"
        },
        "CreditCardToken": null,
        "Status": {
          "ID": 4,
          "Info": "Failed",
          "Reasons": [
            {
              "Code": "5073",
              "Info": "Error in holder authentication"
            }
          ]
        },
        "MethodTransactionID": null,
        "PaymentTokenLifetime": null,
        "Capture": false,
        "Retry": false,
        "RedirectURL": null,
        "3DSecure": true,
        "Fraud": null
      }
    }