cards.update
cards.update
cards.update
Description
Update record of stored credit card or replace it with different card
Input Parameters
Name | Type | Required | Description |
---|---|---|---|
tracking_user | int | Yes | Client application user ID(s) |
card_number | string | Yes | Credit card number |
card_expire | string | Yes | Credit card expiration date |
card_cvv2 | string | Yes | Credit card CVV2 number |
first_name | string | Yes | User first name |
last_name | string | Yes | User last name |
ccdt_id | int | Yes | CC card id |
Returned
Array with these data in each array
Name | Type | Description |
---|---|---|
result | array | success, ccdt_id, updated_orders included in result |
Notes
Depending on exact Payment Processor and Merchant Account settings, this API call can be time-limited.
This means that some time period must pass between 2 successful calls.
If there are more calls with the same data within this period, this call could return failure.
Good approximation for this period is 5 minutes.
For Rocket Gate processor, this setting is available on Merchant Admin :
BlockDupPurchaseTimer - Minimum time between purchases using same card and amount.
Usage Example
<?php $curl = new \Dinke\CurlHttpClient; //setup payment url and timeout $payment_url = 'https://dev-payment.datingvip.com/api.json'; $timeout = 30; $curl->setCredentials('some-token', 'some-pass'); $post_data = array( 'cmd' => 'cards.update', 'data' => array( 'tracking_user' => '4151302', 'ccdt_id' => '393', 'card_number' => '5555555555554444', 'card_expire' => '1215', 'card_cvv2' => '123', 'first_name' => 'Pera', 'last_name' => 'Peric' ) ); $response = $curl->sendPostData($payment_url, $post_data, null, $timeout); if($response === false) { //handle errors } //decode json to get array $response = json_decode($response, true); var_dump($response);
Excepted output after running this script should be:
array (size=9) 'code' => int 700 'status' => string 'Action completed succesfully' (length=28) 'command' => string 'cards.update' (length=12) 'result' => array (size=3) 'success' => boolean true, 'ccdt_id' => int 123 'updated_orders' array (length=1) int 123455 'request' => array (size=4) 'token' => string 'some-token' (length=10) 'password' => string 'some-pass' (length=32) 'command' => string 'cards.update' (length=12) 'data' => array (size=7) 'tracking_user' => string '4151302' (length=1) 'ccdt_id' => string '393' (length=1) 'card_number' => string '555555xxxxxx4444' (length=16) 'card_expire' => string '1215' (length=4) 'card_cvv2' => string 'xxx' (length=3) 'first_name' => string 'Dragan' (length=6) 'last_name' => string 'Dinic' (length=5) 'ts' => int 1399652185 'origin_ip' => boolean false 'debug' => null 'errors' => null
Referenced Files
None
Subscribers
None
- Last Author
- aplawecki
- Last Edited
- May 5 2020, 10:19