Testing Requirements

Test Amounts

Before going live you will first complete a number of test card transactions on our test environment. We have provided a range of amounts that you can use to check all the transactional statuses. Using the below amounts will produce specific responses in order for you to test different scenarios.

Please be aware that all the possible statuses of the transactions that are returned in responses are based on the values assigned in the Amount field. If you want to obtain a specific status, simply enter a specific amount as the transaction amount. Below you will find different amounts to simulate certain situations and statuses.

The amount’s last two digits represent the decimal part (11.54 will be sent 1154).

Test Amounts
Value Status Description
1 – 10000 Captured / Authorized For this amount range all the actions will be successful: payment authorization, capture action, cancel action, refund action.
10001 Failed All the transactions having this amount will fail.
10002 QueuedForCapturing

If you set capture flag to true it will return status QueuedForCapturing with return code: 5288: “Capture failed but will retry again later”.

If you set capture flag to false it will return status Authorized. Then if you sent a capture request it will receive status QueuedForCapturing with return code: 5288: “Capture failed but will retry again later”.

10003 CaptureRequested

If you set capture flag to true it will return status CaptureRequested.

If you set capture flag to false it will return status Authorized. Then if you sent a capture request it will receive status CaptureRequested.

10004 Transaction: Captured; Refund: Open If this amount will be used for a transaction it will be captured but the refund will remain Open.
10005 Failed Capture failed with timelimit reached. The timelimit for capture action is overdue.
10006 QueuedForCanceling If you set capture flag to false it will return status Authorized. Then if you sent a cancel request it will receive status QueuedForCanceling with return code: 5289: “Cancel failed but will retry again later”.
10201 – 10299 Transaction: Captured; Refund: Failed If any of the amounts in this range limit are used for a transaction it will be Captured but the refund will fail.
20001 – 30000 Failed If any of the amounts in this range limit are used for a transaction it will fail and it will receive status Failed with return code: 5291: “Security code (CVV2/CVC2) is incorrect”.
30001 – 30200 Captured / Authorized For this amount range all the actions will be successful: payment authorization, capture action, cancel action, refund action. For the initial request there is a delay in seconds according to the last 3 digits (from 1 – 200 seconds).

Test Credit Card Numbers

For testing purposes, please use the following credit card numbers:

Test Credit Card Numbers
Credit Card Name Credit Card Number
Visa: 4111111111111111
4024007189870784
4548812049400004
Mastercard: 5148196509775860
5443066050671259
Discover: 6011087785272940
6011235328768235
UnionPay: 6226388000000095
6216261000000000018
Visa Electron: 5443066050671259
4917300800000000
American Express: 345364891980314
372986503275489
Diners Club: 30120905411096
38341714925074
Hipercard: 6062825624254001
JCB: 3158178601355868
210076836080396
InstaPayment: 6385756289989351
6390524121376333

For testing purposes, please use only the credit card numbers from the above list! If any other credit card number is used for a test transaction it will fail and it will receive status Failed with return code: 5287: “Invalid card for test transaction”.

Server to Server Card Payment

If you initiate a payment with the GenerateCreditCardToken element set to false, the token element is not sent in the response/notification, so you cannot used it for future payments, but the token is still created and associated with the credit card and the payment.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_i6",
    "Amount": 2000,
    "Currency": "EUR",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "Card": {
      "HolderName": "John Doe",
      "Number": "4111111111111111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018",
      "SecurityCode": "312"
    },		
     "Capture": true,
     "Retry": true,
     "GenerateCreditCardToken": false
  }
}

Response:

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

{
  "Payment": {
    "ID": 202589,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20170511112434",
    "MerchantTransactionID": "s2ptest_i6",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 2000,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "VISA-1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018"
    },
    "CreditCardToken": null,
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": true,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": false
  }
}

Hosted Card Form

If you initiate a payment without any card or token details, you will be given in the response a RedirectURL, that will be used to redirect the customer to a form where he will have to fill all the necessary details and continue the payment.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_h6",
    "Amount": 2000,
    "Currency": "EUR",	
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Capture": true
  }
}

