With the Zen cart Stripe payment plugin, can Stripe see the cardholders IP address or is it up to the siteholder to guard against fraud?

Chris Waters

Chris Waters, studied at University of California, Los Angeles

Répondu il y a 17w

To add a bit more info, here is a paste of the Stripe plugin PHP. I am no PHP expert, but I see no IP info getting posted to Stripe here, inless it is buried in one of the variables.

/**

* Stripe Payments payment method class

*

* @package paymentMethod

* @copyright 2012 http://Blue-Toucan.co.uk

* @copyright Copyright 2003-2012 Zen Cart Development Team

* @copyright Portions Copyright 2003 osCommerce

* @license http://www.zen-cart.com/license/... GNU Public License V2.0

* @Please direct any suggestions/bugs/comments to Blue Toucan

*

* Stripe Payments USD/CAN

* You must have SSL active on your server to use this in live mode

*

*/

class stripepay extends base

{

var $code, $title, $description, $enabled;

// class constructor

function stripepay()

{

global $order,$messageStack;;

$this->code = 'stripepay';

$this->api_version = 'Stripe Payments v 1.3.2 for ZenCart';

$this->title = MODULE_PAYMENT_STRIPEPAY_TEXT_TITLE;

$this->description = MODULE_PAYMENT_STRIPEPAY_TEXT_DESCRIPTION;

$this->sort_order = MODULE_PAYMENT_STRIPEPAY_SORT_ORDER;

$this->enabled = ((MODULE_PAYMENT_STRIPEPAY_STATUS == 'True') ? true : false);

$this->form_action_url = '';

//admin title info

if (IS_ADMIN_FLAG === true) {

if (!function_exists('curl_init')) $this->title .= '';

if ( MODULE_PAYMENT_STRIPEPAY_TESTING_SECRET_KEY == '' ||

MODULE_PAYMENT_STRIPEPAY_TESTING_PUBLISHABLE_KEY == '' ||

MODULE_PAYMENT_STRIPEPAY_MERCHANT_LIVE_SECRET_KEY == '' ||

MODULE_PAYMENT_STRIPEPAY_LIVE_PUBLISHABLE_KEY == ''){

$this->title .= '';

}

if (ENABLE_SSL_CATALOG!=='true'){

$this->title .= '';

}

}

if ((int) MODULE_PAYMENT_STRIPEPAY_ORDER_STATUS_ID > 0) {

$this->order_status = MODULE_PAYMENT_STRIPEPAY_ORDER_STATUS_ID;

} //(int) MODULE_PAYMENT_STRIPEPAY_ORDER_STATUS_ID > 0

// $this->form_action_url = '';

if (is_object($order))

$this->update_status();

}

// class methods

function update_status()

{

global $order, $db;

if (($this->enabled == true) && ((int) MODULE_PAYMENT_STRIPEPAY_ZONE > 0)) {

$check_flag = false;

$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");

while (!$check->EOF) {

if ($check->fields['zone_id'] < 1) {

$check_flag = true;

break;

} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {

$check_flag = true;

break;

} //$check['zone_id'] == $order->delivery['zone_id']

$check->MoveNext();

}

if ($check_flag == false) {

Leggi:  Puis-je acheter des Bitcoins sur eBay avec une carte de crédit?

$this->enabled = false;

} //$check_flag == false

} //($this->enabled == true) && ((int) MODULE_PAYMENT_STRIPEPAY_ZONE > 0)

}

function javascript_validation()

{

return false;

}

function selection()

{

return array(

'id' => $this->code,

'module' => $this->title

);

}

function pre_confirmation_check()

{

return false;

}

function confirmation()

{

global $order, $db;

//Stripe get the test/production state

$publishable_key = ((MODULE_PAYMENT_STRIPEPAY_TESTMODE == 'Test') ? MODULE_PAYMENT_STRIPEPAY_TESTING_PUBLISHABLE_KEY : MODULE_PAYMENT_STRIPEPAY_LIVE_PUBLISHABLE_KEY);

if ($publishable_key == '') {

?>

}

//Stripe - check the stripe-id table for a stripe customer number

$prev_customer = false;

if (table_exists('stripe_data')) {

//this will get the most recent order by this customer only - will ignore previous orders

$check_customer = $db->Execute("select customers_id, stripe_customer, stripe_fingerprint, stripe_last4, stripe_type from stripe_data where customers_id = '" .$_SESSION['customer_id'] . "' order by stripe_id DESC LIMIT 1");

if ($check_customer->RecordCount() > 0 && zen_not_null($check_customer->fields['stripe_customer'])) {

$prev_customer = true;

}

}

?>

##################### displays month name in drop down ###############

for ($i = 1; $i < 13; $i++) {

$expires_month[] = array(

'id' => sprintf('%02d', $i),

'text' => strftime('%m - %B', mktime(0, 0, 0, $i, 1, 2000))

);

}

$today = getdate();

for ($i = $today['year']; $i < $today['year'] + 10; $i++) {

$expires_year[] = array(

'id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)),

'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i))

);

}

##################### displays month name and number in brackets in drop down ###############

##################### displays month number in drop down ###############

/* for ($i=1; $i<13; $i++) {

$expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%m',mktime(0,0,0,$i,1,2000)));

}

$today = getdate();

for ($i = $today['year']; $i < $today['year'] + 10; $i++) {

$expires_year[] = array(

'id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)),

'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i))

);

} */

##################### displays month number in drop down ###############

$confirmation = array();

$confirmation['fields'] = array();

//prev customer

if ($prev_customer == true ) { //previous customer with a stripe id

$confirmation['fields'][] = array(

'title' => '

' .zen_draw_checkbox_field('', 'use_me', $checked = true, 'class="existing_stripe" style="display:inline"'). MODULE_PAYMENT_STRIPEPAY_TEXT_PREV_CUST_CARD . ' ' . $check_customer->fields['stripe_type'] . ' ' . MODULE_PAYMENT_STRIPEPAY_TEXT_PREV_CUST_NUMBER . ' ' . $check_customer->fields['stripe_last4'] . ' ' . MODULE_PAYMENT_STRIPEPAY_TEXT_PREV_CUST_PAY . '' . MODULE_PAYMENT_STRIPEPAY_TEXT_PREV_CUST_UNTICK . ''.'

',

'field' => ''

);

//pass the customer id

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('StripeCustomerID', $check_customer->fields['stripe_customer'])

);

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('StripeToken', 'NONE')

);

}

