Card unbinding
Card unbinding
To unbind a card from recurring (CoF) payments using JSON API, use the following request.
When working with HTML forms, the request to unbind a card from recurring (CoF) payments must consist of the following set of fields:
wsb_versionwsb_seedwsb_storeidwsb_customer_idwsb_operation_typewsb_recurring_tokenwsb_signature
The wsb_signature parameter is calculated by concatenating the following fields into a single string:
wsb_seedwsb_storeidwsb_customer_idwsb_operation_typewsb_recurring_tokenSecretKey
The concatenation order of the fields must not be violated. Then, depending on the specified protocol version (wsb_version), the MD5 (if the version is not specified) or SHA1 (for version 2) of the concatenated string is calculated.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<?php
$secret_key = 'jPwe3d5nmN';
$wsb_storeid = '507990464';
$wsb_seed = time();
$wsb_customer_id = '111333';
$operation_type = 'recurring_unbind';
$wsb_recurring_token = 904928145;
$wsb_signature = sha1($wsb_seed.$wsb_storeid.$wsb_customer_id.$operation_type.$wsb_recurring_token.$secret_key);
?>
<body>
<form action="http://securesandbox.webpay.by" method="post" target="_blanc">
<input type="hidden" name="*scart">
<input type="hidden" name="wsb_version" value="2" />
<input type="hidden" name="wsb_seed" value="<?=$wsb_seed?>">
<input type="hidden" name="wsb_storeid" value="<?=$wsb_storeid?>">
<input type="hidden" name="wsb_customer_id" value="<?= $wsb_customer_id ?>">
<input type="hidden" name="wsb_operation_type" value="<?= $operation_type ?>">
<input type="hidden" name="wsb_recurring_token" value="<?= $wsb_recurring_token ?>">
<input type="hidden" name="wsb_signature" value="<?= $wsb_signature ?>">
<input type="submit" value="Unsubscribe from recurring payments">
</form>
</body>
</html>Notification after unbinding a card from recurring payments
After each unbinding request, the WEBPAY system sends a response indicating successful or failed unbinding.
// example of a successful unbinding response
{"batch_timestamp":1586734397,"customer_id":"test_1","operation_type":"recurring_unbind","recurring_token":"606799416","rc":"0",
"rc_text":"Operation success"}
// example of an error response
{"batch_timestamp":1586734514,"customer_id":"test_12","operation_type":"recurring_unbind","recurring_token":"606799416","rc":"1018",
"rc_text":"Operation failed"}