Response:

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

{
  "Payment": {
    "ID": 202235,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205084804",
    "MerchantTransactionID": "s2ptest_h6",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 0,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "StatementDescriptor": null,
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": 10,
    "Capture": true,
    "Retry": false,
    "RedirectURL": "https://securetest.smart2pay.com/v1/Payments/FillCardDetails?PaymentToken=202235.1010.A3F07F81639486814BAF3319CF96A9071",
    "3DSecure": null
  }
}

Also, if you initiate a Card payment using the CreditCardToken value without the SecurityCode parameter and with the RequireSecurityCode parameter set to true, a RedirectURL will be given in the response. Using this URL the customer will be redirected to a form where the card details are already filled, except the SecurityCode (card number is masked and cannot be changed). The customer will have to fill the value for the SecurityCode parameter and continue the payment.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_i9",
    "Amount": 2000,
    "Currency": "EUR",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "CreditCardToken": {
      "Value": "F43F90A5CB613D91F704407D4E297EA1",
      "RequireSecurityCode": true
    },		
     "Capture": true,
      "GenerateCreditCardToken": true
   }
}

Response:

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

{
  "Payment": {
    "ID": 202592,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20170511112846",
    "MerchantTransactionID": "s2ptest_i9",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": "0",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "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 1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018"
    },
    "CreditCardToken": {
      "Value": "F43F90A5CB613D91F704407D4E297EA1"
    },
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": 10,
    "Capture": true,
    "Retry": false,
    "RedirectURL": "https://securetest.smart2pay.com/v1/Payments/FillCardDetails?PaymentToken=202592.1010.8DBBBF0F45451A5D094F4CDD88E199698",
    "3DSecure": false
  }
}

Whenever the payment process is completed, we will notify you of the event to the notification URL you setup in the Merchant Dashboard. We will send a notification containing the final status of the card payment. For more information about notifications, please go to our section Payment Notification.

One Click Payment

If you initiate a Card payment and you set the GenerateCreditCardToken parameter to true, a token element is sent in the response, containing the value of the newly created credit card token, that you can use for future payments.

The token received in the response, together with the Security Code (CVV) parameter, can be used to initiate future payments, without having to enter all the necessary card details again.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_i4",
    "Amount": 2000,
    "Currency": "EUR",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "CreditCardToken": {
      "Value": "F43F90A5CB613D91F704407D4E297EA1",
      "SecurityCode": "312"
    },		
     "Capture": true,
     "Retry": true,
     "GenerateCreditCardToken": true
  }
}

Response:

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

{
  "Payment": {
    "ID": 202587,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20170511111702",
    "MerchantTransactionID": "s2ptest_i4",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 2000,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "Ends with 1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018"
    },
    "CreditCardToken": {
      "Value": "F43F90A5CB613D91F704407D4E297EA1"
    },
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": true,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": false
  }
}

Recurring Card Payments

For Recurring Card Payments you will need to generate a credit card token by sending the GenerateCreditCardToken parameter to true in the initial payment request. Recurring Card Payments will be initiated by sending the new generated token instead of the card details.