//cc FIELDS

$confirmation['fields'][] = array(

'title' => '' . MODULE_PAYMENT_STRIPEPAY_CREDIT_CARD_OWNER . '' . zen_draw_input_field('', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'class="card-name card_hide"'),

'field' => ''

);

$confirmation['fields'][] = array(

'title' => '' . MODULE_PAYMENT_STRIPEPAY_CREDIT_CARD_NUMBER . ''. zen_draw_input_field('', '', 'style="display:inline-block; padding-right:10px"'),

'field' => ''

);

$confirmation['fields'][] = array(

'title' => '' . MODULE_PAYMENT_STRIPEPAY_CREDIT_CARD_EXPIRES . ''.zen_draw_pull_down_menu('', $expires_month, '', 'class="card_expiry_month card_hide"') . ' ' . zen_draw_pull_down_menu('', $expires_year, '', 'class="card-expiry-year card_hide"'),

'field' => ''

);

//now for the extra things like CVV

if (MODULE_PAYMENT_STRIPEPAY_CVV == 'True') {

$confirmation['fields'][] = array(

'title' => '' . MODULE_PAYMENT_STRIPEPAY_CREDIT_CARD_CVC . ''.zen_draw_input_field('', '', 'size="5" maxlength="4"'),

'field' => ''

);

} //MODULE_PAYMENT_STRIPEPAY_CVV == 'True'

//AVS

