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": "2021",
"IssuingBankCountry": null
},
"CreditCardToken": {
"Value": "B531AFAC800FD51A9CCF67D0CC7B24A4",
"Active": "false"
},
"Status": {
"ID": 3,
"Info": "Canceled",
"Reasons": []
}
}
}
{"CardAuthentication":{"hint":"Card Authentication structure","regexp":"","type":"object","Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID","regexp":"^\\d{1,12}$","type":"int"},"MerchantCustomerID":{"hint":"The ID of the customer in your system.","regexp":"^([0-9a-zA-Z_-]{1,50})?$","type":"string"},"Email":{"hint":"Customer\u2019s email","regexp":"^[a-zA-Z0-9\\._%+-]{1,100}@[a-zA-Z0-9\\.-]{1,40}\\.[a-zA-Z]{1,8}$","type":"string"},"FirstName":{"hint":"Customer\u2019s first name","regexp":"","type":"string"},"LastName":{"hint":"Customer\u2019s last name","regexp":"","type":"string"},"Gender":{"hint":"Customer\u2019s gender. It can have the following values: 1 - Male, 2 - Female.","regexp":"","type":"string"},"DateOfBirth":{"hint":"Customer date of birth","regexp":"^(((19|20)\\d\\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))$","type":"date"},"SocialSecurityNumber":{"hint":"Customer\u2018s social or fiscal identifier","regexp":"","type":"string"},"Phone":{"hint":"Customer\u2019s phone including prefix","regexp":"","type":"string"},"Company":{"hint":"Company name (for legal entities)","regexp":"","type":"string"},"InputDateTime":{"hint":"Customer creation date","regexp":"","type":"datetime"}},"BillingAddress":{"hint":"Billing Address details","regexp":"","type":"object","ID":{"hint":"Address ID, a unique number that identifies an address in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Customer\u2018s country. Recommended to be sent in order to increase the conversion. If MethodID is missing, this field (taken from BillingAddress object) controls which payment methods are shown on the hosted payment pages. Format is according to ISO-3166-1 alpha-2, a two-letter code.","regexp":"^([A-Za-z]{2})?$","type":"string"},"City":{"hint":"City name","regexp":"^(.{1,255})?$","type":"string"},"ZipCode":{"hint":"Postal code","regexp":"^(.{1,255})?$","type":"string"},"State":{"hint":"State name","regexp":"^(.{1,255})?$","type":"string"},"Street":{"hint":"Street name","regexp":"^(.{1,255})?$","type":"string"},"StreetNumber":{"hint":"Street Number","regexp":"^(.{1,255})?$","type":"string"},"HouseNumber":{"hint":"House Number","regexp":"^(.{1,255})?$","type":"string"},"HouseExtension":{"hint":"House Extension","regexp":"^(.{1,255})?$","type":"string"}},"Card":{"hint":"Card details","regexp":"","type":"object","HolderName":{"hint":"Card holder name","regexp":"^[^\\d]*$","type":"string"},"Number":{"hint":"Card number","regexp":"^(\\d{16,19})$","type":"string"},"ExpirationMonth":{"hint":"Card expiration month","regexp":"^(0?[1-9]|1[0-2])$","type":"string"},"ExpirationYear":{"hint":"Card expiration year","regexp":"^(20|)([0-9]{2})$","type":"string"},"IssuingBankCountry":{"hint":"Card issuing bank country","regexp":"^[a-zA-Z]{2}$","type":"string"},"SecurityCode":{"hint":"Card security code (CVV2)","regexp":"^([0-9]){3,4}$","type":"string"},"RequireSecurityCode":{"hint":"If set to false when the security code parameter is not used, it will not redirect to the form page to fill in the security code, but the payment will be directly sent to the payment provider.","regexp":"","type":"bool"},"Token":{"hint":"Card token","regexp":"","type":"string"},"MaskedNumber":{"hint":"Card masked number","regexp":"","type":"string"}},"CreditCardToken":{"hint":"Credit card token structure","regexp":"","type":"object","Value":{"hint":"Token value","regexp":"","type":"string"},"RequireSecurityCode":{"hint":"If set to false when the security code parameter is not used, it will not redirect to the form page to fill in the security code, but the payment will be directly sent to the payment provider.","regexp":"","type":"bool"},"SecurityCode":{"hint":"Token security code","regexp":"","type":"string"}},"Status":{"hint":"","regexp":"","type":"object","ID":{"hint":"Status ID","regexp":"","type":"int"},"Info":{"hint":"The description of the status","regexp":"","type":"string"},"Reasons":{"hint":"The reasons why the payment got to this status.","regexp":"","type":"array of objects","Code":{"hint":"The id of the message type transmitted in the response. See our section GlobalPay Return Codes for a complete description.","regexp":"","type":"int"},"Info":{"hint":"The message body","regexp":"","type":"string"}}}}}