Please note that the credit card token has a usage limit that we can set. If the token is sent more times than our set limit the payment will fail.

  • If you initiate a Card payment and set the GenerateCreditCardToken parameter to true, a token element is sent in the response, containing the value of the newly created credit card token.

    See below an example of an initial card payment with no other mandatory parameters to be send, except for the card details and the GenerateCreditCardToken parameter to true:

    Request:

    POST https://securetest.smart2pay.com/v1/payments
    Authorization: Basic MTAxMDpnYWJp
    
    {
      "Payment": {
        "MerchantTransactionID": "s2ptest_m20",
        "Amount": "1000",
        "Currency": "EUR",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",   
        "Card": {
          "HolderName": "John Doe",
          "Number": "4548812049400004",
          "ExpirationMonth": "05",
          "ExpirationYear": "2021",
          "SecurityCode": "123",
          "RequireSecurityCode": true
          },
        "GenerateCreditCardToken": true
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 203747,
        "ClientIP": null,
        "SkinID": null,
        "Created": "20180502085305",
        "MerchantTransactionID": "s2ptest_m20",
        "OriginatorTransactionID": null,
        "Amount": 1000,
        "Currency": "EUR",
        "CapturedAmount": "0",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "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": "05",
          "ExpirationYear": "2021"
          },
        "CreditCardToken": {
          "Value": "C0D510746B513D66093609AA92BDA295"
          },
        "Status": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
          },
        "MethodTransactionID": null,
        "PaymentTokenLifetime": null,
        "Capture": false,
        "Retry": false,
        "RedirectURL": null,
        "3DSecure": false,
        "Fraud": {
          "Status": "Accept",
          "CheckMode": "CheckOnPreAuthorisation",
          "Score": 31,
          "Reason": "No decision provided"
        }
      }
    }

    The token received in the response of the initial payment, together with the RequireSecurityCode parameter set to false, can be used to initiate future Recurring Payments.

    For Recurring Payments, the security code is not needed, you only need to send the RequireSecurityCode parameter set to false. In this case, the client will not be redirected to the form page to fill in the security code, but the payment will be directly sent to the upstream processor.

    See below an example of a Recurring Card Payment:

    Request:

    POST https://securetest.smart2pay.com/v1/payments
    Authorization: Basic MTAxMDpnYWJp
    
    {
      "Payment": {
        "MerchantTransactionID": "s2ptest_m23",
        "Amount": 1000,
        "Currency": "EUR",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "CreditCardToken": {
          "Value": "C0D510746B513D66093609AA92BDA295",
          "RequireSecurityCode": false 
        }
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 203751,
        "ClientIP": null,
        "SkinID": null,
        "Created": "20180502090314",
        "MerchantTransactionID": "s2ptest_m23",
        "OriginatorTransactionID": null,
        "Amount": 1000,
        "Currency": "EUR",
        "CapturedAmount": "0",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "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": "05",
          "ExpirationYear": "2021"
          },
        "CreditCardToken": {
          "Value": "C0D510746B513D66093609AA92BDA295"
          },
        "Status": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
          },
        "MethodTransactionID": null,
        "PaymentTokenLifetime": null,
        "Capture": false,
        "Retry": false,
        "RedirectURL": null,
        "3DSecure": false,
        "Fraud": {
          "Status": "Accept",
          "CheckMode": "CheckOnPreAuthorisation",
          "Score": 31,
          "Reason": "No decision provided"
        }
      }
    }
  • For LATAM region it is mandatory to send in the initial Card payment the Country parameter for the Billing Address together with the Email parameter and the SocialSecurityNumber parameter of the Customer. You also need to set the GenerateCreditCardToken parameter to true and a token element is sent in the response, containing the value of the newly created credit card token.

    See below an example of an initial card payment with all the mandatory parameters to be sent for LATAM region:

    Request:

    POST https://securetest.smart2pay.com/v1/payments
    Authorization: Basic MTAxMDpnYWJp
    
    {
      "Payment": {
        "MerchantTransactionID": "s2p_m5",
        "Amount": 10000,
        "Currency": "BRL",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "BillingAddress": {
          "Country": "BR"
         },
        "Customer" : {
        "Email": "test@test.com",
          "SocialSecurityNumber": "00003456789"
          },
        "Card": {
          "HolderName": "John Doe",
          "Number": "4111111111111111",
          "ExpirationMonth": "05",
          "ExpirationYear": "2021",
          "SecurityCode": "123"
          },
        "GenerateCreditCardToken": true
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 203753,
        "ClientIP": null,
        "SkinID": null,
        "Created": "20180502114632",
        "MerchantTransactionID": "s2p_m5",
        "OriginatorTransactionID": null,
        "Amount": 10000,
        "Currency": "BRL",
        "CapturedAmount": "0",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "StatementDescriptor": null,
        "MethodID": 6,
        "MethodOptionID": null,
        "SiteID": 1010,
        "NotificationDateTime": null,
        "Customer": {
          "ID": 327,
          "MerchantCustomerID": null,
          "Email": "test@test.com",
          "FirstName": null,
          "LastName": null,
          "Gender": null,
          "SocialSecurityNumber": "00003456789",
          "Phone": null,
          "Company": null
          },
        "BillingAddress": {
          "ID": 9635,
          "City": null,
          "ZipCode": null,
          "State": null,
          "Street": null,
          "StreetNumber": null,
          "HouseNumber": null,
          "HouseExtension": null,
          "Country": "BR"
          },
        "ShippingAddress": null,
        "Articles": null,
        "Card": {
          "HolderName": "John Doe",
          "Number": "VISA-1111",
          "ExpirationMonth": "05",
          "ExpirationYear": "2021"
          },
        "CreditCardToken": {
          "Value": "F43F90A5CB613D91F704407D4E297EA1"
          },
        "Status": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
          },
        "MethodTransactionID": null,
        "PaymentTokenLifetime": null,
        "Capture": false,
        "Retry": false,
        "RedirectURL": null,
        "3DSecure": false,
        "Fraud": {
          "Status": "Accept",
          "CheckMode": "CheckOnPreAuthorisation",
          "Score": 31,
          "Reason": "No decision provided"
        }
      }
    }

    The token received in the response of the initial payment, can be used to initiate future Recurring Payments.

    See below an example of a Recurring Card Payment for LATAM region:

    Request:

    POST https://securetest.smart2pay.com/v1/payments
    Authorization: Basic MTAxMDpnYWJp
    
    {
      "Payment": {
        "MerchantTransactionID": "s2p_m6",
        "Amount": 10000,
        "Currency": "BRL",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "CreditCardToken": {
          "Value": "F43F90A5CB613D91F704407D4E297EA1"
          },
        "GenerateCreditCardToken": true
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 203754,
        "ClientIP": null,
        "SkinID": null,
        "Created": "20180430092243",
        "MerchantTransactionID": "s2p_m6",
        "OriginatorTransactionID": null,
        "Amount": 10000,
        "Currency": "BRL",
        "CapturedAmount": "0",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "StatementDescriptor": null,
        "MethodID": 6,
        "MethodOptionID": null,
        "SiteID": 1010,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Card": {
          "HolderName": "John Doe",
          "Number": "",
          "ExpirationMonth": "05",
          "ExpirationYear": "2021"
          },
        "CreditCardToken": {
          "Value": "F43F90A5CB613D91F704407D4E297EA1"
          },
        "Status": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
          },
        "MethodTransactionID": null,
        "PaymentTokenLifetime": null,
        "Capture": false,
        "Retry": false,
        "RedirectURL": null,
        "3DSecure": false,
        "Fraud": {
          "Status": "Accept",
          "CheckMode": "CheckOnPreAuthorisation",
          "Score": 31,
          "Reason": "No decision provided"
        }
      }
    }

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": []
    }
  }
}

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

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": []
    }
  }
}

