<?php
class niumustripeemb {
var $code, $title, $description, $enabled;
function niumustripeemb() {
global $order;
$this->code = 'niumustripeemb';
$this->title = 'Niumu - Stripeemb';
$this->description = '<strong>Niumu - stripe Emb</strong>';
$this->sort_order = MODULE_PAYMENT_NIUMU_STRIPE_EMB_SORT_ORDER;
$this->enabled = ((MODULE_PAYMENT_NIUMU_STRIPE_EMB_STATUS == 'True') ? true : false);
if ((int)MODULE_PAYMENT_NIUMU_STRIPE_EMB_ORDER_STATUS_ID > 0) {
$this->order_status = MODULE_PAYMENT_NIUMU_STRIPE_EMB_ORDER_STATUS_ID;
}
if (is_object($order)) $this->update_status();
}
function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_NIUMU_STRIPE_EMB_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NIUMU_STRIPE_EMB_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->MoveNext();
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
function javascript_validation() {
return false;
}
function isSsl()
{
$server = $_SERVER;
if (isset($server['HTTPS']) && ('1' == $server['HTTPS'] || 'on' == strtolower($server['HTTPS']))) {
return true;
} elseif (isset($server['REQUEST_SCHEME']) && 'https' == $server['REQUEST_SCHEME']) {
return true;
} elseif (isset($server['SERVER_PORT']) && ('443' == $server['SERVER_PORT'])) {
return true;
} elseif (isset($server['HTTP_X_FORWARDED_PROTO']) && 'https' == $server['HTTP_X_FORWARDED_PROTO']) {
return true;
}
return false;
}
function selection() {
//if(MODULE_PAYMENT_NIUMU_PAYPAL_TYPE =='Stripe'){
return array('id' => 'niumustripeemb',
'module' => '<img id="hjhbb" src="includes/modules/payment/niumu/Stripe.png" alt="Checkout with Stripe" title="Checkout with Stripe" />',
'fields' => array(
array(
'title' => 'Credit Card',
'field' => '
<style>
.main{border-radius: 10px; border: 1px solid blue; width: 50%; padding: 5px;}
.cardno{min-width:100px !important; display:block !important;border-radius: 3px !important;min-height: 24px !important;width: 100% !important;height:40px !important; padding-left: 5px !important;padding-right: 5px !important; box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
.cvv{ width: 20% !important; padding: inherit !important; border-radius: 3px !important; min-height: 24px !important; height: 40px !important; float:left !important; text-align:center !important; box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
.expires_month{width:15% !important;padding: inherit !important;text-align: center !important;float:left !important;border-radius: 3px !important;min-height: 24px !important;height:40px !important;box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
.expires_year{width:20% !important;padding: inherit !important; text-align: center !important;float:left !important;border-radius: 3px !important;min-height: 24px !important;height:40px !important; box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
.year_month{ width:20% !important;border: 1px solid #bbbbbb !important;border-radius: 3px !important;min-height: 24px !important;height:42px !important; float:left !important;}
.cvc{margin-bottom:5px !important;float: left !important; width: 15% !important; padding-left: 2% !important;}
@media only screen and (max-width: 700px) {
.cardno{min-width:100px !important; display:block !important;border-radius: 3px !important;min-height: 24px !important;width: 100% !important;height:40px !important; padding-left: 5px !important;padding-right: 5px !important; box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
.year_month{ width:45% !important;border: 1px solid #bbbbbb !important;border-radius: 3px !important;min-height: 24px !important;height:42px !important; float:left !important;}
.cvc{margin-bottom:5px !important;float: left !important; width: 30% !important; padding-left: 2% !important;}
.cvv{ width: 30% !important; padding: inherit !important; border-radius: 3px !important; min-height: 24px !important; height: 40px !important; float:left !important; text-align:center !important; box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
.expires_month{width:20% !important;padding: inherit !important;text-align: center !important;float:left !important;border-radius: 3px !important;min-height: 24px !important;height:40px !important;box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
.expires_year{width:25% !important;padding: inherit !important; text-align: center !important;float:left !important;border-radius: 3px !important;min-height: 24px !important;height:40px !important; box-shadow: rgb(0 0 0 / 3%) 0px 1px 1px 0px, rgb(0 0 0 / 2%) 0px 3px 6px 0px, 0 0 0 1000px rgb(255 255 255) inset !important;}
}
</style>
<div class="main">
<div style="margin-bottom:5px;margin-top:5px;">
<input type="text" maxlength="19" onkeypress="this.value=this.value.replace(/(\d{4})(?=\d)/g,\'$1 \');" onkeyup ="document.getElementById(\'cardNo\').value=this.value;" class="form-control valid cardno" id="yhp-cc-number" autocomplete="off" placeholder="Card number">
<input type="hidden" name="cardNo" id="cardNo" value="">
</div>
<div style="width:100%">
<select name="expires_month" class="form-control valid expires_month" id="yhp-cc-expires_month" autocomplete="off"><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select>
<div style="float:left; height: 40px; line-height: 40px; padding-left: 5px; padding-right: 5px;">/</div>
<select name="expires_year" class="form-control valid expires_year" id="yhp-cc-expires_year" autocomplete="off">'.$this->getyear().'
</select>
评论5