Cubit payment gateway
To start with cubit you need to generate cubits_key and cubits_secret from your merchant account. To use the cubits api you need three things or All requests to the API MUST include the following headers for authentication:
Cubits-Key: ...
Cubits-Nonce: ...
Cubits-Signature: ...
Steps for cubit integration is
Cubits-Key: ...
Cubits-Nonce: ...
Cubits-Signature: ...
Steps for cubit integration is
- Request and Response method
- Create Invoice
- Callback/Channel to get response
ini_set('display_errors', 1);
require_once('cubits/lib/Cubits.php');
Cubits::configure("https://pay.cubits.com/api/v1/", false);
$cubits = Cubits::withApiKey($API_KEY,$API_SECRET);
$var="0.29";
$response = $cubits->createInvoice("Gold Purchase of ".$weight." gm",$var, "GBP", array(
"callback_url" => SITE_LIVE_URL."cron/backfromcubits",
"success_url" => SITE_LIVE_URL."index/thankyoupage",
"cancel_url" => SITE_LIVE_URL."index/error",
"reference" => $order_data[0]->invoice_no,
));
print_r($response);
$url=$response->invoice_url;
Required is used to include the files of cubits where cubits.php file has all the important function which is going to use in this payment integration such as createInvoice,getinvoice,createchannel etc.require_once('cubits/lib/Cubits.php');
Cubits::configure("https://pay.cubits.com/api/v1/", false);
$cubits = Cubits::withApiKey($API_KEY,$API_SECRET);
$var="0.29";
$response = $cubits->createInvoice("Gold Purchase of ".$weight." gm",$var, "GBP", array(
"callback_url" => SITE_LIVE_URL."cron/backfromcubits",
"success_url" => SITE_LIVE_URL."index/thankyoupage",
"cancel_url" => SITE_LIVE_URL."index/error",
"reference" => $order_data[0]->invoice_no,
));
print_r($response);
$url=$response->invoice_url;
put api key and api secret which you have generated from your merchant account.
when you call createinvoice function in cubit it will generate unique invoice id and invoice_url of cubit payment gateway where you have to redirect the user.
Comments
Post a Comment