Fraud Management

We are providing you with a secure and reliable Fraud Management solution that will protect you from any fraudulent activity and keep you and your customers happy and safe. The Fraud Check system will verify and validate your transactions in order to detect any suspicious transactions and therefore reduce the risk of chargebacks.

There are 3 possible scenarios when initiating a card payment with Fraud Check system on:

  • The card payment is initiated and the Fraud Check system doesn’t detect any suspicious behavior or rule. The payment is accepted. For more details checkout our section: Fraud Check – Payment Accepted.

  • The card payment is initiated and the Fraud Check system detects a suspicious behavior or rule. The payment is denied. For more details checkout our section: Fraud Check – Payment Denied.

  • The card payment is initiated and the Fraud Check system detects a possible suspicious behavior or rule. The payment is challenged by the fraud check provider. You can reject or accept the challenge. For more details checkout our section: Fraud Check – Payment Challenged.

Fraud Check – Payment Accepted

Any credit card transaction will undergo a Fraud Check based on the provided parameters. The more parameters are provided, a more accurate precision the fraud check will have.

The card payment is initiated and the Fraud Check system doesn’t detect any suspicious behavior or rule. The payment is accepted.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_j9",
    "Amount": 100,
    "Currency": "BRL",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "BillingAddress": {
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "BR"
    },
    "ShippingAddress": null,
    "Customer": {
      "FirstName":"John",
      "LastName":"Doe",
      "Email": "accept@accept.com",
      "SocialSecurityNumber": "00003456789"
    },
    "Card": {
      "HolderName": "John Doe",
      "Number": "4111111111111111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019",
      "SecurityCode": "312"
    },
    "Installments": 3,
    "Capture": false,
    "Retry": false,
    "GenerateCreditCardToken": false,
    "PaymentTokenLifetime": 100,
    "3DSecure": false,
    "Language": "ro-RO",
    "SkinID": 200
  }
}

