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,
    "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",
      "IssuingBankCountry": null
    },
    "CreditCardToken": {
      "Value": "F43F90A5CB613D91F704407D4E297EA1"
    },
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": []
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": 10,
    "Capture": true,
    "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.