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 |
Returned
Array with these data in each array
Name | Type | Description |
---|---|---|
result | boolean | Returns true on success false on failure |
Usage Example
<?php require_once "curl_http_client/curl_http_client.php"; $curl = new Curl_HTTP_Client(); //setup payment url and timeout $payment_url = 'https://dev-payment.datingvip.com'; $timeout = 30; //generate post data $post_data = array ( 'token' => 'some-token', 'password' => '130d04b80a4196857e47b254ebfbb53f', 'command' => 'cards.update', 'data' => array( 'tracking_user' => '4151302', 'ccdt_id' => '64', 'card_number' => '5555555555554444', 'card_expire' => '1215', 'card_cvv2' => '123', 'first_name' => 'Dragan', 'last_name' => 'Dinic' ) ); $response = $curl->send_post_data($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' => boolean true 'request' => array (size=4) 'token' => string 'some-token' (length=10) 'password' => string '130d04b80a4196857e47b254ebfbb53f' (length=32) 'command' => string 'cards.update' (length=12) 'data' => array (size=7) 'tracking_user' => string '1' (length=1) 'ccdt_id' => string '1' (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
- boris
- Last Edited
- Mar 11 2015, 13:25