Response:

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

{
  "Payment": {
    "ID": 203372,
    "ClientIP": null,
    "SkinID": 200,
    "Created": "20180209082328",
    "MerchantTransactionID": "s2ptest_j9",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "BRL",
    "CapturedAmount": "0",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 297,
      "MerchantCustomerID": null,
      "Email": "accept@accept.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": "00003456789",
      "Phone": null,
      "Company": null
      },
    "BillingAddress": {
      "ID": 9590,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "BR"
      },
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "Ends with 1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019"
      },
    "CreditCardToken": null,
    "Status": {
      "ID": 9,
      "Info": "Authorized",
      "Reasons": []
      },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": false,
    "Fraud": {
      "Status": "Accept",
      "CheckMode": "CheckOnPreAuthorisation",
      "Score": 0,
      "Reason": "Always accept rule"
      },
    "Installments": 3
    }
}   

Fraud Check – Payment Denied

If the system detects a malicious transaction, that transaction will be rejected by the fraud check provider. You will be given in the response the reason of why the transaction has Failed in the Reason field in the Fraud object.

The card payment is initiated and the Fraud Check system detects a suspicious behavior or rule. The payment is denied.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_j8",
    "Amount": 100,
    "Currency": "BRL",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "BillingAddress": {
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "BR"
    },
    "ShippingAddress": null,
    "Customer": {
      "FirstName":"John",
      "LastName":"Doe",
      "Email": "deny@deny.com",
      "SocialSecurityNumber": "00003456789"
    },
    "Card": {
      "HolderName": "John Doe",
      "Number": "4111111111111111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019",
      "SecurityCode": "312"
    },
    "Installments": 3,
    "Capture": false,
    "Retry": false,
    "GenerateCreditCardToken": false,
    "PaymentTokenLifetime": 100,
    "3DSecure": false,
    "Language": "ro-RO",
    "SkinID": 200
  }
}

Response:

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

{
  "Payment": {
    "ID": 203371,
    "ClientIP": null,
    "SkinID": 200,
    "Created": "20180209082141",
    "MerchantTransactionID": "s2ptest_j8",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "BRL",
    "CapturedAmount": "0",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 296,
      "MerchantCustomerID": null,
      "Email": "deny@deny.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": "00003456789",
      "Phone": null,
      "Company": null
      },
    "BillingAddress": {
      "ID": 9590,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "BR"
      },
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "Ends with 1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019"
      },
    "CreditCardToken": null,
    "Status": {
      "ID": 4,
      "Info": "Failed",
      "Reasons": [
        {
          "Code": 116,
          "Info": "Transaction rejected by fraud provider"
          }
        ]
      },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": false,
    "Fraud": {
      "Status": "Reject",
      "CheckMode": "CheckOnPreAuthorisation",
      "Score": 74,
      "Reason": "Transaction hit a velocity or rule threshold"
      },
    "Installments": 3
    }
}

Fraud Check – Payment Challenged

If the system detects a possible malicious transaction, that transaction will be challenged by the fraud check provider. There are 2 possible outcomes after running your own processes and procedures for fraud management: you can reject or accept the challenge.

