Example #1
0
<?php

require_once 'client.php';
$client = new ClientAPI();
# Authentication
$data = $client->getClientKeys();
$token_auth = $data->access_token;
$client_secret = $data->refresh_token;
# Information
$data = array();
$data['client_key'] = $client->client_key;
$data['title'] = $_POST['title'];
$data['email'] = $_POST['email'];
$data['description'] = $_POST['description'];
$data['currency'] = 'PHP';
$data['total'] = $_POST['first_item_price'] + $_POST['second_item_price'] + $_POST['third_item_price'];
$data['urls']['callback'] = 'https://client/callback/url';
$data['urls']['postback'] = 'https://client/postback/iurl';
$data['ref_no'] = substr(crypt($data['client_key']), 6);
$data['mobile_no'] = $_POST['mobile_no'];
$data['items'][0]['name'] = $_POST['first_item_name'];
$data['items'][0]['price'] = $_POST['first_item_price'];
$data['items'][1]['name'] = $_POST['second_item_name'];
$data['items'][1]['price'] = $_POST['second_item_price'];
$data['items'][2]['name'] = $_POST['third_item_name'];
$data['items'][2]['price'] = $_POST['third_item_price'];
$data['info'][0]['title'] = 'Information I';
$data['info'][0]['value'] = $_POST['first_item_description'];
$data['info'][1]['title'] = 'Information II';
$data['info'][1]['value'] = $_POST['second_item_description'];
$data['info'][2]['title'] = 'Information III';