Page MenuHomeDatingVIP

cards.update
Updated 2,601 Days AgoPublic

Version 3 of 7: You are viewing an older version of this document, as it appeared on Apr 4 2017, 16:12.

cards.update

Description

Update record of stored credit card or replace it with different card

Input Parameters
NameTypeRequiredDescription
tracking_userintYesClient application user ID(s)
card_numberstringYesCredit card number
card_expirestringYesCredit card expiration date
card_cvv2stringYesCredit card CVV2 number
first_namestringYesUser first name
last_namestringYesUser last name
Returned

Array with these data in each array

NameTypeDescription
resultbooleanReturns true on success false on failure
Note

Depending on exact Payment Processor and Merchant Account settings, this API call can be time-limited.
This means that some time should pass between 2 successful calls.
Good approximation for this is 5 minutes.

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' => boolean true
  '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
Last Author
banovic
Last Edited
Apr 4 2017, 16:12

Event Timeline

boris moved this document from Unknown Object (Phriction Wiki Document).Mar 11 2015, 13:25
boris changed the visibility from "Public (No Login Required)" to "All Users".
boris changed the visibility from "All Users" to "Public (No Login Required)".
boris shifted this object from the Restricted Space space to the S6 Everyone space.Aug 8 2018, 08:22