if (MODULE_PAYMENT_STRIPEPAY_AVS == 'True') {

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('', $order->billing['street_address'], 'class="address_line1"')

);

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('', $order->billing['suburb'], 'class="address_line2"')

);

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('', $order->billing['state'], 'class="address_state"')

);

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('', $order->billing['postcode'], 'class="address_zip"')

);

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('', $order->billing['city'], 'class="address_city"')

);

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('', $order->billing['country']['title'], 'class="address_country"')

);

} //MODULE_PAYMENT_STRIPEPAY_AVS == 'True'

//Now add in a 'save my details at Stripe

//is the option to be allowed

if(MODULE_PAYMENT_STRIPEPAY_SAVE_CARD=='True' && MODULE_PAYMENT_STRIPEPAY_CREATE_OBJECT=='True'){

if (MODULE_PAYMENT_STRIPEPAY_SAVE_CARD_CHECK == 'Checked') {

$box_tick = '$checked=true';

} else {

$box_tick = '';

}

$confirmation['fields'][] = array(

'title' => '

'. zen_draw_checkbox_field('', 'save_me', $box_tick, 'class="new_stripe card_hide"').'

',

'field' =>''

);

} else {

//not allowing the opt out - card details will always be saved with customer

$confirmation['fields'][] = array(

'title' => '',

'field' => zen_draw_hidden_field('StripeSaveCard', 'YES')

);

}

?>

$confirmation['title'] = '

';

$confirmation['title'] .= '';

if ($prev_customer == true) { //previous customer with a stripe id

$confirmation['title'] .= ' ';

}

if (MODULE_PAYMENT_STRIPEPAY_TESTMODE == 'Test') {

$confirmation['title'] .= '

Stripe Payments Test Mode

Use test card number 4242424242424242 or see Dépistage

Use any expiry date in the future';

if (MODULE_PAYMENT_STRIPEPAY_CVV == 'True') {

$confirmation['title'] .= '
Use any CVV number
';

} //MODULE_PAYMENT_STRIPEPAY_CVV == 'True'

$confirmation['title'] .= '

';

} //MODULE_PAYMENT_STRIPEPAY_TESTMODE == 'Test'

$confirmation['title'] .= '';

$confirmation['title'] .= '';

$confirmation['title'] .= '';

$confirmation['title'] .= '';

return $confirmation;

}

function process_button()

{

return false;

}

function before_process()