The card payment is initiated and the Fraud Check system detects a possible suspicious behavior or rule. The payment is challenged by the fraud check provider. You can reject or accept the challenge.

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_j10",
    "Amount": 100,
    "Currency": "BRL",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "BillingAddress": {
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "BR"
    },
    "ShippingAddress": null,
    "Customer": {
      "FirstName":"John",
      "LastName":"Doe",
      "Email": "challenge@challenge.com",
      "SocialSecurityNumber": "00003456789"
    },
    "Card": {
      "HolderName": "John Doe",
      "Number": "4111111111111111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019",
      "SecurityCode": "312"
    },
    "Installments": 3,
    "Capture": false,
    "Retry": false,
    "GenerateCreditCardToken": false,
    "PaymentTokenLifetime": 100,
    "3DSecure": false,
    "Language": "ro-RO",
    "SkinID": 200
  }
}

Response:

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

{
  "Payment": {
    "ID": 203373,
    "ClientIP": null,
    "SkinID": 200,
    "Created": "20180209082529",
    "MerchantTransactionID": "s2ptest_j10",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "BRL",
    "CapturedAmount": "0",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 298,
      "MerchantCustomerID": null,
      "Email": "challenge@challenge.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": "00003456789",
      "Phone": null,
      "Company": null
      },
    "BillingAddress": {
      "ID": 9590,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "BR"
      },
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "Ends with 1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2019"
      },
    "CreditCardToken": null,
    "Status": {
      "ID": 30,
      "Info": "PendingChallengeConfirmation",
      "Reasons": []
      },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": false,
    "Fraud": {
      "Status": "Challenge",
      "CheckMode": "CheckOnPreAuthorisation",
      "Score": 55,
      "Reason": "Transaction hit a velocity or rule threshold"
      },
    "Installments": 3
    }
}

Accept the Challenge:

Request:

POST https://securetest.smart2pay.com/v1/payments/203373/challenge/accept
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 203373,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20180209082529",
    "MerchantTransactionID": "s2ptest_j10",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "BRL",
    "CapturedAmount": "0",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "411111******1111",
      "ExpirationMonth": "2",
      "ExpirationYear": "2019"
      },
    "CreditCardToken": null,
    "Status": {
      "ID": 9,
      "Info": "Authorized",
      "Reasons": []
      },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": false,
    "Fraud": {
      "Status": "Challenge",
      "CheckMode": "CheckOnPreAuthorisation",
      "Score": 55,
      "Reason": "Transaction hit a velocity or rule threshold"
      },
    "Installments": 3
    }
}

Reject the Challenge:

Request:

POST https://securetest.smart2pay.com/v1/payments/203374/challenge/reject
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 203374,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20180209082726",
    "MerchantTransactionID": "s2ptest_j11",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "BRL",
    "CapturedAmount": "0",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "test payment",
    "StatementDescriptor": "card payment",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 298,
      "MerchantCustomerID": null,
      "Email": "challenge@challenge.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": null,
      "SocialSecurityNumber": "00003456789",
      "Phone": null,
      "Company": null
      },
    "BillingAddress": {
      "ID": 9590,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "BR"
      },
    "ShippingAddress": null,
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "411111******1111",
      "ExpirationMonth": "2",
      "ExpirationYear": "2019"
      },
    "CreditCardToken": null,
    "Status": {
      "ID": 3,
      "Info": "Cancelled",
      "Reasons": [
      {
        "Code": 118,
        "Info": "Transaction rejected by merchant"
        }
      ]
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": false,
    "RedirectURL": null,
    "3DSecure": false,
    "Fraud": {
      "Status": "Challenge",
      "CheckMode": "CheckOnPreAuthorisation",
      "Score": 55,
      "Reason": "Transaction hit a velocity or rule threshold"
      },
    "Installments": 3
    }
}

Capture a Card Payment

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

Where:
  • {id} – GlobalPay Payment ID

A payment can only be captured if it has an Authorized status. The Authorized status can only be obtained for direct card payments initiated with Capture parameter set to false.

Once the payment has an Authorized status, you can capture either a partial amount or the full amount of the initial authorized amount for the transaction.

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

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

Request:

