Getting token data
Tokenization is carried out by sending additional "IsTokenRequest" parameter along with the
other WSPayAuto form data parameters needed for processing payment using WSPayAuto.
IsTokenRequest
|
This parameter will tell WSPayAuto to tokenize credit card that will be used in
transaction.
Parameter must have value: 1
|
After successful transaction, WSPayAuto will redirect customer to ReturnURL with three
additional parameters
Token |
Unique identifier that represents tokenized credit card.
|
TokenNumber |
Last 4 digits of the credit card.
|
TokenExp |
Credit card expiration date.
Format: YYMM
|
Payment using token
There are two possible ways to process payment using token after credit card has been
tokenized:
- WSPayAuto payment using token
- Direct payment using token
WSPay will provide additional ShopID that will be used for payment using
token.
Who and when can use which method?
There are two main distinctions regarding payment with tokenized card: Customer Initiated
Transactions (CIT) and
Merchant Initiated Transactions (MIT).
Customer Initiated Transactions are transactions where customer is the one who initiates
transaction with saved
card.
For example, customer chooses to pay with saved card in checkout process on merchants web
shop.
Merchant Initiated Transactions are transaction where merchant submits a transaction with
previously saved card
without the customer participation.
For example, recurring payment, incremental payment
or direct payment.
Transaction type |
Merchant in EEA |
Merchant outside EEA |
CIT |
Must use "WSPayAuto payment using token" |
May use any method |
MIT |
Will use "Direct payment using token" |
Will use "Direct payment using token" |
We recommend using “WSPayAuto payment using token” for all Customer Initiated
Transactions since it provides more convenience for merchants in the means of
chargeback.
Note that Maestro card requires 3D Secure authentication for every transaction so it
cannot be processed using “Direct payment using token” method.
WSPayAuto payment using token
WSPayAuto payment using token is carried out by sending "Token" and "TokenNumber" parameters
instead of "CreditCardName", "CreditCardNumber" and "ExpirationDate".
Token
string
|
Unique identifier that represents tokenized credit card.
This parameter is received as a result of a previous tokenization
process.
|
TokenNumber
string
|
Last 4 digits of the credit card.
This parameter is received as a result of a previous tokenization
process.
|
Direct payment using token
In order to process direct payment using token - request object in JSON format must be sent
using HTTP POST to endpoint that
will be provided by WSPay.
Request:
{
"Version": "2.0",
"ShopID": "MYSHOPTOK",
"ShoppingCartID": "78",
"Token": "237038b3-761f-4bf7-a107-a18efa84dde0",
"TokenNumber": "2152",
"PaymentPlan": "0000",
"TotalAmount": "1700",
"DateTime": "20190722115807",
"CustomerFirstName": "John",
"CustomerLastName": "Doe",
"CustomerAddress": "Address 10",
"CustomerCity": "City",
"CustomerZIP": "51000",
"CustomerCountry": "HR",
"CustomerPhone": "0911111111",
"CustomerEmail": "john@doe.com",
"Language": "HR",
"Signature": "4a2b4246db90ed60eff677a60fd139f50e09c3e19d14a1503921c70780b912cf04fd44a7b3b6bd3376e4089891a2600aef5aade8979ec546a2ad2bac5d7f8daa"
}
Response:
{
"WsPayOrderId": "dd9ec33a-0638-47d0-b17a-5de403ae3a3d",
"ShoppingCartID": "78",
"CustomerFirstName": "John",
"CustomerLastName": "Doe",
"CustomerAddress": "Address 10",
"CustomerCity": "City",
"CustomerZIP": "51000",
"CustomerCountry": "HR",
"CustomerPhone": "0911111111",
"CustomerEmail": "john@doe.com",
"ECI": null,
"XID": null,
"CAVV": null,
"UCAF": null,
"MaskedPan": "377500*******1234",
"CreditCardName": "MVISA",
"PaymentPlan": "0000",
"ApprovalCode": "610990",
"ErrorMessage": null,
"Approved": "1",
"TotalAmount": "1700",
"STAN": "38419",
"ActionSuccess": "1",
"TransactionDateTime": "20181231233202",
"Partner": "Pbz",
"Signature": "4be89181861d5c9759a5032bbadfd4c4f07c0a90b4001155ddfbabb74512fdcb3927f9226c14d1235a9bcd9a6e4d7723289cb55d3bf2863f9519e32c28c7b3d9"
}