{

global $_POST, $order, $sendto, $currency, $charge,$db, $messageStack;

require_once(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/stripepay/Stripe.php');

//Stripe get the test/production state

$secret_key = ((MODULE_PAYMENT_STRIPEPAY_TESTMODE == 'Test') ? MODULE_PAYMENT_STRIPEPAY_TESTING_SECRET_KEY : MODULE_PAYMENT_STRIPEPAY_MERCHANT_LIVE_SECRET_KEY);

Stripe::setApiKey($secret_key);

$error = '';

// get the crédit card details submitted by the form

$token = $_POST['StripeToken'];

//existing customer

if (zen_not_null($_POST['StripeCustomerID'])) {

if ($token == 'NONE') {

//charge the customer on existing card

essayez {

$charge = Stripe_Charge::create(array(

//"amount" => ($order->info['total']) * 100, // amount in cents

//fimgirl fix for total

"amount" =>floor(($order->info['total']) * 100),

"currency" => MODULE_PAYMENT_STRIPEPAY_CURRENCY,

"customer" => $_POST['StripeCustomerID']

));

}

catch (Exception $e) {

$error = $e->getMessage();

$messageStack->add_session('checkout_confirmation', $error . '', 'error');

zen_redirect(zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL', true, false));

}

} //end use existing card

//start new card

//new card for the customer and he wants to save it (or we are not allowing the option do StripesaveCard==YES

elseif (zen_not_null($_POST['StripeSaveCard']) && ($_POST['StripeSaveCard'] == 'YES')) {

essayez {

//update the card for the customer

$cu = Stripe_Customer::retrieve($_POST['StripeCustomerID']);

$cu->source = $token;

$cu->save();

//charge the customer

$charge = Stripe_Charge::create(array(

//"amount" => ($order->info['total']) * 100, // amount in cents

//fimgirl fix for total

"amount" =>floor(($order->info['total']) * 100),

"currency" => MODULE_PAYMENT_STRIPEPAY_CURRENCY,

"customer" => $_POST['StripeCustomerID']

));

}

catch (Exception $e) {

$error = $e->getMessage();

$messageStack->add_session('checkout_confirmation', $error . '', 'error');

zen_redirect(zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL', true, false));

}

} //end save card

else {

//a saved customer has entered new card details but does NOT want them saved. Currently (Nov 2012) Stripe does not allow you to remove a card object so you'll have to charge the card and not the customer

essayez {

// create the charge on Stripe's servers - this will charge the user's card no customer object

$charge = Stripe_Charge::create(array(

// "amount" => ($order->info['total']) * 100, // amount in cents

//fimgirl fix for total

"amount" =>floor(($order->info['total']) * 100),

"currency" => MODULE_PAYMENT_STRIPEPAY_CURRENCY,

"card" => $token,

"description" => $order->customer['email_address']

));

}

catch (Exception $e) {

$error = $e->getMessage();

$messageStack->add_session('checkout_confirmation', $error . '', 'error');

zen_redirect(zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL', true, false));

}

}

} //end existing customer

//new customer wants to save card details

elseif (zen_not_null($_POST['StripeSaveCard']) && ($_POST['StripeSaveCard'] == 'YES')) {

//new customer create the object

essayez {

// create a Customer

$customer = Stripe_Customer::create(array(

"card" => $token,

"description" => $order->customer['email_address']

));

// charge the Customer instead of the card

$charge = Stripe_Charge::create(array(

// "amount" => ($order->info['total']) * 100, // amount in cents

//fimgirl fix for total

"amount" =>floor(($order->info['total']) * 100),

"currency" => MODULE_PAYMENT_STRIPEPAY_CURRENCY,

"customer" => $customer->id

));

}

catch (Exception $e) {

$error = $e->getMessage();

$messageStack->add_session('checkout_confirmation', $error . '', 'error');

zen_redirect(zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL', true, false));

}

}

// not a customer token

else {

essayez {

// create the charge on Stripe's servers - this will charge the user's card no customer object

$charge = Stripe_Charge::create(array(

// "amount" => ($order->info['total']) * 100, // amount in cents

//fimgirl fix for total

"amount" =>floor(($order->info['total']) * 100),

"currency" => MODULE_PAYMENT_STRIPEPAY_CURRENCY,

"card" => $token,

"description" => $order->customer['email_address']

));

}

catch (Exception $e) {

$error = $e->getMessage();

$messageStack->add_session('checkout_confirmation', $error . '', 'error');

zen_redirect(zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL', true, false));

}

} //end not a customer token

// die ( $charge);

return false;

}

function after_process()

{

global $charge, $insert_id, $db;

//let's update the stripe_id table

if (table_exists('stripe_data')) {

$sql_data_array = array(

'orders_id' => zen_db_prepare_input($insert_id),

'stripe_charge_id' => zen_db_prepare_input($charge->id),

'customers_id' => zen_db_prepare_input($_SESSION['customer_id']),

'stripe_amount' => zen_db_prepare_input($charge->amount),

'stripe_amount_refunded' => zen_db_prepare_input($charge->amount_refunded),

'stripe_currency' => strtoupper(zen_db_prepare_input($charge->currency)),

'stripe_customer' => zen_db_prepare_input($charge->customer),

'stripe_description' => zen_db_prepare_input($charge->description),

'stripe_disputed' => zen_db_prepare_input($charge->disputed),

'stripe_fee' => zen_db_prepare_input($charge->fee),

'stripe_invoice' => zen_db_prepare_input($charge->invoice),

// 'stripe_object' => zen_db_prepare_input($charge->object);

'stripe_paid' => zen_db_prepare_input($charge->paid),

'stripe_address_city' => zen_db_prepare_input($charge->source->address_city),

'stripe_address_country' => zen_db_prepare_input($charge->source->address_country),

'stripe_address_line1' => zen_db_prepare_input($charge->source->address_line1),

'stripe_address_line1_check' => zen_db_prepare_input($charge->source->address_line1_check),

'stripe_address_line2' => zen_db_prepare_input($charge->source->address_line2),

'stripe_address_zip' => zen_db_prepare_input($charge->source->address_zip),

'stripe_address_zip_check' => zen_db_prepare_input($charge->source->address_zip_check),

'stripe_country' => zen_db_prepare_input($charge->source->country),

'stripe_fingerprint' => zen_db_prepare_input($charge->source->fingerprint),

'stripe_cvc_check' => zen_db_prepare_input($charge->source->cvc_check),

'stripe_name' => zen_db_prepare_input($charge->source->name),

'stripe_last4' => zen_db_prepare_input($charge->source->last4),

'stripe_exp_month' => zen_db_prepare_input($charge->source->exp_month),

'stripe_exp_year' => zen_db_prepare_input($charge->source->exp_year),

'stripe_type' => zen_db_prepare_input($charge->source->brand)

);

zen_db_perform('stripe_data', $sql_data_array);

}

//now let's update the orders table

$db->Execute("update " . TABLE_ORDERS . " set

cc_type = '" . zen_db_prepare_input($charge->source->type) . "',

cc_owner='" . zen_db_prepare_input($charge->source->name) . "',

cc_expires='" . zen_db_prepare_input($charge->source->exp_month) . "/" . zen_db_prepare_input($charge->source->exp_year) . "',

cc_number='XXXX-XXXX-XXXX-" . zen_db_prepare_input($charge->source->last4) . "'

orders_id = '" . $insert_id . "' ");

//AVS checking

if (MODULE_PAYMENT_STRIPEPAY_AVS == 'True' && ($charge->source->address_line1_check !== 'pass' || $charge->source->address_zip_check !== 'pass')) {

$error = '';

if ($charge->source->address_line1_check == 'fail') {

$error .= MODULE_PAYMENT_STRIPEPAY_TEXT_AVS_FAILED . '. ';

} //$charge->source->address_line1_check == 'fail'

if ($charge->source->address_zip_check == 'fail') {

$error .= MODULE_PAYMENT_STRIPEPAY_TEXT_ZIP_FAILED . '. ';

} //$charge->source->address_zip_check == 'fail'

if ($charge->source->address_line1_check == 'unchecked') {

$error .= MODULE_PAYMENT_STRIPEPAY_TEXT_AVS_UNCHECKED . '. ';

} //$charge->source->address_line1_check == 'unchecked'

if ($charge->source->address_zip_check == 'unchecked') {

$error .= MODULE_PAYMENT_STRIPEPAY_TEXT_ZIP_UNCHECKED;

} //$charge->source->address_zip_check == 'unchecked'

$sql_data_array2 = array(

'orders_status' => MODULE_PAYMENT_STRIPEPAY_AVS_FAILED

);

zen_db_perform(TABLE_ORDERS, $sql_data_array2, "update", "orders_id='" . $insert_id . "'");

//// also change status in order history

$sql_data_array3 = array(

'orders_id' => $insert_id,

'orders_status_id' => MODULE_PAYMENT_STRIPEPAY_AVS_FAILED,

'date_added' => 'now()',

'customer_notified' => 0,

'comments' => $error

);

zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array3);

} //MODULE_PAYMENT_STRIPEPAY_AVS == 'True' && ($charge->source->address_line1_check !== 'pass' || $charge->source->address_zip_check !== 'pass')

//CVV checking

if (MODULE_PAYMENT_STRIPEPAY_CVV == 'True' && $charge->source->cvc_check !== 'pass') {

$cvv_error = '';

if ($charge->source->cvc_check == 'fail') {

$cvv_error .= MODULE_PAYMENT_STRIPEPAY_TEXT_CVV_FAILED . '. ';

} //$charge->source->cvc_check == 'fail'

elseif ($charge->source->cvc_check == 'unchecked') {

$cvv_error .= MODULE_PAYMENT_STRIPEPAY_TEXT_CVV_UNCHECKED . '. ';

} //$charge->source->cvc_check == 'unchecked'

$sql_data_array4 = array(

'orders_status' => MODULE_PAYMENT_STRIPEPAY_CVV_FAILED

);

zen_db_perform(TABLE_ORDERS, $sql_data_array4, "update", "orders_id='" . $insert_id . "'");

//// also change status in order history

$sql_data_array5 = array(

'orders_id' => $insert_id,

'orders_status_id' => MODULE_PAYMENT_STRIPEPAY_CVV_FAILED,

'date_added' => 'now()',

'customer_notified' => 0,

'comments' => $cvv_error

);

zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array5);

} //MODULE_PAYMENT_STRIPEPAY_CVV == 'True' && $charge->source->cvc_check !== 'pass'

return false;

}

function get_error()

{

global $_GET;

$error = array(

'title' => MODULE_PAYMENT_STRIPEPAY_ERROR_TITLE,

'error' => stripslashes($_GET['error'])

);

return $error;

}

function check()

{

global $db;

if (!isset($this->_check)) {

$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_STRIPEPAY_STATUS'");

$this->_check = $check_query->RecordCount();

}

return $this->_check;

}

function install()

{

global $db, $messageStack;

if (defined('MODULE_PAYMENT_STRIPEPAY_STATUS')) {

$messageStack->add_session('Stripe Payment module already installed.', 'error');

zen_redirect(zen_href_link(FILENAME_MODULES, 'set=Paiement&module=stripepay', 'NONSSL'));

return 'failed';

}

//send cheeky cURL to Blue Toucan

cheeky_curl('installed');

//

// OK lets add in a new order statuses Stripe - failures

$check_query = $db->Execute("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Stripe - CVV Failure' limit 1");

if ($check_query->RecordCount() < 1) {

$status = $db->Execute("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS);

$status_id = $status->fields['status_id'] + 1;

$languages = zen_get_languages();

foreach ($languages as $lang) {

$db->Execute("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Stripe - CVV Failure')");

} //$languages as $lang

} Else {

$status_id = $check_query->fields['orders_status_id'];

}

$check_query2 = $db->Execute("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Stripe - AVS Failure' limit 1");

if ($check_query2->RecordCount() < 1) {

$status2 = $db->Execute("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS);

$status_id2 = $status2->fields['status_id'] + 1;

$languages = zen_get_languages();

foreach ($languages as $lang) {

$db->Execute("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id2 . "', '" . $lang['id'] . "', 'Stripe - AVS Failure')");

} //$languages as $lang

} Else {

$status_id2 = $check_query2->fields['orders_status_id'];

}

//Now for 'unchecked

// OK lets add in a new order statuses Stripe - failures

$check_query3 = $db->Execute("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Stripe - CVV unchecked' limit 1");

if ($check_query3->RecordCount() < 1) {

$status3 = $db->Execute("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS);

$status_id3 = $status3->fields['status_id'] + 1;

$languages = zen_get_languages();

foreach ($languages as $lang) {

$db->Execute("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id3 . "', '" . $lang['id'] . "', 'Stripe - CVV unchecked')");

} //$languages as $lang

} Else {

$status_id3 = $check_query3->fields['orders_status_id'];

}

$check_query4 = $db->Execute("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Stripe - AVS unchecked' limit 1");

if ($check_query4->RecordCount() < 1) {

$status4 = $db->Execute("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS);

$status_id4 = $status4->fields['status_id'] + 1;

$languages = zen_get_languages();

foreach ($languages as $lang) {

$db->Execute("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id4 . "', '" . $lang['id'] . "', 'Stripe - AVS unchecked')");

} //$languages as $lang

} Else {

$status_id4 = $check_query4->fields['orders_status_id'];

}

$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Stripe Payments', 'MODULE_PAYMENT_STRIPEPAY_STATUS', 'True', 'Do you want to accept Stripe payments?', '6', '10', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");

$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_STRIPEPAY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '20', 'zen_get_z

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.