Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function zstripe_config()
- {
- global $version;
- $configarray = array(
- "FriendlyName" => array(
- "Type" => "System",
- "Value" => "zStripe(Stripe.com)"
- ),
- "version" => array(
- "FriendlyName" => "Version",
- "Type" => "dropdown",
- "Options" => $version
- ),
- "StripeLibPath" => array(
- "FriendlyName" => "FULL ABSOLUTE Path to Stripe lib",
- "Type" => "text",
- "Size" => "50"
- ),
- "keySecretTest" => array(
- "FriendlyName" => "Secret Test API Key",
- "Type" => "text",
- "Size" => "40"
- ),
- "keySecretLive" => array(
- "FriendlyName" => "Secret Live API Key",
- "Type" => "text",
- "Size" => "40"
- ),
- "testmode" => array(
- "FriendlyName" => "Test Mode",
- "Type" => "yesno",
- "Description" => "Select this to use test mode"
- ),
- "storelocal" => array(
- "FriendlyName" => "Store card details locally?",
- "Type" => "yesno",
- "Description" => "Store client card details locally"
- ),
- "zstripe_licenseKey" => array(
- "FriendlyName" => "License Key",
- "Type" => "text",
- "Size" => "40"
- )
- );
- return $configarray;
- }
- function zstripe_capture($params)
- {
- $path .= ":capture:";
- zstripe_checkzLicense($params);
- if (is_file($params['StripeLibPath'])) {
- include_once($params['StripeLibPath']);
- } else if (is_file($params['StripeLibPath'] . "/Stripe.php")) {
- include_once($params['StripeLibPath'] . "/Stripe.php");
- } else if (is_file($params['StripeLibPath'] . "/lib/Stripe.php")) {
- include_once($params['StripeLibPath'] . "/lib/Stripe.php");
- } else {
- throw new Exception("Stripe library not found!");
- }
- if ($params['testmode']) {
- $gateway_Key = $params['keySecretTest'];
- } else {
- $gateway_Key = $params['keySecretLive'];
- }
- Stripe::setapikey($gateway_Key);
- $invoiceid = $params['invoiceid'];
- $amount = $params['amount'];
- $amountcents = zstripe_getMoneyAsCents($amount);
- $currency = $params['currency'];
- $firstname = $params['clientdetails']['firstname'];
- $lastname = $params['clientdetails']['lastname'];
- $email = $params['clientdetails']['email'];
- $address1 = $params['clientdetails']['address1'];
- $address2 = $params['clientdetails']['address2'];
- $city = $params['clientdetails']['city'];
- $state = $params['clientdetails']['state'];
- $postcode = $params['clientdetails']['postcode'];
- $country = $params['clientdetails']['country'];
- $phone = $params['clientdetails']['phonenumber'];
- $cardtype = $params['cardtype'];
- $cardnumber = $params['cardnum'];
- $cardexpiry = $params['cardexp'];
- $cardstart = $params['cardstart'];
- $cardissuenum = $params['cardissuenum'];
- if (2 < strlen($params['gatewayid'])) {
- $path .= ":e0:";
- $charge = array(
- amount => $amountcents,
- "usd",
- customer => $params['gatewayid'],
- description => "Invoice #" . $invoiceid
- );
- } else if (1 < strlen($params['cccvv'])) {
- $charge = array(
- amount => $amountcents,
- "usd",
- card => array(
- "name" => $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'],
- "number" => $params['cardnum'],
- "exp_month" => substr($params['cardexp'], 0, 2),
- "exp_year" => "20" . substr($params['cardexp'], 2, 2),
- "cvc" => $params['cccvv'],
- "address_line1" => $params['clientdetails']['address1'],
- "address_line2" => $params['clientdetails']['address2'],
- "address_zip" => $params['clientdetails']['postcode'],
- "address_state" => $params['clientdetails']['state']
- ),
- description => "Invoice #" . $invoiceid
- );
- } else {
- $charge = array(
- amount => $amountcents,
- "usd",
- card => array(
- "name" => $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'],
- "number" => $params['cardnum'],
- "exp_month" => substr($params['cardexp'], 0, 2),
- "exp_year" => "20" . substr($params['cardexp'], 2, 2),
- "address_line1" => $params['clientdetails']['address1'],
- "address_line2" => $params['clientdetails']['address2'],
- "address_zip" => $params['clientdetails']['postcode'],
- "address_state" => $params['clientdetails']['state']
- ),
- description => "Invoice #" . $invoiceid
- );
- }
- try {
- $path .= ":e1:";
- global $chargeObj;
- $chargeObj = Stripe_Charge::create($charge);
- }
- catch (Stripe_CardError $err) {
- $path .= ":e2:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- catch (Stripe_Error $err) {
- $path .= ":e3:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- if ($chargeObj->type) {
- $path .= ":e4:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORTYPE" => $chargeObj->type,
- "ERRORMSG" => $chargeObj->message,
- "PATH" => $path
- )
- );
- }
- if ($chargeObj->paid == "0") {
- $path .= ":e5:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORCODE" => $chargeObj->code,
- "ERRORMSG" => $chargeObj->message,
- "ERRORPARAM" => $chargeObj->param,
- "ERRORTYPE" => $chargeObj->type,
- "PATH" => $path,
- "PAID" => $chargeObj->paid
- )
- );
- }
- $path .= ":e6:";
- return array(
- "status" => "success",
- "transid" => $chargeObj->id,
- "fee" => $chargeObj->fee * 0.01,
- "rawdata" => array(
- "TRANSACTIONID" => $chargeObj->id,
- "AMOUNT" => $chargeObj->amount,
- "DESCRIPTION" => $chargeObj->description,
- "FEE" => $chargeObj->fee,
- "PAID" => $chargeObj->paid,
- "CREATED" => $chargeObj->created,
- "payment_gross" => $chargeObj->amount,
- "payment_fee" => $chargeObj->fee * 0.01,
- "payer_id" => $params['gatewayid'],
- "LIVEMODE" => $chargeObj->livemode,
- "PATH" => $path
- )
- );
- }
- function zstripe_refund($params)
- {
- $path .= ":refund:";
- zstripe_checkzLicense($params);
- if (is_file($params['StripeLibPath'])) {
- include_once($params['StripeLibPath']);
- } else if (is_file($params['StripeLibPath'] . "/Stripe.php")) {
- include_once($params['StripeLibPath'] . "/Stripe.php");
- } else if (is_file($params['StripeLibPath'] . "/lib/Stripe.php")) {
- include_once($params['StripeLibPath'] . "/lib/Stripe.php");
- } else {
- throw new Exception("Stripe library not found!");
- }
- if ($params['testmode']) {
- $gateway_Key = $params['keySecretTest'];
- } else {
- $gateway_Key = $params['keySecretLive'];
- }
- Stripe::setapikey($gateway_Key);
- $transid = $params['transid'];
- $amount = $params['amount'];
- $amountcents = zstripe_getMoneyAsCents($amount);
- $currency = $params['currency'];
- try {
- $path .= ":f1:";
- global $chargeObj;
- $chargeObj = Stripe_Charge::retrieve($transid);
- }
- catch (Stripe_CardError $err) {
- $path .= ":f2:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- catch (Stripe_Error $err) {
- $path .= ":f3:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- if ($chargeObj->type) {
- $path .= ":f4:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORTYPE" => $chargeObj->type,
- "ERRORMSG" => $chargeObj->message,
- "PATH" => $path
- )
- );
- }
- if ($chargeObj->refunded == "1") {
- $path .= ":f5:";
- return array(
- "status" => "declined",
- "rawdata" => array(
- "TRANSACTIONID" => $chargeObj->id,
- "REFUNDED" => $chargeObj->refunded,
- "ERRORMSG" => "Charge already refunded",
- "PATH" => $path
- )
- );
- }
- if ($amountcents == 0) {
- $amountcents = $chargeObj->amount;
- }
- try {
- $path .= ":f6:";
- global $chargeObj;
- $refundObj = $chargeObj->refund(array(
- amount => $amountcents
- ));
- }
- catch (Stripe_CardError $err) {
- $path .= ":f7:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- catch (Stripe_Error $err) {
- $path .= ":f8:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- if ($refundObj->type) {
- $path .= ":f9:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORTYPE" => $refundObj->type,
- "ERRORMSG" => $refundObj->message,
- "PATH" => $path
- )
- );
- }
- if (!$refundObj->type) {
- $path .= ":f10:";
- return array(
- "status" => "success",
- "transid" => $refundObj->id,
- "fees" => $refundObj->fee * 0.01,
- "rawdata" => array(
- "TRANSACTIONID" => $refundObj->id,
- "AMOUNT" => $refundObj->amount,
- "DESCRIPTION" => $refundObj->description,
- "FEE" => $refundObj->fee,
- "PAID" => $refundObj->paid,
- "CREATED" => $refundObj->created,
- "payment_gross" => $refundObj->amount,
- "payment_fee" => $refundObj->fee * 0.01,
- "payer_id" => $params['gatewayid'],
- "LIVEMODE" => $refundObj->livemode,
- "REFUNDED" => $refundObj->refunded,
- "PATH" => $path
- )
- );
- }
- $path .= ":f11:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "TYPE" => $refundObj->type,
- "MESSAGE" => $refundObj->message,
- "PATH" => $path
- )
- );
- }
- function zstripe_check_license($licensekey, $localkey = "")
- {
- $whmcsurl = "http://www.zignut.com/order/";
- $licensing_secret_key = "7718c416";
- $check_token = time() . md5(mt_rand(1000000000, 1e+010) . $licensekey);
- $checkdate = date("Ymd");
- $usersip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
- $localkeydays = 5;
- $allowcheckfaildays = 5;
- $localkeyvalid = false;
- if ($localkey) {
- $localkey = str_replace("\n", "", $localkey);
- $localdata = substr($localkey, 0, strlen($localkey) - 32);
- $md5hash = substr($localkey, strlen($localkey) - 32);
- if ($md5hash == md5($localdata . $licensing_secret_key)) {
- $localdata = strrev($localdata);
- $md5hash = substr($localdata, 0, 32);
- $localdata = substr($localdata, 32);
- $localdata = base64_decode($localdata);
- $localkeyresults = unserialize($localdata);
- $originalcheckdate = $localkeyresults['checkdate'];
- if ($md5hash == md5($originalcheckdate . $licensing_secret_key)) {
- $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - $localkeydays, date("Y")));
- if ($localexpiry < $originalcheckdate) {
- $localkeyvalid = true;
- $results = $localkeyresults;
- $validdomains = explode(",", $results['validdo' . __FILE__]);
- if (!in_array($_SERVER['SERVER_NAME'], $validdomains)) {
- $localkeyvalid = false;
- $localkeyresults['status'] = "Invalid";
- $results = array();
- }
- $validips = explode(",", $results['validip']);
- if (!in_array($usersip, $validips)) {
- $localkeyvalid = false;
- $localkeyresults['status'] = "Invalid";
- $results = array();
- }
- if ($results['validdirectory'] != dirname("C:\\dezender\\waraxe-ioncube.php")) {
- $localkeyvalid = false;
- $localkeyresults['status'] = "Invalid";
- $results = array();
- }
- }
- }
- }
- }
- if (!$localkeyvalid) {
- $postfields['licensekey'] = $licensekey;
- $postfields['do' . __FILE__] = $_SERVER['SERVER_NAME'];
- $postfields['ip'] = $usersip;
- $postfields['dir'] = dirname("C:\\dezender\\waraxe-ioncube.php");
- if ($check_token) {
- $postfields['check_token'] = $check_token;
- }
- if (function_exists("curl_exec")) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $whmcsurl . "modules/servers/licensing/verify.php");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $data = curl_exec($ch);
- curl_close($ch);
- } else {
- $fp = fsockopen($whmcsurl, 80, $errno, $errstr, 5);
- if ($fp) {
- $querystring = "";
- foreach ($postfields as $k => $v) {
- $querystring .= "{$k}=" . urlencode($v) . "&";
- }
- $header = "POST " . $whmcsurl . "modules/servers/licensing/verify.php HTTP/1.0\r\n";
- $header .= "Host: " . $whmcsurl . "\r\n";
- $header .= "Content-type: application/x-www-form-urlencoded\r\n";
- $header .= "Content-length: " . @strlen($querystring) . "\r\n";
- $header .= "Connection: close\r\n\r\n";
- $header .= $querystring;
- $data = "";
- @stream_set_timeout($fp, 20);
- @fputs($fp, $header);
- $status = @socket_get_status($fp);
- while (!feof($fp) && $status) {
- $data .= @fgets($fp, 1024);
- $status = @socket_get_status($fp);
- }
- @fclose($fp);
- }
- }
- if (!$data) {
- $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - ($localkeydays + $allowcheckfaildays), date("Y")));
- if ($localexpiry < $originalcheckdate) {
- $results = $localkeyresults;
- } else {
- $results['status'] = "Invalid";
- $results['description'] = "Remote Check Failed";
- return $results;
- }
- } else {
- preg_match_all("/<(.*?)>([^<]+)<\\/\\1>/i", $data, $matches);
- $results = array();
- foreach ($matches[1] as $k => $v) {
- $results[$v] = $matches[2][$k];
- }
- }
- if ($results['md5hash'] && $results['md5hash'] != md5($licensing_secret_key . $check_token)) {
- $results['status'] = "Invalid";
- $results['description'] = "MD5 Checksum Verification Failed";
- return $results;
- }
- if ($results['status'] == "Active") {
- $results['checkdate'] = $checkdate;
- $data_encoded = serialize($results);
- $data_encoded = base64_encode($data_encoded);
- $data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;
- $data_encoded = strrev($data_encoded);
- $data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);
- $data_encoded = wordwrap($data_encoded, 80, "\n", true);
- $results['localkey'] = $data_encoded;
- }
- $results['remotecheck'] = true;
- }
- unset($postfields);
- unset($data);
- unset($matches);
- unset($whmcsurl);
- unset($licensing_secret_key);
- unset($checkdate);
- unset($usersip);
- unset($localkeydays);
- unset($allowcheckfaildays);
- unset($md5hash);
- return $results;
- }
- function zstripe_checkzLicense($params)
- {
- $licensekey = $params['zstripe_licenseKey'];
- $localkey = file_get_contents("zstripeLicense.txt");
- $results = zstripe_check_license($licensekey, $localkey);
- if ($results['status'] == "Active") {
- if ($results['localkey']) {
- $localkeydata = $results['localkey'];
- $localkeyFile = fopen("zstripeLicense.txt", "w");
- fwrite($localkeyFile, $localkeydata);
- fclose($localkeyFile);
- }
- } else if ($results['status'] == "Invalid") {
- echo "There is a problem with validating the Payment Gateway License, please check your gateway log";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "TYPE" => "License Error",
- )
- );
- } else if ($results['status'] == "Expired") {
- echo "There is a problem with validating the Payment Gateway License, please check your gateway log";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "TYPE" => "License Error",
- )
- );
- } else if ($results['status'] == "Suspended") {
- echo "There is a problem with validating the Payment Gateway License, please check your gateway log";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "TYPE" => "License Error",
- )
- );
- } else {
- echo "There is a problem with validating the Payment Gateway License, please check your gateway log";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "TYPE" => "License Error",
- "MESSAGE" => "An unknown error occurred verifying your license(Maybe file permissions on the file?)"
- )
- );
- }
- }
- function zstripe_getMoneyAsCents($value)
- {
- $value = preg_replace("/\\,/i", "", $value);
- $value = preg_replace("/([^0-9\\.\\-])/i", "", $value);
- if (!is_numeric($value)) {
- return 0;
- }
- $value = ( double ) $value;
- return round($value, 2) * 100;
- }
- global $version;
- $version = "1.34.114";
- global $debug;
- $debug = "";
- print "zStripe " . $version . "\n";
- print "To use debug mode:\n";
- print " php zstripe.php debug 'TEST_SECRET_KEY' 'PATH_TO_STRIPE_LIB' \n\n";
- if (1 < $argc && $argv[1] == "debug") {
- if ($argc < 3) {
- print "No TEST_SECRET_KEY given.\n";
- exit();
- } else {
- $params = array(
- "testmode" => "true",
- "keySecretTest" => $argv[2],
- "storelocal" => "false"
- );
- $params['clientdetails']['firstname'] = "Zignut";
- $params['clientdetails']['lastname'] = "Zignut";
- if ($argc < 4) {
- print "Stripe lib Path not supplied.\n";
- exit();
- } else {
- $params['StripeLibPath'] = $argv[3];
- $params['cardnum'] = "4242424242424242";
- $params['cardexp'] = "1213";
- $params['cardissuenum'] = "123";
- $params['debug'] = "true";
- $params['gatewayid'] = "";
- $debug = "true";
- }
- }
- }
- $path = "";
- if ($debug) {
- print "DEBUG MODE ON " . $debug . "\n";
- zstripe_storeremote($params);
- exit();
- } else {
- if ($params['storelocal']) {
- return 1;
- }
- function zstripe_storeremote($params)
- {
- $debug = $params['debug'];
- $path .= ":storeremote:";
- if ($debug == "true") {
- } else {
- zstripe_checkzLicense($params);
- }
- if (is_file($params['StripeLibPath'])) {
- include_once($params['StripeLibPath']);
- } else if (is_file($params['StripeLibPath'] . "/Stripe.php")) {
- include_once($params['StripeLibPath'] . "/Stripe.php");
- } else {
- include_once($params['StripeLibPath'] . "/lib/Stripe.php");
- throw new Exception("Stripe library not found!");
- }
- if ($params['testmode']) {
- $gateway_Key = $params['keySecretTest'];
- } else {
- $gateway_Key = $params['keySecretLive'];
- }
- Stripe::setapikey($gateway_Key);
- if ($params['cardnum'] == "" && $params['gatewayid']) {
- $path .= ":delete:";
- return array(
- "status" => "success",
- "rawdata" => array(
- "CUSTOMERID" => $params['gatewayid'],
- "DELETED" => "Stripe doesn't support deleting card data, only customers. And deleting customer data has proven to be problematic so it has been disabled. Card information will still be removed from WHMCS.",
- "PATH" => $path
- )
- );
- } else {
- try {
- }
- catch (Stripe_CardError $err) {
- $path .= ":a1:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- catch (Stripe_Error $err) {
- $path .= ":a2:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- if ($customerObj->type) {
- $path .= ":a3:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORTYPE" => $customerObj->type,
- "ERRORMSG" => $customerObj->message,
- "PATH" => $path
- )
- );
- }
- try {
- $returnObj = $customerObj->delete();
- }
- catch (Stripe_CardError $err) {
- $path .= ":a4:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- catch (Stripe_Error $err) {
- $path .= ":a5:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- if ($returnObj->type) {
- $path .= ":a6:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORTYPE" => $returnObj->type,
- "ERRORMSG" => $returnObj->message,
- "PATH" => $path
- )
- );
- }
- $path .= ":a7:";
- return array(
- "status" => "success",
- "rawdata" => array(
- "CUSTOMERID" => $returnObj->id,
- "DELETED" => $returnObj->deleted,
- "PATH" => $path
- )
- );
- }
- if ($params['gatewayid'] == "") {
- $path .= ":create:";
- try {
- global $returnObj;
- if (1 < strlen($params['cccvv'])) {
- $returnObj = Stripe_Customer::create(array(
- "description" => $params['clientdetails']['email'],
- "card" => array(
- "name" => $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'],
- "number" => $params['cardnum'],
- "exp_month" => substr($params['cardexp'], 0, 2),
- "exp_year" => "20" . substr($params['cardexp'], 2, 2),
- "cvc" => $params['cccvv'],
- "address_line1" => $params['clientdetails']['address1'],
- "address_line2" => $params['clientdetails']['address2'],
- "address_zip" => $params['clientdetails']['postcode'],
- "address_state" => $params['clientdetails']['state']
- ),
- "email" => $params['clientdetails']['email']
- ));
- } else {
- $returnObj = Stripe_Customer::create(array(
- "description" => $params['clientdetails']['email'],
- "card" => array(
- "name" => $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'],
- "number" => $params['cardnum'],
- "exp_month" => substr($params['cardexp'], 0, 2),
- "exp_year" => "20" . substr($params['cardexp'], 2, 2),
- "address_line1" => $params['clientdetails']['address1'],
- "address_line2" => $params['clientdetails']['address2'],
- "address_zip" => $params['clientdetails']['postcode'],
- "address_state" => $params['clientdetails']['state']
- ),
- "email" => $params['clientdetails']['email']
- ));
- }
- }
- catch (Stripe_CardError $err) {
- $path .= ":b1:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- catch (Stripe_Error $err) {
- $path .= ":b2:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- if ($returnObj->type) {
- $path .= ":b3:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORTYPE" => $returnObj->type,
- "ERRORMSG" => $returnObj->message,
- "PATH" => $path
- )
- );
- }
- $path .= ":b4:";
- return array(
- "status" => "success",
- "gatewayid" => $returnObj->id,
- "rawdata" => array(
- "CREATED" => $returnObj->created,
- "CUSTOMERID" => $returnObj->id,
- "LIVEMODE" => $returnObj->livemode,
- "CUSTOMEREMAIL" => $returnObj->description,
- "PATH" => $path
- )
- );
- }
- if ($params['cardnum'] != "" && $params['gatewayid'] != "") {
- $path .= ":update:";
- try {
- global $customerObj;
- $customerObj = Stripe_Customer::retrieve($params['gatewayid']);
- }
- catch (Stripe_CardError $err) {
- $path .= ":c1:";
- return array(
- "status" => "failed",
- "rawdata" => array(
- "ERRORMSG" => $err->getMessage(),
- "PATH" => $path
- )
- );
- }
- //=================================PAYMENT==========================================//
Add Comment
Please, Sign In to add comment