URL: Client_AddCard.php
to use as JSON, append ?apiformat=json to the URL, then send through all variables as a JSON encoded string.
username
password
client_id
card_name - As it appears on the card
expiry_date - YYYY-MM (Note, you can set alt_date_format to 1, then your date format must be MMYYYY)
Either:
card_nr
cvv
Or:
masked_card_nr
card_token
alt_date_format - 0 or 1 (Defaults to 0. When set to 1, your expiry_date format must be MMYYYY)
JSON encoded string
Possible Values:
type=>success,message=>Credit card already added.
type=>success,message=>Credit card successfully added.
type=>error,message=>Netcash Vault not enabled.
type=>error,message=>Your card could not be validated, please try again. Error: {Error Details}
$param['username'] = '';
$param['password'] = '';
$param['client_id'] = '';
$param['card_name'] = '';
$param['expiry_date'] = '';
$param['card_nr'] = '';
$param['cvv'] = '';
$url = 'https://www.jobcardsonline.co.za/api/Client_AddCard.php?apiformat=json';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //set the url
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //return as a variable
curl_setopt($ch, CURLOPT_POST, 1); //set POST method
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($param)); //POST the JSON data
$response = curl_exec($ch); //run the whole process and return the response
Updated: Sat, 30 May 2020