POST https://securetest.smart2pay.com/v1/payments/202238/capture
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 202238,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091735",
    "MerchantTransactionID": "s2ptest_h9",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 2000,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Partial capture means you have the possibility to capture a smaller amount than the one from the initial authorized transaction.

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

You need to specify the captured amount parameter in the query string, in order to partially capture a payment.

Request:

POST https://securetest.smart2pay.com/v1/payments/202239/capture?amount=1000
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 202239,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091934",
    "MerchantTransactionID": "s2ptest_h10",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 1000,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 35,
      "Info": "PartiallyCaptured",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": 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://securetest.smart2pay.com/v1/payments/202238/capture
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 202238,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091735",
    "MerchantTransactionID": "s2ptest_h9",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 2000,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": [
        {
          "Code": "1006",
          "Info": "Payment.State is invalid"
        }
      ]
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Cancel a Card Payment

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

Where:
  • {id} – GlobalPay Payment ID

A payment can be cancelled if it has an Authorized status. The Authorized status can only be obtained for direct card payments initiated with Capture parameter set to false.

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

Request:

POST https://securetest.smart2pay.com/v1/payments/202237/cancel
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 202237,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091456",
    "MerchantTransactionID": "s2ptest_h8",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 0,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 3,
      "Info": "Cancelled",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": 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://securetest.smart2pay.com/v1/payments/202237/cancel
Authorization: Basic MTAxMDpnYWJp

Response:

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

{
  "Payment": {
    "ID": 202237,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091456",
    "MerchantTransactionID": "s2ptest_h8",
    "OriginatorTransactionID": null,
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 0,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 3,
      "Info": "Cancelled",
      "Reasons": [
        {
          "Code": "1006",
          "Info": "Payment.State is invalid"
        }
      ]
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Direct Card Payment Notification Format

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard.

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

Payment notification format:

Authorization: Basic MTAxMDpnYWJp

{
  "Payment": {
    "ID": 202242,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205093117",
    "MerchantTransactionID": "s2ptest_h12",
    "OriginatorTransactionID": "100_a",
    "Amount": 2000,
    "Currency": "EUR",
    "CapturedAmount": 2000,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": {
      "HolderName": "John Doe",
      "Number": "VISA-1111",
      "ExpirationMonth": "02",
      "ExpirationYear": "2018"
    },
    "CreditCardToken": {
      "Value": "6BEBF42B0E43D3BFD360DFB5EFF9D96D"
    },
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": true,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Response:

204 No Content

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 Payments

For enabling and using 3D Secure service, there are two options:

  • statically, in which we can enable for you the 3D Secure service at SiteID level;
  • dynamically, in which you send the 3DSecure parameter in the payment request.

If you set the 3DSecure parameter to true, the customer will be required to authenticate the card used for that transaction:

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_1002",
    "Amount": "100",
    "Currency": "EUR",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "S2P 3Dsecure test",    
    "Card": {
      "HolderName": "John Doe",
      "Number": "4548812049400004",
      "ExpirationMonth": "05",
      "ExpirationYear": "2021",
      "SecurityCode": "123"
      },
    "3DSecure": true
  }
}

Response:

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

{
  "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": "05",
      "ExpirationYear": "2021"
      },
    "CreditCardToken": null,
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": []
      },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": 10,
    "Capture": false,
    "Retry": false,
    "RedirectURL": "https://securetest.smart2pay.com/v1/Payments/FillCardDetails?PaymentToken=203771.1010.05D9FE3FD0AF7FD3D1C848A82F5F54985&SkipLandingPage=true",
    "3DSecure": true,
    "Fraud": null
  }
}

Access the RedirectURL received in the payment response and enter an identification code. Please note that the landing page will be different depending on the card issuer.

For test purposes, please enter the identification test code received on the page (123456). For a Success 3D Secure Authentication click on the Acceptar button and for a Failed 3D Secure Authentication click on the Cancelar button.

1 Enter Identification Code

You will receive a payment notification to the Notification URL you setup in the Merchant Dashboard containing the new payment status. For more information on Payment Notifications with Success or Failed 3D Secure Authentication, go to our section 3D Secure Payment Notification.

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

    Response:

    204 No Content