Version Notes
- changed text in system
Download this release
Release Info
| Developer | Nachshon Fishbane |
| Extension | bluesnap_payment |
| Version | 2.0.3.2 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.2.5 to 2.0.3.2
- app/code/community/Bluesnap/Payment/Block/Adminhtml/Sales/Order/Grid.php +2 -11
- app/code/community/Bluesnap/Payment/Block/Payment/Form/Cse.php +26 -1
- app/code/community/Bluesnap/Payment/Helper/Data.php +1 -1
- app/code/community/Bluesnap/Payment/Model/Api/Cse.php +116 -145
- app/code/community/Bluesnap/Payment/Model/Api/Logger.php +2 -2
- app/code/community/Bluesnap/Payment/Model/Api/Refund.php +4 -3
- app/code/community/Bluesnap/Payment/Model/Api/Saved.php +51 -11
- app/code/community/Bluesnap/Payment/Model/Directory/Currency/Import.php +1 -1
- app/code/community/Bluesnap/Payment/Model/Logger/Db.php +19 -5
- app/code/community/Bluesnap/Payment/Model/Observer.php +20 -88
- app/code/community/Bluesnap/Payment/Model/Payment/Cse.php +19 -14
- app/code/community/Bluesnap/Payment/Model/Sales/Order/Payment.php +2 -2
- app/code/community/Bluesnap/Payment/Model/Sslvalidation.php +132 -0
- app/code/community/Bluesnap/Payment/etc/config.xml +3 -10
- app/code/community/Bluesnap/Payment/etc/system.xml +24 -3
- app/code/community/Bluesnap/Payment/sql/bluesnap_setup/mysql4-upgrade-1.0.2-1.0.3.php +2 -2
- app/code/community/Bluesnap/Payment/sql/bluesnap_setup/mysql4-upgrade-1.0.3-1.0.4.php +13 -13
- app/design/frontend/base/default/layout/bluesnap/payment.xml +38 -37
- app/design/frontend/base/default/template/bluesnap/payment/form/cse.phtml +220 -107
- js/bluesnap/credit-card-detect.js +229 -0
- js/bluesnap/payform.js +683 -0
- js/lib/jquery/bluesnap-noconflict.js +1 -0
- js/lib/jquery/jquery-3.0.0.min.js +4 -0
- package.xml +5 -5
- skin/frontend/base/default/js/bluesnap/credit-card-detect.js +73 -0
- skin/frontend/base/default/js/bluesnap/payform.js +36 -27
app/code/community/Bluesnap/Payment/Block/Adminhtml/Sales/Order/Grid.php
CHANGED
|
@@ -30,18 +30,9 @@ class Bluesnap_Payment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_B
|
|
| 30 |
{
|
| 31 |
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
| 32 |
|
| 33 |
-
//billing name, shipping name
|
| 34 |
-
// $adapter = $this->getReadConnection();
|
| 35 |
-
//$ifnullFirst = $adapter->getIfNullSql('{{table}}.firstname', $adapter->quote(''));
|
| 36 |
-
//$ifnullLast = $adapter->getIfNullSql('{{table}}.lastname', $adapter->quote(''));
|
| 37 |
-
|
| 38 |
-
//$concatAddress = $adapter->getConcatSql(array($ifnullFirst, $adapter->quote(' '), $ifnullLast));
|
| 39 |
-
$collection->getSelect()->columns(array('billing_name' => "CONCAT(customer_firstname,' ',customer_lastname)"));
|
| 40 |
-
$collection->getSelect()->columns(array('shipping_name' => "CONCAT(customer_firstname,' ',customer_lastname)"));
|
| 41 |
$collection->getSelect()->columns(array('payment_method' => new Zend_Db_Expr("(SELECT method FROM sales_flat_order_payment WHERE parent_id=main_table.entity_id)")));
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
// die();
|
| 45 |
|
| 46 |
$this->setCollection($collection);
|
| 47 |
|
| 30 |
{
|
| 31 |
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
$collection->getSelect()->columns(array('payment_method' => new Zend_Db_Expr("(SELECT method FROM sales_flat_order_payment WHERE parent_id=main_table.entity_id)")));
|
| 34 |
+
$collection->getSelect()->columns(array('shipping_name' => new Zend_Db_Expr("(SELECT CONCAT(firstname,' ',lastname) FROM sales_flat_order_address WHERE parent_id=main_table.entity_id AND address_type='shipping')")));
|
| 35 |
+
$collection->getSelect()->columns(array('billing_name' => new Zend_Db_Expr("(SELECT CONCAT(firstname,' ',lastname) FROM sales_flat_order_address WHERE parent_id=main_table.entity_id AND address_type='billing')")));
|
|
|
|
| 36 |
|
| 37 |
$this->setCollection($collection);
|
| 38 |
|
app/code/community/Bluesnap/Payment/Block/Payment/Form/Cse.php
CHANGED
|
@@ -65,8 +65,33 @@ class Bluesnap_Payment_Block_Payment_Form_Cse extends Mage_Payment_Block_Form_Cc
|
|
| 65 |
*/
|
| 66 |
protected function _toHtml()
|
| 67 |
{
|
| 68 |
-
|
| 69 |
$this->setChild('method_form_block', $this->getMethodFormBlock());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
return parent::_toHtml();
|
| 71 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 65 |
*/
|
| 66 |
protected function _toHtml()
|
| 67 |
{
|
| 68 |
+
$this->setChild('cards', $this->getCardsBlock());
|
| 69 |
$this->setChild('method_form_block', $this->getMethodFormBlock());
|
| 70 |
+
if( $this->getLayout()->getBlock('head')){
|
| 71 |
+
$this->getLayout()->getBlock('head')->addLinkRel('text/javascript','https://gateway.bluesnap.com/js/cse/v1.0.2/bluesnap.js');
|
| 72 |
+
$this->getLayout()->getBlock('head')->addItem('js','bluesnap/credit-card-detect.js');
|
| 73 |
+
$this->getLayout()->getBlock('head')->addItem('js','bluesnap/payform.js');
|
| 74 |
+
$this->getLayout()->getBlock('head')->addItem('js','bluesnap/bsadmin.js');
|
| 75 |
+
$this->getLayout()->getBlock('head')->addItem('js','lib/jquery/jquery-ui/jquery-ui.js');
|
| 76 |
+
$this->getLayout()->getBlock('head')->addItem('js','lib/jquery/jquery-ui/jquery-ui.js');
|
| 77 |
+
$this->getLayout()->getBlock('head')->addItem('skin_css', 'css/bluesnap/buynow/checkout.css');
|
| 78 |
+
$this->getLayout()->getBlock('head')->addItem('js_css', 'lib/jquery/jquery-ui/jquery-ui.css');
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
return parent::_toHtml();
|
| 82 |
}
|
| 83 |
+
|
| 84 |
+
protected function _prepareLayout()
|
| 85 |
+
{
|
| 86 |
+
//$this->getLayout()->getBlock('head')->addLinkRel('text/javascript','https://gateway.bluesnap.com/js/cse/v1.0.2/bluesnap.js');
|
| 87 |
+
//$this->getLayout()->getBlock('head')->addItem('js','bluesnap/credit-card-detect.js');
|
| 88 |
+
//$this->getLayout()->getBlock('head')->addItem('js','bluesnap/payform.js');
|
| 89 |
+
//$this->getLayout()->getBlock('head')->addItem('js','bluesnap/bsadmin.js');
|
| 90 |
+
//$this->getLayout()->getBlock('head')->addItem('js','lib/jquery/jquery-ui/jquery-ui.js');
|
| 91 |
+
//$this->getLayout()->getBlock('head')->addItem('js','lib/jquery/jquery-ui/jquery-ui.js');
|
| 92 |
+
//$this->getLayout()->getBlock('head')->addItem('skin_css', 'css/bluesnap/buynow/checkout.css');
|
| 93 |
+
//$this->getLayout()->getBlock('head')->addItem('js_css', 'lib/jquery/jquery-ui/jquery-ui.css');
|
| 94 |
+
return parent::_prepareLayout();
|
| 95 |
+
|
| 96 |
+
}
|
| 97 |
}
|
app/code/community/Bluesnap/Payment/Helper/Data.php
CHANGED
|
@@ -103,7 +103,7 @@ class Bluesnap_Payment_Helper_Data extends Bluesnap_Payment_Helper_Config
|
|
| 103 |
$message = "ECP details couldn't be verified";
|
| 104 |
break;
|
| 105 |
default:
|
| 106 |
-
$message = '
|
| 107 |
}
|
| 108 |
|
| 109 |
return $message;
|
| 103 |
$message = "ECP details couldn't be verified";
|
| 104 |
break;
|
| 105 |
default:
|
| 106 |
+
$message = 'Unfortunately an error has occurred and your payment cannot be processed at this time, please verify your payment details or try again later. If the problem persists, please contact our support team';
|
| 107 |
}
|
| 108 |
|
| 109 |
return $message;
|
app/code/community/Bluesnap/Payment/Model/Api/Cse.php
CHANGED
|
@@ -88,30 +88,19 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 88 |
if ($paymentaction != 'authorize_capture') {
|
| 89 |
//Auth minimal amount
|
| 90 |
if ($bsShopperId) {
|
| 91 |
-
|
| 92 |
//Here we Check if order is comming from admin or frontend
|
| 93 |
$order = $payment->getOrder();
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
$api = Mage::getModel('bluesnap/api_saved');
|
| 97 |
-
$response = $api->createAuthOrder($payment, $bsShopperId);
|
| 98 |
-
|
| 99 |
-
} else {
|
| 100 |
-
//admin order
|
| 101 |
-
$api = Mage::getModel('bluesnap/api_saved');
|
| 102 |
-
$response = $api->createAuthOrder($payment, $bsShopperId);
|
| 103 |
-
}
|
| 104 |
-
|
| 105 |
} else {
|
| 106 |
// new customer
|
| 107 |
$response = $this->placeAuthOrder($payment);
|
| 108 |
-
|
| 109 |
}
|
| 110 |
|
| 111 |
} else {
|
| 112 |
//Here we Check if order is comming from admin or frontend
|
| 113 |
$order = $payment->getOrder();
|
| 114 |
-
if (
|
| 115 |
//frontend order
|
| 116 |
if ($bsShopperId) {
|
| 117 |
// returning shopper
|
|
@@ -171,15 +160,13 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 171 |
$price = 1;
|
| 172 |
$currencyApi = Mage::getModel('bluesnap/api_currency');
|
| 173 |
$currResponse = $currencyApi->convert('USD', $baseCurrencyCode, $price);
|
| 174 |
-
// $sum['amount'] = Mage::helper('directory')->currencyConvert($price, 'USD',$baseCurrencyCode);
|
| 175 |
$sum['amount'] = $currResponse;
|
| 176 |
} else $sum['amount'] = 1;
|
| 177 |
|
| 178 |
-
|
| 179 |
$data = array(
|
| 180 |
'web-info' => array(
|
| 181 |
-
'ip' =>
|
| 182 |
-
'remote-host' =>
|
| 183 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 184 |
),
|
| 185 |
'shopper-details' => array(
|
|
@@ -189,13 +176,8 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 189 |
'first-name' => $billing->getFirstname(),
|
| 190 |
'last-name' => $billing->getLastname(),
|
| 191 |
'email' => $order->getCustomerEmail(),
|
| 192 |
-
// 'address1' => $billing->getStreet(1),
|
| 193 |
-
// 'address2' => $billing->getStreet(2),
|
| 194 |
-
// 'city' => $billing->getCity(),
|
| 195 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 196 |
'country' => strtoupper($billing->getCountry()),
|
| 197 |
-
// 'phone' => $billing->getTelephone(),
|
| 198 |
-
// 'zip' => $billing->getPostcode(),
|
| 199 |
),
|
| 200 |
'shopper-currency' => $sum['currency'],
|
| 201 |
'payment-info' => array(
|
|
@@ -204,19 +186,15 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 204 |
'billing-contact-info' => array(
|
| 205 |
'first-name' => $billing->getFirstname(),
|
| 206 |
'last-name' => $billing->getLastname(),
|
| 207 |
-
// 'address1' => $billing->getStreet(1),
|
| 208 |
-
// 'address2' => $billing->getStreet(2),
|
| 209 |
-
// 'city' => $billing->getCity(),
|
| 210 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 211 |
'country' => strtoupper($billing->getCountry()),
|
| 212 |
-
// 'zip' => $billing->getPostcode(),
|
| 213 |
),
|
| 214 |
'credit-card' => array(
|
| 215 |
-
'encrypted-card-number' =>
|
| 216 |
-
'card-type' => (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : ''),
|
| 217 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 218 |
'expiration-year' => $payment->getCcExpYear(),
|
| 219 |
-
'encrypted-security-code' =>
|
| 220 |
),
|
| 221 |
),
|
| 222 |
),
|
|
@@ -233,8 +211,8 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 233 |
'ordering-shopper' => array(
|
| 234 |
'seller-shopper-id' => '',
|
| 235 |
'web-info' => array(
|
| 236 |
-
'ip' =>
|
| 237 |
-
'remote-host' =>
|
| 238 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 239 |
),
|
| 240 |
),
|
|
@@ -263,11 +241,11 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 263 |
),
|
| 264 |
),
|
| 265 |
);
|
| 266 |
-
|
| 267 |
$xml = new SimpleXMLElement('<shopping-context xmlns="' . $this->_getXmlNs() . '"/>');
|
| 268 |
$request = Mage::helper('bluesnap')->arrayToXml($data, $xml)->asXML();
|
| 269 |
|
| 270 |
-
//
|
| 271 |
$logData = $data;
|
| 272 |
$logData['shopper-details']['shopper']['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-card-number'] = '****';
|
| 273 |
$logData['shopper-details']['shopper']['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-security-code'] = '****';
|
|
@@ -279,17 +257,9 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 279 |
// send request
|
| 280 |
$url = $this->getServiceUrl('shopping-context');
|
| 281 |
$response = $this->_request($url, $request, 0, false, true);
|
| 282 |
-
|
| 283 |
-
//hide sensitive data
|
| 284 |
-
// $this->_requestXml=$logRequestXml;
|
| 285 |
-
//$requestUrl = $logResponse->order->{'post-sale-info'}->invoices->invoice->url;
|
| 286 |
$responseArr = $this->parseHeaders($response);
|
| 287 |
-
|
| 288 |
-
// $logResponse->shopper->{'shopper-info'}->password = '****';
|
| 289 |
-
|
| 290 |
-
// $this->_responseXml=$logResponse->asXml();
|
| 291 |
-
|
| 292 |
-
|
| 293 |
try {
|
| 294 |
// $response = $this->parseCreateResponse($response, null, $order);
|
| 295 |
} catch (Exception $e) {
|
|
@@ -353,17 +323,46 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 353 |
}
|
| 354 |
|
| 355 |
// if card was not used before — save card for shopper
|
| 356 |
-
|
| 357 |
-
//BSNPMG-108
|
| 358 |
if ($payment->getCcNumber()) {
|
| 359 |
-
$this->addCardToShopper($payment, $total, $bsShopperId);
|
| 360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
} else { //BSNPMG-34 no need to update shopper call when new card added
|
| 362 |
|
| 363 |
$this->updateShopper($payment, $total, $bsShopperId);
|
| 364 |
-
|
| 365 |
}
|
| 366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
|
| 368 |
$data = array(
|
| 369 |
'ordering-shopper' => array(
|
|
@@ -372,11 +371,11 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 372 |
'shopper-id' => $bsShopperId,
|
| 373 |
'credit-card' => array(
|
| 374 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 375 |
-
'card-type' =>
|
| 376 |
),
|
| 377 |
'web-info' => array(
|
| 378 |
-
'ip' =>
|
| 379 |
-
'remote-host' =>
|
| 380 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 381 |
),
|
| 382 |
'fraud-info' => array(
|
|
@@ -421,16 +420,12 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 421 |
// send request
|
| 422 |
$url = $this->getServiceUrl('orders');
|
| 423 |
$responseXml = $this->_request($url, $request);
|
| 424 |
-
|
| 425 |
-
|
| 426 |
$response = $this->_parseXmlResponse($responseXml);
|
| 427 |
|
| 428 |
try {
|
| 429 |
|
| 430 |
-
$response = $this->parseCreateResponse($response, $bsShopperId, $order);
|
| 431 |
} catch (Exception $e) {
|
| 432 |
-
//Mage::logException($e);
|
| 433 |
-
//throw $e;
|
| 434 |
throw new Bluesnap_Payment_Model_Api_Exception(Mage::helper('core')->__('Something went wrong during placing your order. Please contact support.'));
|
| 435 |
}
|
| 436 |
|
|
@@ -460,7 +455,7 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 460 |
|
| 461 |
$data = array(
|
| 462 |
'web-info' => array(
|
| 463 |
-
'ip' =>
|
| 464 |
),
|
| 465 |
//BSNPMG-163 - fraud support
|
| 466 |
//http://docs.bluesnap.com/api/services/shoppers/create-shopper
|
|
@@ -478,21 +473,14 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 478 |
'billing-contact-info' => array(
|
| 479 |
'first-name' => $billing->getFirstname(),
|
| 480 |
'last-name' => $billing->getLastname(),
|
| 481 |
-
//BSNPMG-106
|
| 482 |
-
// 'company-name' => $billing->getCompany(),
|
| 483 |
-
// 'address1' => $billing->getStreet(1),
|
| 484 |
-
// 'address2' => $billing->getStreet(2),
|
| 485 |
-
// 'city' => $billing->getCity(),
|
| 486 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 487 |
-
// 'zip' => $billing->getPostcode(),
|
| 488 |
'country' => strtoupper($billing->getCountry()),
|
| 489 |
),
|
| 490 |
'credit-card' => array(
|
| 491 |
-
'encrypted-card-number' =>
|
| 492 |
-
'card-type' => (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : ''),
|
| 493 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 494 |
'expiration-year' => $payment->getCcExpYear(),
|
| 495 |
-
'encrypted-security-code' =>
|
| 496 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 497 |
),
|
| 498 |
),
|
|
@@ -505,12 +493,13 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 505 |
|
| 506 |
$url = $this->getServiceUrl('shoppers/' . $bsShopperId);
|
| 507 |
$responseXml = $this->_request($url, $requestXml, self::HTTP_METHOD_PUT);
|
|
|
|
| 508 |
//http://docs.bluesnap.com/api/services/shoppers/update-shopper
|
| 509 |
//If successful, the response HTTP status code is 204 No Content.
|
| 510 |
//Otherwise, Errors will be returned in a messages resource.
|
| 511 |
//@todo: verify response code (204 for update shopper)
|
| 512 |
|
| 513 |
-
//
|
| 514 |
$logData = $data;
|
| 515 |
$logData['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-card-number'] = '****';
|
| 516 |
$logData['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-security-code'] = '****';
|
|
@@ -527,20 +516,27 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 527 |
Mage::logException($e);
|
| 528 |
|
| 529 |
Mage::throwException(mage::helper('bluesnap')->__('Can not authorize your card'));
|
| 530 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 531 |
}
|
| 532 |
|
| 533 |
//need to unset the value in session for new card to be avaialable
|
| 534 |
$this->getSession()->unsetData('bs_shopper');
|
| 535 |
-
|
|
|
|
|
|
|
|
|
|
| 536 |
// and save it again in the session
|
| 537 |
-
$this->retrieveShopper($bsShopperId);
|
| 538 |
|
| 539 |
// unregister cards from registery
|
| 540 |
Mage::unregister('bs_shopper_cards');
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
$this->getLogger()->logSuccess($logRequestXml, $this->_responseXml, 0, "addCardToShopper success", "addCardToShopper", $order->getIncrementId(), $url);
|
| 544 |
|
| 545 |
}
|
| 546 |
|
|
@@ -551,12 +547,11 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 551 |
* @return Varien_Simplexml_Element
|
| 552 |
* @throws Mage_Core_Exception
|
| 553 |
*/
|
| 554 |
-
public function retrieveShopper($bsShopperId)
|
| 555 |
{
|
| 556 |
-
|
| 557 |
-
//if (!Mage::registry('bs_shopper')) {
|
| 558 |
|
| 559 |
-
if (!$this->getSession()->getData('bs_shopper')) {
|
| 560 |
|
| 561 |
// send request
|
| 562 |
$url = $this->getServiceUrl('shoppers/' . $bsShopperId);
|
|
@@ -587,7 +582,6 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 587 |
$responseXml = $this->getSession()->getData('bs_shopper');
|
| 588 |
$response = $this->_parseXmlResponse($responseXml);
|
| 589 |
|
| 590 |
-
//return Mage::registry('bs_shopper');
|
| 591 |
return $response;
|
| 592 |
}
|
| 593 |
|
|
@@ -616,9 +610,9 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 616 |
|
| 617 |
$data = array(
|
| 618 |
'web-info' => array(
|
| 619 |
-
'ip' =>
|
| 620 |
),
|
| 621 |
-
|
| 622 |
//http://docs.bluesnap.com/api/services/shoppers/create-shopper
|
| 623 |
'fraud-info' => array(
|
| 624 |
'fraud-session-id' => Mage::getSingleton('checkout/session')->getSessionId(),
|
|
@@ -627,20 +621,12 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 627 |
'store-id' => Mage::helper('bluesnap')->getBluesnapStoreId(),
|
| 628 |
'shopper-currency' => $sum['currency'],
|
| 629 |
'charged-currency' => $sum['currency'],
|
| 630 |
-
////BSNPMG-106
|
| 631 |
'shopper-contact-info' => array(
|
| 632 |
'first-name' => $billing->getFirstname(),
|
| 633 |
'last-name' => $billing->getLastname(),
|
| 634 |
'email' => $order->getCustomerEmail(),
|
| 635 |
-
// 'company-name' => $billing->getCompany(),
|
| 636 |
-
// 'address1' => $billing->getStreet(1),
|
| 637 |
-
// 'address2' => $billing->getStreet(2),
|
| 638 |
-
// 'city' => $billing->getCity(),
|
| 639 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 640 |
-
// 'zip' => $billing->getPostcode(),
|
| 641 |
'country' => strtoupper($billing->getCountry()),
|
| 642 |
-
// 'phone' => $billing->getTelephone(),
|
| 643 |
-
// 'fax' => $billing->getFax(),
|
| 644 |
),
|
| 645 |
'payment-info' => array(
|
| 646 |
'credit-cards-info' => array(
|
|
@@ -648,20 +634,14 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 648 |
'billing-contact-info' => array(
|
| 649 |
'first-name' => $billing->getFirstname(),
|
| 650 |
'last-name' => $billing->getLastname(),
|
| 651 |
-
// 'company-name' => $billing->getCompany(),
|
| 652 |
-
// 'address1' => $billing->getStreet(1),
|
| 653 |
-
// 'address2' => $billing->getStreet(2),
|
| 654 |
-
// 'city' => $billing->getCity(),
|
| 655 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 656 |
-
// 'zip' => $billing->getPostcode(),
|
| 657 |
'country' => strtoupper($billing->getCountry()),
|
| 658 |
),
|
| 659 |
'credit-card' => array(
|
| 660 |
-
'encrypted-card-number' =>
|
| 661 |
-
'card-type' => (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : ''),
|
| 662 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 663 |
'expiration-year' => $payment->getCcExpYear(),
|
| 664 |
-
'encrypted-security-code' =>
|
| 665 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 666 |
),
|
| 667 |
),
|
|
@@ -701,7 +681,7 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 701 |
* @return array
|
| 702 |
* @throws Mage_Core_Exception
|
| 703 |
*/
|
| 704 |
-
protected function parseCreateResponse($responseXml, $bsShopperId = null, $order = null)
|
| 705 |
{
|
| 706 |
$result = array('shopperId' => null, 'invoiceId' => null);
|
| 707 |
// $error = Mage::helper('bluesnap')->__('Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time');
|
|
@@ -709,9 +689,10 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 709 |
if ($responseXml->message) {
|
| 710 |
// $error = Mage::helper('bluesnap')->__('Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time');
|
| 711 |
$error = (string)$responseXml->message->description;
|
|
|
|
| 712 |
$e = new Bluesnap_Payment_Model_Api_Exception($error, (int)$responseXml->message->code);
|
| 713 |
Mage::logException($e);
|
| 714 |
-
$this->getLogger()->logError($this->_requestXml, $this->_responseXml, (int)$responseXml->message->code, $error, "createOrder", $order->getIncrementId());
|
| 715 |
|
| 716 |
throw $e;
|
| 717 |
|
|
@@ -752,7 +733,7 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 752 |
{
|
| 753 |
$order = $payment->getOrder();
|
| 754 |
$billing = $order->getBillingAddress();
|
| 755 |
-
|
| 756 |
if (!Mage::helper('bluesnap')->isStateSupported($billing->getRegionCode())) {
|
| 757 |
throw new Bluesnap_Payment_Model_Api_Exception(Mage::helper('core')->__('State is not supported'));
|
| 758 |
}
|
|
@@ -767,15 +748,15 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 767 |
}
|
| 768 |
|
| 769 |
//http://docs.bluesnap.com/api/services/orders/batch-create-shopper-and-order
|
| 770 |
-
|
| 771 |
$data = array(
|
| 772 |
'shopper' => array(
|
| 773 |
'web-info' => array(
|
| 774 |
-
'ip' =>
|
| 775 |
),
|
| 776 |
//BSNPMG-163 - fraud support
|
| 777 |
//http://docs.bluesnap.com/api/services/shoppers/create-shopper
|
| 778 |
-
|
| 779 |
'shopper-info' => array(
|
| 780 |
'store-id' => Mage::helper('bluesnap')->getBluesnapStoreId(),
|
| 781 |
'shopper-currency' => $sum['currency'],
|
|
@@ -786,15 +767,9 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 786 |
'first-name' => $billing->getFirstname(),
|
| 787 |
'last-name' => $billing->getLastname(),
|
| 788 |
'email' => $order->getCustomerEmail(),
|
| 789 |
-
|
| 790 |
-
// 'address1' => $billing->getStreet(1),
|
| 791 |
-
// 'address2' => $billing->getStreet(2),
|
| 792 |
-
// 'city' => $billing->getCity(),
|
| 793 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 794 |
-
// 'zip' => $billing->getPostcode(),
|
| 795 |
'country' => strtoupper($billing->getCountry()),
|
| 796 |
-
// 'phone' => $billing->getTelephone(),
|
| 797 |
-
// 'fax' => $billing->getFax(),
|
| 798 |
),
|
| 799 |
'payment-info' => array(
|
| 800 |
'credit-cards-info' => array(
|
|
@@ -802,20 +777,14 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 802 |
'billing-contact-info' => array(
|
| 803 |
'first-name' => $billing->getFirstname(),
|
| 804 |
'last-name' => $billing->getLastname(),
|
| 805 |
-
// 'company-name' => $billing->getCompany(),
|
| 806 |
-
// 'address1' => $billing->getStreet(1),
|
| 807 |
-
// 'address2' => $billing->getStreet(2),
|
| 808 |
-
// 'city' => $billing->getCity(),
|
| 809 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 810 |
-
// 'zip' => $billing->getPostcode(),
|
| 811 |
'country' => strtoupper($billing->getCountry()),
|
| 812 |
),
|
| 813 |
'credit-card' => array(
|
| 814 |
-
'encrypted-card-number' =>
|
| 815 |
-
'card-type' => (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : ''),
|
| 816 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 817 |
'expiration-year' => $payment->getCcExpYear(),
|
| 818 |
-
'encrypted-security-code' =>
|
| 819 |
),
|
| 820 |
),
|
| 821 |
)
|
|
@@ -826,8 +795,8 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 826 |
'ordering-shopper' => array(
|
| 827 |
'seller-shopper-id' => '',
|
| 828 |
'web-info' => array(
|
| 829 |
-
'ip' =>
|
| 830 |
-
'remote-host' =>
|
| 831 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 832 |
),
|
| 833 |
'fraud-info' => array(
|
|
@@ -847,7 +816,6 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 847 |
'soft-descriptor' => $order->getIncrementId(),
|
| 848 |
'description' => $order->getIncrementId(),
|
| 849 |
'title' => $order->getIncrementId(),
|
| 850 |
-
//BSNPMG-78
|
| 851 |
'sku-name' => 'Order #' . $order->getIncrementId(),
|
| 852 |
),
|
| 853 |
'quantity' => '1',
|
|
@@ -864,9 +832,10 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 864 |
),
|
| 865 |
),
|
| 866 |
);
|
|
|
|
| 867 |
$xml = new SimpleXMLElement('<batch-order xmlns="' . $this->_getXmlNs() . '"/>');
|
| 868 |
$request = Mage::helper('bluesnap')->arrayToXml($data, $xml)->asXML();
|
| 869 |
-
|
| 870 |
//BSNPMG-86 - remove sensitive data from logs
|
| 871 |
$logData = $data;
|
| 872 |
$logData['shopper']['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-card-number'] = '****';
|
|
@@ -880,15 +849,14 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 880 |
$url = $this->getServiceUrl('batch/order-placement');
|
| 881 |
|
| 882 |
$responseXml = $this->_request($url, $request);
|
| 883 |
-
|
| 884 |
$response = $this->_parseXmlResponse($responseXml);
|
| 885 |
-
|
|
|
|
| 886 |
//hide sensitive data
|
| 887 |
$this->_requestXml = $logRequestXml;
|
| 888 |
$logResponse = $this->_parseXmlResponse($responseXml);
|
| 889 |
-
|
| 890 |
-
//$requestUrl = $logResponse->order->{'post-sale-info'}->invoices->invoice->url;
|
| 891 |
-
|
| 892 |
$logResponse->shopper->{'shopper-info'}->password = '****';
|
| 893 |
|
| 894 |
$this->_responseXml = $logResponse->asXml();
|
|
@@ -981,17 +949,25 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 981 |
{
|
| 982 |
|
| 983 |
if (!Mage::registry('bs_shopper_cards')) {
|
| 984 |
-
|
| 985 |
-
|
| 986 |
-
|
| 987 |
-
|
| 988 |
-
|
| 989 |
-
|
| 990 |
-
|
| 991 |
-
|
| 992 |
-
|
| 993 |
-
|
| 994 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 995 |
}
|
| 996 |
|
| 997 |
|
|
@@ -1047,7 +1023,7 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 1047 |
|
| 1048 |
$data = array(
|
| 1049 |
'web-info' => array(
|
| 1050 |
-
'ip' =>
|
| 1051 |
),
|
| 1052 |
'fraud-info' => array(
|
| 1053 |
'fraud-session-id' => Mage::getSingleton('checkout/session')->getSessionId(),
|
|
@@ -1059,13 +1035,8 @@ class Bluesnap_Payment_Model_Api_Cse extends Bluesnap_Payment_Model_Api_Abstract
|
|
| 1059 |
'first-name' => $billing->getFirstname(),
|
| 1060 |
'last-name' => $billing->getLastname(),
|
| 1061 |
'email' => $order->getCustomerEmail(),
|
| 1062 |
-
// 'company-name' => $billing->getCompany(),
|
| 1063 |
-
// 'address1' => $billing->getStreet(1),
|
| 1064 |
-
// 'address2' => $billing->getStreet(2),
|
| 1065 |
-
// 'city' => $billing->getCity(),
|
| 1066 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 1067 |
'country' => strtoupper($billing->getCountry()),
|
| 1068 |
-
// 'zip' => $billing->getPostcode(),
|
| 1069 |
),
|
| 1070 |
),
|
| 1071 |
);
|
| 88 |
if ($paymentaction != 'authorize_capture') {
|
| 89 |
//Auth minimal amount
|
| 90 |
if ($bsShopperId) {
|
|
|
|
| 91 |
//Here we Check if order is comming from admin or frontend
|
| 92 |
$order = $payment->getOrder();
|
| 93 |
+
$api = Mage::getModel('bluesnap/api_saved');
|
| 94 |
+
$response = $api->createAuthOrder($payment, $bsShopperId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
} else {
|
| 96 |
// new customer
|
| 97 |
$response = $this->placeAuthOrder($payment);
|
|
|
|
| 98 |
}
|
| 99 |
|
| 100 |
} else {
|
| 101 |
//Here we Check if order is comming from admin or frontend
|
| 102 |
$order = $payment->getOrder();
|
| 103 |
+
if ($order->getRemoteIp()) {
|
| 104 |
//frontend order
|
| 105 |
if ($bsShopperId) {
|
| 106 |
// returning shopper
|
| 160 |
$price = 1;
|
| 161 |
$currencyApi = Mage::getModel('bluesnap/api_currency');
|
| 162 |
$currResponse = $currencyApi->convert('USD', $baseCurrencyCode, $price);
|
|
|
|
| 163 |
$sum['amount'] = $currResponse;
|
| 164 |
} else $sum['amount'] = 1;
|
| 165 |
|
|
|
|
| 166 |
$data = array(
|
| 167 |
'web-info' => array(
|
| 168 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 169 |
+
'remote-host' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 170 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 171 |
),
|
| 172 |
'shopper-details' => array(
|
| 176 |
'first-name' => $billing->getFirstname(),
|
| 177 |
'last-name' => $billing->getLastname(),
|
| 178 |
'email' => $order->getCustomerEmail(),
|
|
|
|
|
|
|
|
|
|
| 179 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 180 |
'country' => strtoupper($billing->getCountry()),
|
|
|
|
|
|
|
| 181 |
),
|
| 182 |
'shopper-currency' => $sum['currency'],
|
| 183 |
'payment-info' => array(
|
| 186 |
'billing-contact-info' => array(
|
| 187 |
'first-name' => $billing->getFirstname(),
|
| 188 |
'last-name' => $billing->getLastname(),
|
|
|
|
|
|
|
|
|
|
| 189 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 190 |
'country' => strtoupper($billing->getCountry()),
|
|
|
|
| 191 |
),
|
| 192 |
'credit-card' => array(
|
| 193 |
+
'encrypted-card-number' => Mage::app()->getRequest()->getParam('encryptedCreditCard'),
|
| 194 |
+
// 'card-type' => (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : ''),
|
| 195 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 196 |
'expiration-year' => $payment->getCcExpYear(),
|
| 197 |
+
'encrypted-security-code' => Mage::app()->getRequest()->getParam('encryptedCvv'),
|
| 198 |
),
|
| 199 |
),
|
| 200 |
),
|
| 211 |
'ordering-shopper' => array(
|
| 212 |
'seller-shopper-id' => '',
|
| 213 |
'web-info' => array(
|
| 214 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 215 |
+
'remote-host' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 216 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 217 |
),
|
| 218 |
),
|
| 241 |
),
|
| 242 |
),
|
| 243 |
);
|
| 244 |
+
// Zend_Debug::dump($data); exit;
|
| 245 |
$xml = new SimpleXMLElement('<shopping-context xmlns="' . $this->_getXmlNs() . '"/>');
|
| 246 |
$request = Mage::helper('bluesnap')->arrayToXml($data, $xml)->asXML();
|
| 247 |
|
| 248 |
+
// remove sensitive data from logs
|
| 249 |
$logData = $data;
|
| 250 |
$logData['shopper-details']['shopper']['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-card-number'] = '****';
|
| 251 |
$logData['shopper-details']['shopper']['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-security-code'] = '****';
|
| 257 |
// send request
|
| 258 |
$url = $this->getServiceUrl('shopping-context');
|
| 259 |
$response = $this->_request($url, $request, 0, false, true);
|
| 260 |
+
|
|
|
|
|
|
|
|
|
|
| 261 |
$responseArr = $this->parseHeaders($response);
|
| 262 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
try {
|
| 264 |
// $response = $this->parseCreateResponse($response, null, $order);
|
| 265 |
} catch (Exception $e) {
|
| 323 |
}
|
| 324 |
|
| 325 |
// if card was not used before — save card for shopper
|
| 326 |
+
$validCC = false;
|
|
|
|
| 327 |
if ($payment->getCcNumber()) {
|
| 328 |
+
$response = $this->addCardToShopper($payment, $total, $bsShopperId);
|
| 329 |
+
|
| 330 |
+
$CCs = $response->descend("shopper-info/payment-info/credit-cards-info/credit-card-info");
|
| 331 |
+
|
| 332 |
+
foreach($CCs AS $cc) {
|
| 333 |
+
if(
|
| 334 |
+
(int)$cc->descend("credit-card/expiration-month") == $payment->getCcExpMonth() &&
|
| 335 |
+
(int)$cc->descend("credit-card/expiration-year") == $payment->getCcExpYear() &&
|
| 336 |
+
(int)$cc->descend("credit-card/card-last-four-digits") == $payment->getCcLast4()
|
| 337 |
+
) {
|
| 338 |
+
$validCC = $cc->descend("credit-card");
|
| 339 |
+
}
|
| 340 |
+
}
|
| 341 |
} else { //BSNPMG-34 no need to update shopper call when new card added
|
| 342 |
|
| 343 |
$this->updateShopper($payment, $total, $bsShopperId);
|
|
|
|
| 344 |
}
|
| 345 |
+
|
| 346 |
+
$response = $this->retrieveShopper($bsShopperId, $action);
|
| 347 |
+
|
| 348 |
+
$CCs = $response->descend("shopper-info/payment-info/credit-cards-info/credit-card-info");
|
| 349 |
+
|
| 350 |
+
foreach($CCs AS $cc) {
|
| 351 |
+
if(
|
| 352 |
+
(int)$cc->descend("credit-card/expiration-month") == $payment->getCcExpMonth() &&
|
| 353 |
+
(int)$cc->descend("credit-card/expiration-year") == $payment->getCcExpYear() &&
|
| 354 |
+
(int)$cc->descend("credit-card/card-last-four-digits") == $payment->getCcLast4()
|
| 355 |
+
) {
|
| 356 |
+
$validCC = $cc->descend("credit-card");
|
| 357 |
+
}
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
if($validCC) {
|
| 361 |
+
$type = (string) $validCC->descend("card-type");
|
| 362 |
+
$payment->setCcType($type)->save();
|
| 363 |
+
} else {
|
| 364 |
+
$type = (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : '');
|
| 365 |
+
}
|
| 366 |
|
| 367 |
$data = array(
|
| 368 |
'ordering-shopper' => array(
|
| 371 |
'shopper-id' => $bsShopperId,
|
| 372 |
'credit-card' => array(
|
| 373 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 374 |
+
'card-type' => $type,
|
| 375 |
),
|
| 376 |
'web-info' => array(
|
| 377 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 378 |
+
'remote-host' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 379 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 380 |
),
|
| 381 |
'fraud-info' => array(
|
| 420 |
// send request
|
| 421 |
$url = $this->getServiceUrl('orders');
|
| 422 |
$responseXml = $this->_request($url, $request);
|
|
|
|
|
|
|
| 423 |
$response = $this->_parseXmlResponse($responseXml);
|
| 424 |
|
| 425 |
try {
|
| 426 |
|
| 427 |
+
$response = $this->parseCreateResponse($response, $bsShopperId, $order,$url);
|
| 428 |
} catch (Exception $e) {
|
|
|
|
|
|
|
| 429 |
throw new Bluesnap_Payment_Model_Api_Exception(Mage::helper('core')->__('Something went wrong during placing your order. Please contact support.'));
|
| 430 |
}
|
| 431 |
|
| 455 |
|
| 456 |
$data = array(
|
| 457 |
'web-info' => array(
|
| 458 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 459 |
),
|
| 460 |
//BSNPMG-163 - fraud support
|
| 461 |
//http://docs.bluesnap.com/api/services/shoppers/create-shopper
|
| 473 |
'billing-contact-info' => array(
|
| 474 |
'first-name' => $billing->getFirstname(),
|
| 475 |
'last-name' => $billing->getLastname(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 476 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
|
|
|
| 477 |
'country' => strtoupper($billing->getCountry()),
|
| 478 |
),
|
| 479 |
'credit-card' => array(
|
| 480 |
+
'encrypted-card-number' => Mage::app()->getRequest()->getParam('encryptedCreditCard'),
|
|
|
|
| 481 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 482 |
'expiration-year' => $payment->getCcExpYear(),
|
| 483 |
+
'encrypted-security-code' => Mage::app()->getRequest()->getParam('encryptedCvv'),
|
| 484 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 485 |
),
|
| 486 |
),
|
| 493 |
|
| 494 |
$url = $this->getServiceUrl('shoppers/' . $bsShopperId);
|
| 495 |
$responseXml = $this->_request($url, $requestXml, self::HTTP_METHOD_PUT);
|
| 496 |
+
|
| 497 |
//http://docs.bluesnap.com/api/services/shoppers/update-shopper
|
| 498 |
//If successful, the response HTTP status code is 204 No Content.
|
| 499 |
//Otherwise, Errors will be returned in a messages resource.
|
| 500 |
//@todo: verify response code (204 for update shopper)
|
| 501 |
|
| 502 |
+
//remove sensitive data from logs
|
| 503 |
$logData = $data;
|
| 504 |
$logData['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-card-number'] = '****';
|
| 505 |
$logData['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-security-code'] = '****';
|
| 516 |
Mage::logException($e);
|
| 517 |
|
| 518 |
Mage::throwException(mage::helper('bluesnap')->__('Can not authorize your card'));
|
| 519 |
+
|
| 520 |
+
}
|
| 521 |
+
else {
|
| 522 |
+
//log success add card to shopper API call
|
| 523 |
+
$this->getLogger()->logSuccess($logRequestXml, $this->_responseXml, 0, "addCardToShopper success", "addCardToShopper", $order->getIncrementId(), $url);
|
| 524 |
+
|
| 525 |
}
|
| 526 |
|
| 527 |
//need to unset the value in session for new card to be avaialable
|
| 528 |
$this->getSession()->unsetData('bs_shopper');
|
| 529 |
+
|
| 530 |
+
|
| 531 |
+
|
| 532 |
+
|
| 533 |
// and save it again in the session
|
| 534 |
+
$response = $this->retrieveShopper($bsShopperId);
|
| 535 |
|
| 536 |
// unregister cards from registery
|
| 537 |
Mage::unregister('bs_shopper_cards');
|
| 538 |
+
|
| 539 |
+
return $response;
|
|
|
|
| 540 |
|
| 541 |
}
|
| 542 |
|
| 547 |
* @return Varien_Simplexml_Element
|
| 548 |
* @throws Mage_Core_Exception
|
| 549 |
*/
|
| 550 |
+
public function retrieveShopper($bsShopperId, $action=NULL)
|
| 551 |
{
|
| 552 |
+
|
|
|
|
| 553 |
|
| 554 |
+
if (!$this->getSession()->getData('bs_shopper') || $action=="invoice") {
|
| 555 |
|
| 556 |
// send request
|
| 557 |
$url = $this->getServiceUrl('shoppers/' . $bsShopperId);
|
| 582 |
$responseXml = $this->getSession()->getData('bs_shopper');
|
| 583 |
$response = $this->_parseXmlResponse($responseXml);
|
| 584 |
|
|
|
|
| 585 |
return $response;
|
| 586 |
}
|
| 587 |
|
| 610 |
|
| 611 |
$data = array(
|
| 612 |
'web-info' => array(
|
| 613 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 614 |
),
|
| 615 |
+
|
| 616 |
//http://docs.bluesnap.com/api/services/shoppers/create-shopper
|
| 617 |
'fraud-info' => array(
|
| 618 |
'fraud-session-id' => Mage::getSingleton('checkout/session')->getSessionId(),
|
| 621 |
'store-id' => Mage::helper('bluesnap')->getBluesnapStoreId(),
|
| 622 |
'shopper-currency' => $sum['currency'],
|
| 623 |
'charged-currency' => $sum['currency'],
|
|
|
|
| 624 |
'shopper-contact-info' => array(
|
| 625 |
'first-name' => $billing->getFirstname(),
|
| 626 |
'last-name' => $billing->getLastname(),
|
| 627 |
'email' => $order->getCustomerEmail(),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 628 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
|
|
|
| 629 |
'country' => strtoupper($billing->getCountry()),
|
|
|
|
|
|
|
| 630 |
),
|
| 631 |
'payment-info' => array(
|
| 632 |
'credit-cards-info' => array(
|
| 634 |
'billing-contact-info' => array(
|
| 635 |
'first-name' => $billing->getFirstname(),
|
| 636 |
'last-name' => $billing->getLastname(),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 637 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
|
|
|
| 638 |
'country' => strtoupper($billing->getCountry()),
|
| 639 |
),
|
| 640 |
'credit-card' => array(
|
| 641 |
+
'encrypted-card-number' => Mage::app()->getRequest()->getParam('encryptedCreditCard'),
|
|
|
|
| 642 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 643 |
'expiration-year' => $payment->getCcExpYear(),
|
| 644 |
+
'encrypted-security-code' => Mage::app()->getRequest()->getParam('encryptedCvv'),
|
| 645 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 646 |
),
|
| 647 |
),
|
| 681 |
* @return array
|
| 682 |
* @throws Mage_Core_Exception
|
| 683 |
*/
|
| 684 |
+
protected function parseCreateResponse($responseXml, $bsShopperId = null, $order = null, $url= " ")
|
| 685 |
{
|
| 686 |
$result = array('shopperId' => null, 'invoiceId' => null);
|
| 687 |
// $error = Mage::helper('bluesnap')->__('Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time');
|
| 689 |
if ($responseXml->message) {
|
| 690 |
// $error = Mage::helper('bluesnap')->__('Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time');
|
| 691 |
$error = (string)$responseXml->message->description;
|
| 692 |
+
|
| 693 |
$e = new Bluesnap_Payment_Model_Api_Exception($error, (int)$responseXml->message->code);
|
| 694 |
Mage::logException($e);
|
| 695 |
+
$this->getLogger()->logError($this->_requestXml, $this->_responseXml, (int)$responseXml->message->code, $error, "createOrder", $order->getIncrementId(),$url);
|
| 696 |
|
| 697 |
throw $e;
|
| 698 |
|
| 733 |
{
|
| 734 |
$order = $payment->getOrder();
|
| 735 |
$billing = $order->getBillingAddress();
|
| 736 |
+
|
| 737 |
if (!Mage::helper('bluesnap')->isStateSupported($billing->getRegionCode())) {
|
| 738 |
throw new Bluesnap_Payment_Model_Api_Exception(Mage::helper('core')->__('State is not supported'));
|
| 739 |
}
|
| 748 |
}
|
| 749 |
|
| 750 |
//http://docs.bluesnap.com/api/services/orders/batch-create-shopper-and-order
|
| 751 |
+
|
| 752 |
$data = array(
|
| 753 |
'shopper' => array(
|
| 754 |
'web-info' => array(
|
| 755 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 756 |
),
|
| 757 |
//BSNPMG-163 - fraud support
|
| 758 |
//http://docs.bluesnap.com/api/services/shoppers/create-shopper
|
| 759 |
+
|
| 760 |
'shopper-info' => array(
|
| 761 |
'store-id' => Mage::helper('bluesnap')->getBluesnapStoreId(),
|
| 762 |
'shopper-currency' => $sum['currency'],
|
| 767 |
'first-name' => $billing->getFirstname(),
|
| 768 |
'last-name' => $billing->getLastname(),
|
| 769 |
'email' => $order->getCustomerEmail(),
|
| 770 |
+
|
|
|
|
|
|
|
|
|
|
| 771 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
|
|
|
| 772 |
'country' => strtoupper($billing->getCountry()),
|
|
|
|
|
|
|
| 773 |
),
|
| 774 |
'payment-info' => array(
|
| 775 |
'credit-cards-info' => array(
|
| 777 |
'billing-contact-info' => array(
|
| 778 |
'first-name' => $billing->getFirstname(),
|
| 779 |
'last-name' => $billing->getLastname(),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 780 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
|
|
|
| 781 |
'country' => strtoupper($billing->getCountry()),
|
| 782 |
),
|
| 783 |
'credit-card' => array(
|
| 784 |
+
'encrypted-card-number' => Mage::app()->getRequest()->getParam('encryptedCreditCard'),
|
|
|
|
| 785 |
'expiration-month' => $payment->getCcExpMonth(),
|
| 786 |
'expiration-year' => $payment->getCcExpYear(),
|
| 787 |
+
'encrypted-security-code' => Mage::app()->getRequest()->getParam('encryptedCvv'),
|
| 788 |
),
|
| 789 |
),
|
| 790 |
)
|
| 795 |
'ordering-shopper' => array(
|
| 796 |
'seller-shopper-id' => '',
|
| 797 |
'web-info' => array(
|
| 798 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 799 |
+
'remote-host' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 800 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 801 |
),
|
| 802 |
'fraud-info' => array(
|
| 816 |
'soft-descriptor' => $order->getIncrementId(),
|
| 817 |
'description' => $order->getIncrementId(),
|
| 818 |
'title' => $order->getIncrementId(),
|
|
|
|
| 819 |
'sku-name' => 'Order #' . $order->getIncrementId(),
|
| 820 |
),
|
| 821 |
'quantity' => '1',
|
| 832 |
),
|
| 833 |
),
|
| 834 |
);
|
| 835 |
+
|
| 836 |
$xml = new SimpleXMLElement('<batch-order xmlns="' . $this->_getXmlNs() . '"/>');
|
| 837 |
$request = Mage::helper('bluesnap')->arrayToXml($data, $xml)->asXML();
|
| 838 |
+
|
| 839 |
//BSNPMG-86 - remove sensitive data from logs
|
| 840 |
$logData = $data;
|
| 841 |
$logData['shopper']['shopper-info']['payment-info']['credit-cards-info']['credit-card-info']['credit-card']['encrypted-card-number'] = '****';
|
| 849 |
$url = $this->getServiceUrl('batch/order-placement');
|
| 850 |
|
| 851 |
$responseXml = $this->_request($url, $request);
|
| 852 |
+
|
| 853 |
$response = $this->_parseXmlResponse($responseXml);
|
| 854 |
+
$ccType = (string) $response->descend("shopper/shopper-info/payment-info/credit-cards-info/credit-card-info/credit-card/card-type");
|
| 855 |
+
$payment->setCcType($ccType)->save();
|
| 856 |
//hide sensitive data
|
| 857 |
$this->_requestXml = $logRequestXml;
|
| 858 |
$logResponse = $this->_parseXmlResponse($responseXml);
|
| 859 |
+
|
|
|
|
|
|
|
| 860 |
$logResponse->shopper->{'shopper-info'}->password = '****';
|
| 861 |
|
| 862 |
$this->_responseXml = $logResponse->asXml();
|
| 949 |
{
|
| 950 |
|
| 951 |
if (!Mage::registry('bs_shopper_cards')) {
|
| 952 |
+
try
|
| 953 |
+
{
|
| 954 |
+
$xml = $this->retrieveShopper($bsShopperId);
|
| 955 |
+
$cards_info = $xml->xpath('//ns1:credit-card');
|
| 956 |
+
|
| 957 |
+
$cards = array();
|
| 958 |
+
foreach ($cards_info as $info) {
|
| 959 |
+
$last = (string)$info->{'card-last-four-digits'};
|
| 960 |
+
$type = (string)$info->{'card-type'};
|
| 961 |
+
$cards[$last] = $type;
|
| 962 |
+
}
|
| 963 |
+
|
| 964 |
+
Mage::register('bs_shopper_cards', $cards);
|
| 965 |
+
}
|
| 966 |
+
catch(Exception $e)
|
| 967 |
+
{
|
| 968 |
+
// throw new Exception("cound not find cards");
|
| 969 |
+
}
|
| 970 |
+
|
| 971 |
}
|
| 972 |
|
| 973 |
|
| 1023 |
|
| 1024 |
$data = array(
|
| 1025 |
'web-info' => array(
|
| 1026 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 1027 |
),
|
| 1028 |
'fraud-info' => array(
|
| 1029 |
'fraud-session-id' => Mage::getSingleton('checkout/session')->getSessionId(),
|
| 1035 |
'first-name' => $billing->getFirstname(),
|
| 1036 |
'last-name' => $billing->getLastname(),
|
| 1037 |
'email' => $order->getCustomerEmail(),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1038 |
'state' => strtoupper($billing->getCountry()) == 'US' || strtoupper($billing->getCountry()) == 'CA' ? $billing->getRegionCode() : '',
|
| 1039 |
'country' => strtoupper($billing->getCountry()),
|
|
|
|
| 1040 |
),
|
| 1041 |
),
|
| 1042 |
);
|
app/code/community/Bluesnap/Payment/Model/Api/Logger.php
CHANGED
|
@@ -16,7 +16,7 @@ class Bluesnap_Payment_Model_Api_Logger
|
|
| 16 |
$this->_loggers['mail'] = Mage::getsingleton('Bluesnap_Payment_Model_Logger_Mail');
|
| 17 |
}
|
| 18 |
|
| 19 |
-
function logSuccess($request, $response, $responseCode, $message, $method = null, $incrementId = null, $url =
|
| 20 |
{
|
| 21 |
$event = new Varien_Object();
|
| 22 |
$event->setPriority(Zend_Log::INFO);
|
|
@@ -54,7 +54,7 @@ class Bluesnap_Payment_Model_Api_Logger
|
|
| 54 |
}
|
| 55 |
}
|
| 56 |
|
| 57 |
-
function logError($request, $response, $responseCode, $message, $method = null, $incrementId = null, $url =
|
| 58 |
{
|
| 59 |
$event = new Varien_Object();
|
| 60 |
|
| 16 |
$this->_loggers['mail'] = Mage::getsingleton('Bluesnap_Payment_Model_Logger_Mail');
|
| 17 |
}
|
| 18 |
|
| 19 |
+
function logSuccess($request, $response, $responseCode, $message, $method = null, $incrementId = null, $url = " ")
|
| 20 |
{
|
| 21 |
$event = new Varien_Object();
|
| 22 |
$event->setPriority(Zend_Log::INFO);
|
| 54 |
}
|
| 55 |
}
|
| 56 |
|
| 57 |
+
function logError($request, $response, $responseCode, $message, $method = null, $incrementId = null, $url = " ")
|
| 58 |
{
|
| 59 |
$event = new Varien_Object();
|
| 60 |
|
app/code/community/Bluesnap/Payment/Model/Api/Refund.php
CHANGED
|
@@ -43,6 +43,7 @@ class Bluesnap_Payment_Model_Api_Refund extends Bluesnap_Payment_Model_Api_Abstr
|
|
| 43 |
|
| 44 |
$requestUrl = $url . '?' . $query;
|
| 45 |
$response = $this->_request($requestUrl, null, self::HTTP_METHOD_PUT);
|
|
|
|
| 46 |
if ($this->_curlInfo['http_code'] != 204 || !empty($response)) {
|
| 47 |
// error
|
| 48 |
try {
|
|
@@ -55,14 +56,14 @@ class Bluesnap_Payment_Model_Api_Refund extends Bluesnap_Payment_Model_Api_Abstr
|
|
| 55 |
$xml = $response;
|
| 56 |
$message = $response;
|
| 57 |
}
|
| 58 |
-
|
| 59 |
$e = Mage::exception('Bluesnap_Payment', $message,
|
| 60 |
(int)$xml->message->code);
|
| 61 |
|
| 62 |
Mage::logException($e);
|
| 63 |
$this->getLogger()->logError($requestUrl, $this->_responseXml, 0, $message, "refund", $incrementId, $url);
|
| 64 |
-
|
| 65 |
-
|
|
|
|
| 66 |
|
| 67 |
} else {
|
| 68 |
$this->getLogger()->logSuccess($requestUrl, '204/successful', 0, "refunded", "refund", $incrementId, $url);
|
| 43 |
|
| 44 |
$requestUrl = $url . '?' . $query;
|
| 45 |
$response = $this->_request($requestUrl, null, self::HTTP_METHOD_PUT);
|
| 46 |
+
|
| 47 |
if ($this->_curlInfo['http_code'] != 204 || !empty($response)) {
|
| 48 |
// error
|
| 49 |
try {
|
| 56 |
$xml = $response;
|
| 57 |
$message = $response;
|
| 58 |
}
|
|
|
|
| 59 |
$e = Mage::exception('Bluesnap_Payment', $message,
|
| 60 |
(int)$xml->message->code);
|
| 61 |
|
| 62 |
Mage::logException($e);
|
| 63 |
$this->getLogger()->logError($requestUrl, $this->_responseXml, 0, $message, "refund", $incrementId, $url);
|
| 64 |
+
|
| 65 |
+
Mage::throwException($message);
|
| 66 |
+
//throw $e;
|
| 67 |
|
| 68 |
} else {
|
| 69 |
$this->getLogger()->logSuccess($requestUrl, '204/successful', 0, "refunded", "refund", $incrementId, $url);
|
app/code/community/Bluesnap/Payment/Model/Api/Saved.php
CHANGED
|
@@ -73,18 +73,37 @@ class Bluesnap_Payment_Model_Api_Saved extends Bluesnap_Payment_Model_Api_Cse
|
|
| 73 |
|
| 74 |
} else $sum['amount'] = 1;
|
| 75 |
|
| 76 |
-
if (
|
| 77 |
-
$this->addCardToShopper($payment, $sum, $bsShopperId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
} else {
|
| 80 |
$this->updateShopperWithNoCC($payment, $sum, $bsShopperId);
|
| 81 |
-
|
| 82 |
}
|
| 83 |
|
| 84 |
$data1 = array(
|
| 85 |
'web-info' => array(
|
| 86 |
-
'ip' =>
|
| 87 |
-
'remote-host' =>
|
| 88 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 89 |
),
|
| 90 |
'order-details' => array(
|
|
@@ -93,7 +112,7 @@ class Bluesnap_Payment_Model_Api_Saved extends Bluesnap_Payment_Model_Api_Cse
|
|
| 93 |
'shopper-id' => $bsShopperId,
|
| 94 |
'credit-card' => array(
|
| 95 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 96 |
-
'card-type' =>
|
| 97 |
),
|
| 98 |
'fraud-info' => array(
|
| 99 |
'fraud-session-id' => Mage::getSingleton('checkout/session')->getSessionId(),
|
|
@@ -208,16 +227,36 @@ class Bluesnap_Payment_Model_Api_Saved extends Bluesnap_Payment_Model_Api_Cse
|
|
| 208 |
else $this->updateShopperWithNoCC($payment, $sum, $bsShopperId);
|
| 209 |
}
|
| 210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
$data = array(
|
| 212 |
'ordering-shopper' => array(
|
| 213 |
'shopper-id' => $bsShopperId,
|
| 214 |
'credit-card' => array(
|
| 215 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 216 |
-
'card-type' =>
|
| 217 |
),
|
| 218 |
'web-info' => array(
|
| 219 |
-
'ip' =>
|
| 220 |
-
'remote-host' =>
|
| 221 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 222 |
),
|
| 223 |
'fraud-info' => array(
|
|
@@ -269,8 +308,9 @@ class Bluesnap_Payment_Model_Api_Saved extends Bluesnap_Payment_Model_Api_Cse
|
|
| 269 |
$response = $this->parseCreateResponse($response, $bsShopperId, $order);
|
| 270 |
} catch (Exception $e) {
|
| 271 |
Mage::logException($e);
|
| 272 |
-
|
| 273 |
-
|
|
|
|
| 274 |
}
|
| 275 |
|
| 276 |
$this->getLogger()->logSuccess($this->_requestXml, $this->_responseXml, 0, "createOrder success", "createOrder", $order->getIncrementId(), $url);
|
| 73 |
|
| 74 |
} else $sum['amount'] = 1;
|
| 75 |
|
| 76 |
+
if (Mage::app()->getRequest()->getParam('encryptedCreditCard')) {
|
| 77 |
+
$response = $this->addCardToShopper($payment, $sum, $bsShopperId);
|
| 78 |
+
|
| 79 |
+
$CCs = $response->descend("shopper-info/payment-info/credit-cards-info/credit-card-info");
|
| 80 |
+
|
| 81 |
+
foreach($CCs AS $cc) {
|
| 82 |
+
if(
|
| 83 |
+
(int)$cc->descend("credit-card/expiration-month") == $payment->getCcExpMonth() &&
|
| 84 |
+
(int)$cc->descend("credit-card/expiration-year") == $payment->getCcExpYear() &&
|
| 85 |
+
(int)$cc->descend("credit-card/card-last-four-digits") == $payment->getCcLast4()
|
| 86 |
+
) {
|
| 87 |
+
$validCC = $cc->descend("credit-card");
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
if($validCC) {
|
| 92 |
+
$type = (string) $validCC->descend("card-type");
|
| 93 |
+
$payment->setCcType($type)->save();
|
| 94 |
+
} else {
|
| 95 |
+
$type = (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : '');
|
| 96 |
+
}
|
| 97 |
|
| 98 |
} else {
|
| 99 |
$this->updateShopperWithNoCC($payment, $sum, $bsShopperId);
|
| 100 |
+
$type = (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : '');
|
| 101 |
}
|
| 102 |
|
| 103 |
$data1 = array(
|
| 104 |
'web-info' => array(
|
| 105 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 106 |
+
'remote-host' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 107 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 108 |
),
|
| 109 |
'order-details' => array(
|
| 112 |
'shopper-id' => $bsShopperId,
|
| 113 |
'credit-card' => array(
|
| 114 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 115 |
+
'card-type' => $type,
|
| 116 |
),
|
| 117 |
'fraud-info' => array(
|
| 118 |
'fraud-session-id' => Mage::getSingleton('checkout/session')->getSessionId(),
|
| 227 |
else $this->updateShopperWithNoCC($payment, $sum, $bsShopperId);
|
| 228 |
}
|
| 229 |
|
| 230 |
+
$response = $this->retrieveShopper($bsShopperId, $action);
|
| 231 |
+
Mage::log($response,NULL,'fff.log');
|
| 232 |
+
$CCs = $response->descend("shopper-info/payment-info/credit-cards-info/credit-card-info");
|
| 233 |
+
|
| 234 |
+
foreach($CCs AS $cc) {
|
| 235 |
+
if(
|
| 236 |
+
(int)$cc->descend("credit-card/expiration-month") == $payment->getCcExpMonth() &&
|
| 237 |
+
(int)$cc->descend("credit-card/expiration-year") == $payment->getCcExpYear() &&
|
| 238 |
+
(int)$cc->descend("credit-card/card-last-four-digits") == $payment->getCcLast4()
|
| 239 |
+
) {
|
| 240 |
+
$validCC = $cc->descend("credit-card");
|
| 241 |
+
}
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
if($validCC) {
|
| 245 |
+
$type = (string) $validCC->descend("card-type");
|
| 246 |
+
$payment->setCcType($type)->save();
|
| 247 |
+
} else {
|
| 248 |
+
$type = (isset($this->cardTypes[$payment->getCcType()]) ? $this->cardTypes[$payment->getCcType()] : '');
|
| 249 |
+
}
|
| 250 |
$data = array(
|
| 251 |
'ordering-shopper' => array(
|
| 252 |
'shopper-id' => $bsShopperId,
|
| 253 |
'credit-card' => array(
|
| 254 |
'card-last-four-digits' => $payment->getCcLast4(),
|
| 255 |
+
'card-type' => $type,
|
| 256 |
),
|
| 257 |
'web-info' => array(
|
| 258 |
+
'ip' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 259 |
+
'remote-host' => $order->getRemoteIp() ? $order->getRemoteIp() : $_SERVER['REMOTE_ADDR'],
|
| 260 |
'user-agent' => Mage::helper('core/http')->getHttpUserAgent(),
|
| 261 |
),
|
| 262 |
'fraud-info' => array(
|
| 308 |
$response = $this->parseCreateResponse($response, $bsShopperId, $order);
|
| 309 |
} catch (Exception $e) {
|
| 310 |
Mage::logException($e);
|
| 311 |
+
|
| 312 |
+
$error_message = Mage::helper('bluesnap')->getErroMessage($error_code);
|
| 313 |
+
throw new Bluesnap_Payment_Model_Api_Exception($error_message);
|
| 314 |
}
|
| 315 |
|
| 316 |
$this->getLogger()->logSuccess($this->_requestXml, $this->_responseXml, 0, "createOrder success", "createOrder", $order->getIncrementId(), $url);
|
app/code/community/Bluesnap/Payment/Model/Directory/Currency/Import.php
CHANGED
|
@@ -46,7 +46,7 @@ class Bluesnap_Payment_Model_Directory_Currency_Import extends Mage_Directory_Mo
|
|
| 46 |
$this->_messages[] = Mage::helper('directory')->__('Cannot retrieve BlueSnap rate from %s.', $this->_url);
|
| 47 |
return null;
|
| 48 |
}
|
| 49 |
-
$this->_messages['info'][] = "Successfully retrieved $currencyFrom => $currencyTo = " . $value / self::AMOUNT;
|
| 50 |
|
| 51 |
$this->getLogger()->logSuccess('convert rates import', "Successfully retrieved $currencyFrom => $currencyTo = " . $value / self::AMOUNT, 0, "Import Rates success", "convert rates", '', '');
|
| 52 |
|
| 46 |
$this->_messages[] = Mage::helper('directory')->__('Cannot retrieve BlueSnap rate from %s.', $this->_url);
|
| 47 |
return null;
|
| 48 |
}
|
| 49 |
+
// $this->_messages['info'][] = "Successfully retrieved $currencyFrom => $currencyTo = " . $value / self::AMOUNT;
|
| 50 |
|
| 51 |
$this->getLogger()->logSuccess('convert rates import', "Successfully retrieved $currencyFrom => $currencyTo = " . $value / self::AMOUNT, 0, "Import Rates success", "convert rates", '', '');
|
| 52 |
|
app/code/community/Bluesnap/Payment/Model/Logger/Db.php
CHANGED
|
@@ -9,11 +9,11 @@ class Bluesnap_Payment_Model_Logger_Db extends Zend_Log_Writer_Db
|
|
| 9 |
|
| 10 |
public function __construct($db = null, $table = null, $columnMap = null)
|
| 11 |
{
|
| 12 |
-
|
| 13 |
//parent::__construct(null);
|
| 14 |
$resource = Mage::getSingleton('core/resource');
|
| 15 |
$this->_db = $resource->getConnection('core_write');
|
| 16 |
-
|
| 17 |
$this->_table = 'bluesnap_api_logger';
|
| 18 |
|
| 19 |
$this->_columnMap = array(
|
|
@@ -51,10 +51,24 @@ class Bluesnap_Payment_Model_Logger_Db extends Zend_Log_Writer_Db
|
|
| 51 |
{
|
| 52 |
$this->_filters = array();
|
| 53 |
}
|
| 54 |
-
|
| 55 |
-
|
| 56 |
{
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
}
|
| 59 |
}
|
| 60 |
|
| 9 |
|
| 10 |
public function __construct($db = null, $table = null, $columnMap = null)
|
| 11 |
{
|
| 12 |
+
|
| 13 |
//parent::__construct(null);
|
| 14 |
$resource = Mage::getSingleton('core/resource');
|
| 15 |
$this->_db = $resource->getConnection('core_write');
|
| 16 |
+
|
| 17 |
$this->_table = 'bluesnap_api_logger';
|
| 18 |
|
| 19 |
$this->_columnMap = array(
|
| 51 |
{
|
| 52 |
$this->_filters = array();
|
| 53 |
}
|
| 54 |
+
|
| 55 |
+
function _write($event)
|
| 56 |
{
|
| 57 |
+
if ($this->_db === null) {
|
| 58 |
+
#require_once 'Zend/Log/Exception.php';
|
| 59 |
+
throw new Zend_Log_Exception('Database adapter is null');
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
if ($this->_columnMap === null) {
|
| 63 |
+
$dataToInsert = $event;
|
| 64 |
+
} else {
|
| 65 |
+
$dataToInsert = array();
|
| 66 |
+
foreach ($this->_columnMap as $columnName => $fieldKey) {
|
| 67 |
+
$dataToInsert[$columnName] = $event[$fieldKey];
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
$this->_db->insert($this->_table, $dataToInsert);
|
| 72 |
}
|
| 73 |
}
|
| 74 |
|
app/code/community/Bluesnap/Payment/Model/Observer.php
CHANGED
|
@@ -196,94 +196,7 @@ class Bluesnap_Payment_Model_Observer
|
|
| 196 |
|
| 197 |
}
|
| 198 |
|
| 199 |
-
|
| 200 |
-
function checkSecure($observer)
|
| 201 |
-
{
|
| 202 |
-
$postData = $observer->getEvent()->getData();
|
| 203 |
-
if ($this->getIsSandbox($postData) == '0') {
|
| 204 |
-
if (!isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "on") {
|
| 205 |
-
// set sandbox mode becasue admin is not secured
|
| 206 |
-
$this->setSandbox($postData);
|
| 207 |
-
|
| 208 |
-
//check if ssl is installed to show the right message
|
| 209 |
-
if (!$this->is_exist_ssl(Mage::getBaseUrl())) Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you are using HTTPS.'));
|
| 210 |
-
else Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you enable secure URLs in admin.'));
|
| 211 |
-
} else {
|
| 212 |
-
if (!Mage::app()->getStore()->isFrontUrlSecure()) {
|
| 213 |
-
$this->setSandbox($postData);
|
| 214 |
-
Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you enable secure URLs in frontend.'));
|
| 215 |
-
|
| 216 |
-
}
|
| 217 |
-
if (!Mage::app()->getStore()->isAdminUrlSecure()) {
|
| 218 |
-
$this->setSandbox($postData);
|
| 219 |
-
Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you enable secure URLs in admin.'));
|
| 220 |
-
}
|
| 221 |
-
|
| 222 |
-
}
|
| 223 |
-
}
|
| 224 |
-
}
|
| 225 |
-
|
| 226 |
-
private function getIsSandbox($postData)
|
| 227 |
-
{
|
| 228 |
-
if (is_null($postData['store']) && $postData['website']) //check for website scope
|
| 229 |
-
{
|
| 230 |
-
$scopeId = Mage::getModel('core/website')->load($postData['website'])->getId();
|
| 231 |
-
$isSnadBox = Mage::app()->getWebsite($scopeId)->getConfig('bluesnap/general/is_sandbox_mode');
|
| 232 |
-
} elseif ($postData['store']) //check for store scope
|
| 233 |
-
{
|
| 234 |
-
$scopeId = Mage::getModel('core/store')->load($postData['store'])->getId();
|
| 235 |
-
$isSnadBox = Mage::app()->getWebsite($scopeId)->getConfig('bluesnap/general/is_sandbox_mode');
|
| 236 |
-
} else //for default scope
|
| 237 |
-
{
|
| 238 |
-
$scopeId = 0;
|
| 239 |
-
$isSnadBox = Mage::getStoreConfig('bluesnap/general/is_sandbox_mode');
|
| 240 |
-
}
|
| 241 |
-
|
| 242 |
-
return $isSnadBox;
|
| 243 |
-
}
|
| 244 |
-
|
| 245 |
-
private function setSandbox($postData)
|
| 246 |
-
{
|
| 247 |
-
if (is_null($postData['store']) && $postData['website']) //check for website scope
|
| 248 |
-
{
|
| 249 |
-
$scopeId = Mage::getModel('core/website')->load($postData['website'])->getId();
|
| 250 |
-
$currentScope = 'websites';
|
| 251 |
-
} elseif ($postData['store']) //check for store scope
|
| 252 |
-
{
|
| 253 |
-
$scopeId = Mage::getModel('core/store')->load($postData['store'])->getId();
|
| 254 |
-
$currentScope = 'stores';
|
| 255 |
-
} else //for default scope
|
| 256 |
-
{
|
| 257 |
-
$scopeId = 0;
|
| 258 |
-
$currentScope = 'default';
|
| 259 |
-
}
|
| 260 |
-
|
| 261 |
-
if ($currentScop == 'default') Mage::getConfig()->saveConfig('bluesnap/general/is_sandbox_mode', '1');
|
| 262 |
-
else Mage::getConfig()->saveConfig('bluesnap/general/is_sandbox_mode', '1', $currentScope, $scopeId);
|
| 263 |
-
}
|
| 264 |
-
|
| 265 |
-
//we check if ssl is installed on server and user is working on non secure page
|
| 266 |
-
|
| 267 |
-
private function is_exist_ssl($baseurl)
|
| 268 |
-
{
|
| 269 |
-
$domain=parse_url($baseurl, PHP_URL_HOST);
|
| 270 |
-
$ch = curl_init();
|
| 271 |
-
curl_setopt($ch, CURLOPT_URL, "https://" . $domain);
|
| 272 |
-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
| 273 |
-
curl_setopt($ch, CURLOPT_HEADER, 0);
|
| 274 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
| 275 |
-
curl_exec($ch);
|
| 276 |
-
|
| 277 |
-
if (!curl_error($ch)) {
|
| 278 |
-
$info = curl_getinfo($ch);
|
| 279 |
-
if ($info['http_code'] == 200) {
|
| 280 |
-
return true;
|
| 281 |
-
}
|
| 282 |
-
return false;
|
| 283 |
-
} else {
|
| 284 |
-
return false;
|
| 285 |
-
}
|
| 286 |
-
}
|
| 287 |
public function sendCron() {
|
| 288 |
$days = Mage::getStoreConfig('bluesnap/logger/collect_data_for');
|
| 289 |
|
|
@@ -294,4 +207,23 @@ class Bluesnap_Payment_Model_Observer
|
|
| 294 |
}
|
| 295 |
$collection->save();
|
| 296 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
}
|
| 196 |
|
| 197 |
}
|
| 198 |
|
| 199 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
public function sendCron() {
|
| 201 |
$days = Mage::getStoreConfig('bluesnap/logger/collect_data_for');
|
| 202 |
|
| 207 |
}
|
| 208 |
$collection->save();
|
| 209 |
}
|
| 210 |
+
|
| 211 |
+
public function addJsOnestep($observer){
|
| 212 |
+
$controller = $observer->getAction();
|
| 213 |
+
$controllerName = $controller->getRequest()->getRouteName();
|
| 214 |
+
$exist = strpos($controllerName, 'onestepcheckout');
|
| 215 |
+
if ($exist !== FALSE) {
|
| 216 |
+
$layout = $controller->getLayout();
|
| 217 |
+
//if( $layout->getBlock('head')){
|
| 218 |
+
$layout->getBlock('head')->addLinkRel('text/javascript','https://gateway.bluesnap.com/js/cse/v1.0.2/bluesnap.js');
|
| 219 |
+
$layout->getBlock('head')->addItem('js','bluesnap/credit-card-detect.js');
|
| 220 |
+
$layout->getBlock('head')->addItem('js','bluesnap/payform.js');
|
| 221 |
+
$layout->getBlock('head')->addItem('js','bluesnap/bsadmin.js');
|
| 222 |
+
$layout->getBlock('head')->addItem('js','lib/jquery/jquery-ui/jquery-ui.js');
|
| 223 |
+
$layout->getBlock('head')->addItem('js','lib/jquery/jquery-ui/jquery-ui.js');
|
| 224 |
+
$layout->getBlock('head')->addItem('skin_css', 'css/bluesnap/buynow/checkout.css');
|
| 225 |
+
$layout->getBlock('head')->addItem('js_css', 'lib/jquery/jquery-ui/jquery-ui.css');
|
| 226 |
+
//}
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
}
|
app/code/community/Bluesnap/Payment/Model/Payment/Cse.php
CHANGED
|
@@ -56,9 +56,9 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 56 |
|
| 57 |
if ($quote) {
|
| 58 |
$isApplicableMasks = array(
|
| 59 |
-
self::CHECK_USE_CHECKOUT,
|
| 60 |
-
self::CHECK_USE_FOR_COUNTRY,
|
| 61 |
-
self::CHECK_ORDER_TOTAL_MIN_MAX
|
| 62 |
);
|
| 63 |
foreach ($isApplicableMasks as $mask) {
|
| 64 |
if (!$this->isApplicableToQuote($quote, $mask)) {
|
|
@@ -212,6 +212,8 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 212 |
$info->setCcLast($cseCcLast);
|
| 213 |
$info->setCcLast4($cseCcLast);
|
| 214 |
$info->setAdditionalInformation('is_saved', false);
|
|
|
|
|
|
|
| 215 |
}
|
| 216 |
|
| 217 |
/**
|
|
@@ -248,11 +250,11 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 248 |
if ($result['http_code'] == '201') {
|
| 249 |
$order = $payment->getOrder();
|
| 250 |
|
| 251 |
-
if (
|
| 252 |
|
| 253 |
$payment->setAdditionalInformation('transaction_type', 'shopping-context');
|
| 254 |
|
| 255 |
-
if (
|
| 256 |
//getting the tranasaction id from location info
|
| 257 |
$loc = explode("/", $result['location']);
|
| 258 |
$transaction_id = $loc[count($loc) - 1];
|
|
@@ -275,14 +277,14 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 275 |
sprintf("BlueSnap Credit/Debit card authorized transaction. Order ID: \"%s\".", $transaction_id));
|
| 276 |
|
| 277 |
} else {
|
| 278 |
-
$this->processError($result);
|
| 279 |
}
|
| 280 |
|
| 281 |
} else {
|
| 282 |
$message = 'Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time';
|
| 283 |
|
| 284 |
Mage::log($message, Zend_Log::ERR);
|
| 285 |
-
$this->getLogger()->logError("", "", 0, $message, "cse::
|
| 286 |
|
| 287 |
Mage::throwException(Mage::helper('bluesnap')->__($message));
|
| 288 |
|
|
@@ -294,7 +296,7 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 294 |
* @param $result
|
| 295 |
* @throws Mage_Core_Exception
|
| 296 |
*/
|
| 297 |
-
public function processError($result)
|
| 298 |
{
|
| 299 |
$error = Mage::helper('bluesnap')->__('Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time');
|
| 300 |
if (isset($result['message']['description'])) {
|
|
@@ -304,7 +306,8 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 304 |
$error .= "\r\n" . ' (' . $result['message']['invalid-property']['message-value'] . ')';
|
| 305 |
}
|
| 306 |
}
|
| 307 |
-
$this->getLogger()->logError("", "", "", $
|
|
|
|
| 308 |
Mage::throwException($error);
|
| 309 |
}
|
| 310 |
|
|
@@ -318,6 +321,7 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 318 |
*/
|
| 319 |
public function capture(Varien_Object $payment, $amount)
|
| 320 |
{
|
|
|
|
| 321 |
$apiType = $payment->getAdditionalInformation('is_saved') ? 'saved' : 'cse';
|
| 322 |
$type = $payment->getAdditionalInformation('transaction_type') == 'shopping-context' ? 'auth' : 'capture';
|
| 323 |
|
|
@@ -342,10 +346,11 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 342 |
if ($result = $api->placeOrder($payment, $bsShopperId)) {
|
| 343 |
if (!empty($result['invoiceId'])) {
|
| 344 |
$bsTransactionId = $result['invoiceId'];
|
| 345 |
-
|
| 346 |
-
|
|
|
|
| 347 |
$status = $result['status'];
|
| 348 |
-
if (
|
| 349 |
|
| 350 |
/* @var $order Mage_Sales_Model_Order */
|
| 351 |
|
|
@@ -417,7 +422,7 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 417 |
}
|
| 418 |
} else {
|
| 419 |
$message = 'Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time';
|
| 420 |
-
|
| 421 |
Mage::log($message, Zend_Log::ERR);
|
| 422 |
$this->getLogger()->logError("", "", 0, $message, "cse::capture", $payment->getOrder()->getIncrementId());
|
| 423 |
|
|
@@ -440,7 +445,7 @@ class Bluesnap_Payment_Model_Payment_Cse extends Bluesnap_Payment_Model_Payment_
|
|
| 440 |
|
| 441 |
$order = $payment->getOrder();
|
| 442 |
|
| 443 |
-
if (
|
| 444 |
|
| 445 |
$payment->setAdditionalInformation('transactionAmount', $result['transaction']['amount']);
|
| 446 |
$payment->setAdditionalInformation('transactionCurrency', $result['transaction']['currency']);
|
| 56 |
|
| 57 |
if ($quote) {
|
| 58 |
$isApplicableMasks = array(
|
| 59 |
+
// self::CHECK_USE_CHECKOUT,
|
| 60 |
+
// self::CHECK_USE_FOR_COUNTRY,
|
| 61 |
+
// self::CHECK_ORDER_TOTAL_MIN_MAX
|
| 62 |
);
|
| 63 |
foreach ($isApplicableMasks as $mask) {
|
| 64 |
if (!$this->isApplicableToQuote($quote, $mask)) {
|
| 212 |
$info->setCcLast($cseCcLast);
|
| 213 |
$info->setCcLast4($cseCcLast);
|
| 214 |
$info->setAdditionalInformation('is_saved', false);
|
| 215 |
+
|
| 216 |
+
return $info;
|
| 217 |
}
|
| 218 |
|
| 219 |
/**
|
| 250 |
if ($result['http_code'] == '201') {
|
| 251 |
$order = $payment->getOrder();
|
| 252 |
|
| 253 |
+
if (!$order->getRemoteIp()) $payment->unsAdditionalInformation();
|
| 254 |
|
| 255 |
$payment->setAdditionalInformation('transaction_type', 'shopping-context');
|
| 256 |
|
| 257 |
+
if ($order->getRemoteIp()) $payment->setAdditionalInformation('is_saved', true);
|
| 258 |
//getting the tranasaction id from location info
|
| 259 |
$loc = explode("/", $result['location']);
|
| 260 |
$transaction_id = $loc[count($loc) - 1];
|
| 277 |
sprintf("BlueSnap Credit/Debit card authorized transaction. Order ID: \"%s\".", $transaction_id));
|
| 278 |
|
| 279 |
} else {
|
| 280 |
+
$this->processError($result,'authorize');
|
| 281 |
}
|
| 282 |
|
| 283 |
} else {
|
| 284 |
$message = 'Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time';
|
| 285 |
|
| 286 |
Mage::log($message, Zend_Log::ERR);
|
| 287 |
+
$this->getLogger()->logError("", "", 0, $message, "cse::authorize", $payment->getOrder()->getIncrementId());
|
| 288 |
|
| 289 |
Mage::throwException(Mage::helper('bluesnap')->__($message));
|
| 290 |
|
| 296 |
* @param $result
|
| 297 |
* @throws Mage_Core_Exception
|
| 298 |
*/
|
| 299 |
+
public function processError($result, $type=NULL)
|
| 300 |
{
|
| 301 |
$error = Mage::helper('bluesnap')->__('Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time');
|
| 302 |
if (isset($result['message']['description'])) {
|
| 306 |
$error .= "\r\n" . ' (' . $result['message']['invalid-property']['message-value'] . ')';
|
| 307 |
}
|
| 308 |
}
|
| 309 |
+
if($type=='authorize') $this->getLogger()->logError("", "", "", $error, "cse::authorize");
|
| 310 |
+
else $this->getLogger()->logError("", "", "", $result['message']['description'], "cse::capture");
|
| 311 |
Mage::throwException($error);
|
| 312 |
}
|
| 313 |
|
| 321 |
*/
|
| 322 |
public function capture(Varien_Object $payment, $amount)
|
| 323 |
{
|
| 324 |
+
//Mage::log($payment->getData(),NULL,'bs.log');
|
| 325 |
$apiType = $payment->getAdditionalInformation('is_saved') ? 'saved' : 'cse';
|
| 326 |
$type = $payment->getAdditionalInformation('transaction_type') == 'shopping-context' ? 'auth' : 'capture';
|
| 327 |
|
| 346 |
if ($result = $api->placeOrder($payment, $bsShopperId)) {
|
| 347 |
if (!empty($result['invoiceId'])) {
|
| 348 |
$bsTransactionId = $result['invoiceId'];
|
| 349 |
+
|
| 350 |
+
// Mage::log('error101',NULL,'errorTest.log');
|
| 351 |
+
|
| 352 |
$status = $result['status'];
|
| 353 |
+
if (!$order->getRemoteIp()) $payment->unsAdditionalInformation();
|
| 354 |
|
| 355 |
/* @var $order Mage_Sales_Model_Order */
|
| 356 |
|
| 422 |
}
|
| 423 |
} else {
|
| 424 |
$message = 'Unfortunately the transaction cannot be processed at this time due to an unspecified error, please try a different card or try again at a later time';
|
| 425 |
+
|
| 426 |
Mage::log($message, Zend_Log::ERR);
|
| 427 |
$this->getLogger()->logError("", "", 0, $message, "cse::capture", $payment->getOrder()->getIncrementId());
|
| 428 |
|
| 445 |
|
| 446 |
$order = $payment->getOrder();
|
| 447 |
|
| 448 |
+
if ($order->getRemoteIp()) $payment->unsAdditionalInformation();
|
| 449 |
|
| 450 |
$payment->setAdditionalInformation('transactionAmount', $result['transaction']['amount']);
|
| 451 |
$payment->setAdditionalInformation('transactionCurrency', $result['transaction']['currency']);
|
app/code/community/Bluesnap/Payment/Model/Sales/Order/Payment.php
CHANGED
|
@@ -116,8 +116,8 @@ class Bluesnap_Payment_Model_Sales_Order_Payment extends Mage_Sales_Model_Order_
|
|
| 116 |
}
|
| 117 |
// check for authorization amount to be equal to grand total
|
| 118 |
$this->setShouldCloseParentTransaction(false);
|
| 119 |
-
|
| 120 |
-
if (!$
|
| 121 |
$this->setIsFraudDetected(true);
|
| 122 |
}
|
| 123 |
|
| 116 |
}
|
| 117 |
// check for authorization amount to be equal to grand total
|
| 118 |
$this->setShouldCloseParentTransaction(false);
|
| 119 |
+
// $isSameCurrency = $this->_isSameCurrency();
|
| 120 |
+
if (!$this->_isCaptureFinal($amount)) {
|
| 121 |
$this->setIsFraudDetected(true);
|
| 122 |
}
|
| 123 |
|
app/code/community/Bluesnap/Payment/Model/Sslvalidation.php
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Bluesnap_Payment_Model_Sslvalidation extends Mage_Core_Model_Config_Data
|
| 3 |
+
{
|
| 4 |
+
public function save()
|
| 5 |
+
{
|
| 6 |
+
$isSandbox = $this->getValue();
|
| 7 |
+
|
| 8 |
+
if($isSandbox == 0) //exit if we're less than 10 digits long
|
| 9 |
+
{
|
| 10 |
+
$canProceed = $this->checkSecure($isSandbox);
|
| 11 |
+
|
| 12 |
+
switch ($canProceed) {
|
| 13 |
+
case 0:
|
| 14 |
+
Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you are using HTTPS.'));
|
| 15 |
+
break;
|
| 16 |
+
case 2:
|
| 17 |
+
Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you enable secure URLs in admin.'));
|
| 18 |
+
break;
|
| 19 |
+
case 3:
|
| 20 |
+
Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you enable secure URLs in frontend.'));
|
| 21 |
+
break;
|
| 22 |
+
case 4:
|
| 23 |
+
Mage::throwException(Mage::helper('bluesnap')->__('Due to Payment Security reasons, BlueSnap’s payment can’t be set to production on an unsecured page. Please ensure you enable secure URLs in admin.'));
|
| 24 |
+
break;
|
| 25 |
+
}
|
| 26 |
+
if($canProceed!=1) {
|
| 27 |
+
exit();
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
return parent::save(); //call original save method so whatever happened
|
| 32 |
+
//before still happens (the value saves)
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
//check if server is secured
|
| 36 |
+
function checkSecure($isSandbox)
|
| 37 |
+
{
|
| 38 |
+
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "on") {
|
| 39 |
+
// set sandbox mode becasue admin is not secured
|
| 40 |
+
$this->setSandbox($postData);
|
| 41 |
+
|
| 42 |
+
//check if ssl is installed to show the right message
|
| 43 |
+
if (!$this->is_exist_ssl(Mage::getBaseUrl())) return 0;
|
| 44 |
+
else return 2;
|
| 45 |
+
} else {
|
| 46 |
+
if (!$this->checkAllwebsites()) {
|
| 47 |
+
return 3;
|
| 48 |
+
}
|
| 49 |
+
if (!Mage::app()->getStore()->isAdminUrlSecure()) {
|
| 50 |
+
return 4;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
return 1;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
private function checkAllwebsites(){
|
| 58 |
+
foreach (Mage::app()->getWebsites() as $website) {
|
| 59 |
+
if(Mage::app()->getWebsite($website->getId())->getConfig('web/secure/use_in_frontend')!=1) return false;
|
| 60 |
+
}
|
| 61 |
+
return true;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
private function getIsSandbox($postData)
|
| 65 |
+
{
|
| 66 |
+
if (is_null($postData['store']) && $postData['website']) //check for website scope
|
| 67 |
+
{
|
| 68 |
+
$scopeId = Mage::getModel('core/website')->load($postData['website'])->getId();
|
| 69 |
+
$isSnadBox = Mage::app()->getWebsite($scopeId)->getConfig('bluesnap/general/is_sandbox_mode');
|
| 70 |
+
} elseif ($postData['store']) //check for store scope
|
| 71 |
+
{
|
| 72 |
+
$scopeId = Mage::getModel('core/store')->load($postData['store'])->getId();
|
| 73 |
+
$isSnadBox = Mage::app()->getWebsite($scopeId)->getConfig('bluesnap/general/is_sandbox_mode');
|
| 74 |
+
} else //for default scope
|
| 75 |
+
{
|
| 76 |
+
$scopeId = 0;
|
| 77 |
+
$isSnadBox = Mage::getStoreConfig('bluesnap/general/is_sandbox_mode');
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
return $isSnadBox;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
private function setSandbox($postData)
|
| 85 |
+
{
|
| 86 |
+
if (is_null($postData['store']) && $postData['website']) //check for website scope
|
| 87 |
+
{
|
| 88 |
+
$scopeId = Mage::getModel('core/website')->load($postData['website'])->getId();
|
| 89 |
+
$currentScope = 'websites';
|
| 90 |
+
|
| 91 |
+
} elseif ($postData['store']) //check for store scope
|
| 92 |
+
{
|
| 93 |
+
|
| 94 |
+
$scopeId = Mage::getModel('core/store')->load($postData['store'])->getId();
|
| 95 |
+
$currentScope = 'stores';
|
| 96 |
+
|
| 97 |
+
} else //for default scope
|
| 98 |
+
{
|
| 99 |
+
$scopeId = 0;
|
| 100 |
+
$currentScope = 'default';
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
if ($currentScop == 'default') {
|
| 104 |
+
Mage::getConfig()->saveConfig('bluesnap/general/is_sandbox_mode', '1');
|
| 105 |
+
|
| 106 |
+
}
|
| 107 |
+
else Mage::getConfig()->saveConfig('bluesnap/general/is_sandbox_mode', '1', $currentScope, $scopeId);
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
//we check if ssl is installed on server and user is working on non secure page
|
| 111 |
+
|
| 112 |
+
private function is_exist_ssl($baseurl)
|
| 113 |
+
{
|
| 114 |
+
$domain=parse_url($baseurl, PHP_URL_HOST);
|
| 115 |
+
$ch = curl_init();
|
| 116 |
+
curl_setopt($ch, CURLOPT_URL, "https://" . $domain);
|
| 117 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
| 118 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
| 119 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
| 120 |
+
curl_exec($ch);
|
| 121 |
+
|
| 122 |
+
if (!curl_error($ch)) {
|
| 123 |
+
$info = curl_getinfo($ch);
|
| 124 |
+
if ($info['http_code'] == 200) {
|
| 125 |
+
return true;
|
| 126 |
+
}
|
| 127 |
+
return false;
|
| 128 |
+
} else {
|
| 129 |
+
return false;
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
}
|
app/code/community/Bluesnap/Payment/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Bluesnap_Payment>
|
| 5 |
-
<version>2.0.2
|
| 6 |
</Bluesnap_Payment>
|
| 7 |
</modules>
|
| 8 |
|
|
@@ -255,15 +255,6 @@
|
|
| 255 |
</modules>
|
| 256 |
</translate>
|
| 257 |
<events>
|
| 258 |
-
<admin_system_config_changed_section_bluesnap>
|
| 259 |
-
<observers>
|
| 260 |
-
<bluesnap_system_config_changed_section_bluesnap>
|
| 261 |
-
<type>singleton</type>
|
| 262 |
-
<class>Bluesnap_Payment_Model_Observer</class>
|
| 263 |
-
<method>checkSecure</method>
|
| 264 |
-
</bluesnap_system_config_changed_section_bluesnap>
|
| 265 |
-
</observers>
|
| 266 |
-
</admin_system_config_changed_section_bluesnap>
|
| 267 |
<sales_order_grid_collection_load_before_>
|
| 268 |
<observers>
|
| 269 |
<bluesnap_sales_order_grid_collection_load_before>
|
|
@@ -312,6 +303,8 @@
|
|
| 312 |
<general>
|
| 313 |
<protection_key backend_model="adminhtml/system_config_backend_encrypted"/>
|
| 314 |
<api_password backend_model="adminhtml/system_config_backend_encrypted"/>
|
|
|
|
|
|
|
| 315 |
</general>
|
| 316 |
<logger>
|
| 317 |
<mail_subject>Api Alert</mail_subject>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Bluesnap_Payment>
|
| 5 |
+
<version>2.0.3.2</version>
|
| 6 |
</Bluesnap_Payment>
|
| 7 |
</modules>
|
| 8 |
|
| 255 |
</modules>
|
| 256 |
</translate>
|
| 257 |
<events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
<sales_order_grid_collection_load_before_>
|
| 259 |
<observers>
|
| 260 |
<bluesnap_sales_order_grid_collection_load_before>
|
| 303 |
<general>
|
| 304 |
<protection_key backend_model="adminhtml/system_config_backend_encrypted"/>
|
| 305 |
<api_password backend_model="adminhtml/system_config_backend_encrypted"/>
|
| 306 |
+
<bluesnap_general_is_sandbox_mode>1</bluesnap_general_is_sandbox_mode>
|
| 307 |
+
<include_jquery>0</include_jquery>
|
| 308 |
</general>
|
| 309 |
<logger>
|
| 310 |
<mail_subject>Api Alert</mail_subject>
|
app/code/community/Bluesnap/Payment/etc/system.xml
CHANGED
|
@@ -191,6 +191,16 @@
|
|
| 191 |
<show_in_website>1</show_in_website>
|
| 192 |
<show_in_store>1</show_in_store>
|
| 193 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
<store_id translate="label" module="bluesnap">
|
| 195 |
<label>Store ID</label>
|
| 196 |
<comment>Store id provided by BlueSnap when you signed up for an account.</comment>
|
|
@@ -241,7 +251,9 @@
|
|
| 241 |
<show_in_store>0</show_in_store>
|
| 242 |
<validate>validate-number</validate>
|
| 243 |
</order_contract_id>
|
|
|
|
| 244 |
<is_sandbox_mode translate="label" module="bluesnap">
|
|
|
|
| 245 |
<label>Sandbox Mode</label>
|
| 246 |
<comment>Place BlueSnap payment gateway in testing (sandbox) mode</comment>
|
| 247 |
<frontend_type>select</frontend_type>
|
|
@@ -283,7 +295,7 @@
|
|
| 283 |
|
| 284 |
</display_base_currency_to_customer>
|
| 285 |
|
| 286 |
-
|
| 287 |
<label>Callback Url</label>
|
| 288 |
<comment>Back to seller url.</comment>
|
| 289 |
<frontend_type>text</frontend_type>
|
|
@@ -292,9 +304,18 @@
|
|
| 292 |
<show_in_website>1</show_in_website>
|
| 293 |
<show_in_store>0</show_in_store>
|
| 294 |
|
| 295 |
-
</callback_url>
|
| 296 |
-
|
| 297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
</fields>
|
| 299 |
</general>
|
| 300 |
<logger translate="label" module="bluesnap">
|
| 191 |
<show_in_website>1</show_in_website>
|
| 192 |
<show_in_store>1</show_in_store>
|
| 193 |
<fields>
|
| 194 |
+
<merchant_id translate="label" module="bluesnap">
|
| 195 |
+
<label>Merchant ID</label>
|
| 196 |
+
<comment>Merchant id provided by BlueSnap.</comment>
|
| 197 |
+
<frontend_type>text</frontend_type>
|
| 198 |
+
<sort_order>10</sort_order>
|
| 199 |
+
<show_in_default>1</show_in_default>
|
| 200 |
+
<show_in_website>1</show_in_website>
|
| 201 |
+
<show_in_store>0</show_in_store>
|
| 202 |
+
<validate>validate-number</validate>
|
| 203 |
+
</merchant_id>
|
| 204 |
<store_id translate="label" module="bluesnap">
|
| 205 |
<label>Store ID</label>
|
| 206 |
<comment>Store id provided by BlueSnap when you signed up for an account.</comment>
|
| 251 |
<show_in_store>0</show_in_store>
|
| 252 |
<validate>validate-number</validate>
|
| 253 |
</order_contract_id>
|
| 254 |
+
|
| 255 |
<is_sandbox_mode translate="label" module="bluesnap">
|
| 256 |
+
<backend_model>bluesnap/sslvalidation</backend_model>
|
| 257 |
<label>Sandbox Mode</label>
|
| 258 |
<comment>Place BlueSnap payment gateway in testing (sandbox) mode</comment>
|
| 259 |
<frontend_type>select</frontend_type>
|
| 295 |
|
| 296 |
</display_base_currency_to_customer>
|
| 297 |
|
| 298 |
+
<!-- <callback_url translate="label" module="bluesnap">
|
| 299 |
<label>Callback Url</label>
|
| 300 |
<comment>Back to seller url.</comment>
|
| 301 |
<frontend_type>text</frontend_type>
|
| 304 |
<show_in_website>1</show_in_website>
|
| 305 |
<show_in_store>0</show_in_store>
|
| 306 |
|
| 307 |
+
</callback_url> -->
|
|
|
|
| 308 |
|
| 309 |
+
<include_jquery translate="label" module="bluesnap">
|
| 310 |
+
<label>Include jQuery library</label>
|
| 311 |
+
<frontend_type>select</frontend_type>
|
| 312 |
+
<sort_orer>60</sort_orer>
|
| 313 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 314 |
+
<show_in_default>1</show_in_default>
|
| 315 |
+
<show_in_website>1</show_in_website>
|
| 316 |
+
<show_in_store>1</show_in_store>
|
| 317 |
+
<comment>Bluesnap requires this library to be installed in order to run transactions successfully. If you do not have this library already installed as part of an existing plugin or extension, please select "Yes"</comment>
|
| 318 |
+
</include_jquery>
|
| 319 |
</fields>
|
| 320 |
</general>
|
| 321 |
<logger translate="label" module="bluesnap">
|
app/code/community/Bluesnap/Payment/sql/bluesnap_setup/mysql4-upgrade-1.0.2-1.0.3.php
CHANGED
|
@@ -6,8 +6,8 @@ $installer = $this;
|
|
| 6 |
$installer->startSetup();
|
| 7 |
|
| 8 |
$installer->run(
|
| 9 |
-
"DROP TABLE IF EXISTS
|
| 10 |
-
CREATE TABLE
|
| 11 |
`event_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
| 12 |
`request` text,
|
| 13 |
`response` text,
|
| 6 |
$installer->startSetup();
|
| 7 |
|
| 8 |
$installer->run(
|
| 9 |
+
"DROP TABLE IF EXISTS ".$installer->getTable('bluesnap/logger').";
|
| 10 |
+
CREATE TABLE ".$installer->getTable('bluesnap/logger')." (
|
| 11 |
`event_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
| 12 |
`request` text,
|
| 13 |
`response` text,
|
app/code/community/Bluesnap/Payment/sql/bluesnap_setup/mysql4-upgrade-1.0.3-1.0.4.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
$installer = $this;
|
| 4 |
-
$installer->startSetup();
|
| 5 |
-
|
| 6 |
-
$installer->getConnection()
|
| 7 |
-
->addColumn($installer->getTable('bluesnap/logger'), 'request_url', array(
|
| 8 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
| 9 |
-
'nullable' => false,
|
| 10 |
-
'length' => 255,
|
| 11 |
-
'comment' => 'request url'
|
| 12 |
-
));
|
| 13 |
-
|
| 14 |
$installer->endSetup();
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$installer = $this;
|
| 4 |
+
$installer->startSetup();
|
| 5 |
+
|
| 6 |
+
$installer->getConnection()
|
| 7 |
+
->addColumn($installer->getTable('bluesnap/logger'), 'request_url', array(
|
| 8 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
| 9 |
+
'nullable' => false,
|
| 10 |
+
'length' => 255,
|
| 11 |
+
'comment' => 'request url'
|
| 12 |
+
));
|
| 13 |
+
|
| 14 |
$installer->endSetup();
|
app/design/frontend/base/default/layout/bluesnap/payment.xml
CHANGED
|
@@ -74,46 +74,47 @@
|
|
| 74 |
</reference>
|
| 75 |
</bluesnap_checkout_callback>
|
| 76 |
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
</action>
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
<action method="addItem">
|
| 91 |
-
<type>skin_js</type>
|
| 92 |
-
<name>js/bluesnap/payform.js</name>
|
| 93 |
-
</action>
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
<action method="addItem">
|
| 100 |
-
<type>js_css</type>
|
| 101 |
-
<name>lib/jquery/jquery-ui/jquery-ui.css</name>
|
| 102 |
-
</action>
|
| 103 |
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
<
|
| 107 |
-
<![CDATA[<script type="text/javascript" src="https://gateway.bluesnap.com/js/cse/v1.0.2/bluesnap.js"></script>]]>
|
| 108 |
-
</text>
|
| 109 |
</action>
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
</layout>
|
| 74 |
</reference>
|
| 75 |
</bluesnap_checkout_callback>
|
| 76 |
|
| 77 |
+
<checkout_onepage_index>
|
| 78 |
+
<reference name="head">
|
| 79 |
+
<action method="addItem">
|
| 80 |
+
<type>skin_css</type>
|
| 81 |
+
<name>css/bluesnap/buynow/checkout.css</name>
|
| 82 |
+
</action>
|
|
|
|
| 83 |
|
| 84 |
+
<action method="addItem">
|
| 85 |
+
<type>skin_js</type>
|
| 86 |
+
<name>js/bluesnap/credit-card-detect.js</name>
|
| 87 |
+
</action>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
<action method="addItem">
|
| 90 |
+
<type>skin_js</type>
|
| 91 |
+
<name>js/bluesnap/payform.js</name>
|
| 92 |
+
</action>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
+
<action method="addItem" ifconfig="bluesnap/general/include_jquery">
|
| 95 |
+
<type>js</type>
|
| 96 |
+
<name>lib/jquery/jquery-3.0.0.min.js</name>
|
|
|
|
|
|
|
| 97 |
</action>
|
| 98 |
+
<action method="addItem" ifconfig="bluesnap/general/include_jquery">
|
| 99 |
+
<type>js</type>
|
| 100 |
+
<name>lib/jquery/bluesnap-noconflict.js</name>
|
| 101 |
+
</action>
|
| 102 |
+
<action method="addItem">
|
| 103 |
+
<type>js</type>
|
| 104 |
+
<name>lib/jquery/jquery-ui/jquery-ui.js</name>
|
| 105 |
+
</action>
|
| 106 |
+
<action method="addItem">
|
| 107 |
+
<type>js_css</type>
|
| 108 |
+
<name>lib/jquery/jquery-ui/jquery-ui.css</name>
|
| 109 |
+
</action>
|
| 110 |
|
| 111 |
+
<block type="core/text" name="bluesnap.cse">
|
| 112 |
+
<action method="setText">
|
| 113 |
+
<text>
|
| 114 |
+
<![CDATA[<script type="text/javascript" src="https://gateway.bluesnap.com/js/cse/v1.0.2/bluesnap.js"></script>]]>
|
| 115 |
+
</text>
|
| 116 |
+
</action>
|
| 117 |
+
</block>
|
| 118 |
+
</reference>
|
| 119 |
+
</checkout_onepage_index>
|
| 120 |
</layout>
|
app/design/frontend/base/default/template/bluesnap/payment/form/cse.phtml
CHANGED
|
@@ -2,41 +2,155 @@
|
|
| 2 |
/**
|
| 3 |
* @see Bluesnap_Payment_Block_Payment_Form_Cse
|
| 4 |
* @var $this Bluesnap_Payment_Block_Payment_Form_Cse
|
| 5 |
-
* //http://getspritexy.com/
|
| 6 |
*/
|
| 7 |
?>
|
| 8 |
-
|
| 9 |
<?php $_code = $this->getMethodCode() ?>
|
| 10 |
-
<?php
|
| 11 |
-
$cards = $this->getCards() ?>
|
| 12 |
-
|
| 13 |
-
<script type="text/javascript">// <![CDATA[
|
| 14 |
-
jQuery( document ).ready(function($) {
|
| 15 |
-
$('#cse_cc_number').creditCardType();
|
| 16 |
-
$( ".tooltip" ).tooltip(
|
| 17 |
-
{
|
| 18 |
-
position: { my: 'center bottom', at: 'center top-10' },
|
| 19 |
-
show: { effect: "fade", duration: 800 }
|
| 20 |
-
}
|
| 21 |
-
);
|
| 22 |
-
});
|
| 23 |
-
// jQuery.$.widget.tooltip.prototype.options.duration=800;
|
| 24 |
-
// jQuery.$.widget.tooltip.prototype.options.effect='fadeIn';
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
function removeSpaceCc(el){
|
| 27 |
var val = el.value.replace(/\s/g, "");
|
| 28 |
document.getElementById("cse_cc_number").value=val;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
// ]]></script>
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 40 |
|
| 41 |
<?php if (count($cards)): ?>
|
| 42 |
<li>
|
|
@@ -54,7 +168,7 @@ $cards = $this->getCards() ?>
|
|
| 54 |
</li>
|
| 55 |
<?php endforeach ?>
|
| 56 |
<li><a href="#"
|
| 57 |
-
onclick="$('card-form').show();$('no_saved_card').checked=true;return false;"><?php echo $this->__('Provide another card') ?></a>
|
| 58 |
<input type="radio" name="bluesnap_card_saved" id="no_saved_card" value="no"
|
| 59 |
class="validate-one-required-by-name bluesnap_card_saved" style="display:none"/>
|
| 60 |
</li>
|
|
@@ -62,18 +176,16 @@ $cards = $this->getCards() ?>
|
|
| 62 |
</li>
|
| 63 |
<?php endif ?>
|
| 64 |
<li>
|
| 65 |
-
<ul id="card-form"
|
| 66 |
|
| 67 |
<?php
|
| 68 |
$showCcTypesDropdown = $this->getMethod()->getConfigData('show_cctypes_dropdown'); ?>
|
| 69 |
|
| 70 |
<li style="display:<?php echo $showCcTypesDropdown ? 'block':'none'?>">
|
| 71 |
-
<label for="<?php echo $_code ?>_cc_type"
|
| 72 |
-
class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
| 73 |
|
| 74 |
<div class="input-box">
|
| 75 |
-
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]"
|
| 76 |
-
class="required-entry validate-cc-type-select">
|
| 77 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
| 78 |
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
| 79 |
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
|
@@ -114,20 +226,13 @@ $cards = $this->getCards() ?>
|
|
| 114 |
|
| 115 |
<input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]"
|
| 116 |
title="<?php echo $this->__('Credit Card Number') ?>"
|
| 117 |
-
class="input-text required-entry validate-
|
| 118 |
-
data-bluesnap="encryptedCreditCard" onchange="
|
| 119 |
|
| 120 |
/>
|
| 121 |
<span id="cse_cc_number_valid" class="pli-cc pli-cc-valid" style="display: none;" ></span>
|
| 122 |
<span id="cse_cc_number_not_valid" class="pli-cc pli-cc-not-valid tooltip" style="display: none;"
|
| 123 |
-
title="<?php echo $this->__("Card Number should be between 12 and 21 characters long")?>"
|
| 124 |
-
></span>
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
|
| 132 |
|
| 133 |
<input type="hidden" name="<?php echo $_code ?>_cc_last" id="<?php echo $_code ?>_cc_last" value=""/>
|
|
@@ -147,8 +252,6 @@ $cards = $this->getCards() ?>
|
|
| 147 |
<?php endforeach ?>
|
| 148 |
</select>
|
| 149 |
|
| 150 |
-
|
| 151 |
-
></span>
|
| 152 |
</div>
|
| 153 |
<div class="v-fix">
|
| 154 |
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
|
@@ -175,15 +278,13 @@ $cards = $this->getCards() ?>
|
|
| 175 |
<div class="input-box">
|
| 176 |
<div class="v-fix">
|
| 177 |
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>"
|
| 178 |
-
class="input-text cvv
|
| 179 |
id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" data-bluesnap="encryptedCvv"
|
| 180 |
-
value=""/>
|
| 181 |
|
| 182 |
<span id="cse_cc_cid_valid" class="pli-cc pli-cc-valid" style="display: none;" ></span>
|
| 183 |
<span id="cse_cc_cid_not_valid" class="pli-cc pli-cc-not-valid tooltip" style="display: none;"
|
| 184 |
-
title="<?php echo $this->__("Security Code should be between 3 and 4 characters long")?>"
|
| 185 |
-
|
| 186 |
-
></span>
|
| 187 |
|
| 188 |
</div>
|
| 189 |
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
|
@@ -191,65 +292,77 @@ $cards = $this->getCards() ?>
|
|
| 191 |
</li>
|
| 192 |
<?php endif; ?>
|
| 193 |
</ul>
|
| 194 |
-
|
| 195 |
-
|
|
|
|
| 196 |
</iframe>
|
| 197 |
</li>
|
| 198 |
</ul>
|
| 199 |
-
<script type="text/javascript">
|
| 200 |
-
//<![CDATA[
|
| 201 |
-
Payment.addMethods({
|
| 202 |
-
save: function () {
|
| 203 |
-
if (checkout.loadWaiting != false) return;
|
| 204 |
-
|
| 205 |
-
if (payment.currentMethod == 'cse') {
|
| 206 |
-
var saved_card = $$('input:checked[type=radio][name=bluesnap_card_saved]');
|
| 207 |
-
if (saved_card.length) {
|
| 208 |
-
var card_saved_value = saved_card[0].value;
|
| 209 |
-
if (card_saved_value == 'no' && $('<?php echo $_code ?>_cc_number').value.length < 12) {
|
| 210 |
-
// alert('<?php echo $this->__('Card was not selected')?>');
|
| 211 |
-
// checkout.loadWaiting = false;
|
| 212 |
-
//return;
|
| 213 |
-
}
|
| 214 |
-
}
|
| 215 |
-
}
|
| 216 |
-
|
| 217 |
-
jQuery("#cse_cc_type_valid").hide();
|
| 218 |
-
jQuery("#cse_cc_type_not_valid").hide();
|
| 219 |
-
|
| 220 |
-
jQuery("#cse_cc_number_valid").hide();
|
| 221 |
-
jQuery("#cse_cc_number_not_valid").hide();
|
| 222 |
-
|
| 223 |
-
jQuery("#cse_cc_expiration_valid").hide();
|
| 224 |
-
jQuery("#cse_cc_expiration_not_valid").hide();
|
| 225 |
-
|
| 226 |
-
jQuery("#cse_cc_cid_valid").hide();
|
| 227 |
-
jQuery("#cse_cc_cid_not_valid").hide();
|
| 228 |
-
|
| 229 |
-
var validator = new Validation(this.form);
|
| 230 |
-
//BSNPMG-108 dc validation fix https://github.com/Adyen/magento/commit/55095cbd6078fa9420490600ed1c9a3d3d1c173b
|
| 231 |
-
Validation.creditCartTypes.set('DC', [new RegExp('^3(?:0[0-5]|[68][0-9])[0-9]{11}$'), new RegExp('^[0-9]{3}$'), true]);
|
| 232 |
-
Validation.creditCartTypes.set('CB', [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true]);
|
| 233 |
-
|
| 234 |
-
if (this.validate() && validator.validate()) {
|
| 235 |
-
checkout.setLoadWaiting('payment');
|
| 236 |
-
var bsnp = new BlueSnap('<?php echo $this->getpublicKey()?>');
|
| 237 |
-
bsnp.encrypt('co-payment-form');
|
| 238 |
-
$('<?php echo $_code?>_cc_last').value = $('<?php echo $_code ?>_cc_number').value.substr(-4);
|
| 239 |
-
var request = new Ajax.Request(
|
| 240 |
-
this.saveUrl,
|
| 241 |
-
{
|
| 242 |
-
method: 'post',
|
| 243 |
-
onComplete: this.onComplete,
|
| 244 |
-
onSuccess: this.onSave,
|
| 245 |
-
onFailure: checkout.ajaxFailure.bind(checkout),
|
| 246 |
-
parameters: Form.serialize(this.form)
|
| 247 |
-
}
|
| 248 |
-
);
|
| 249 |
-
}
|
| 250 |
-
}
|
| 251 |
-
});
|
| 252 |
-
//]]>
|
| 253 |
-
</script>
|
| 254 |
<style type="text/css">#payment-tool-tip{background:#FFFFFF;padding:4px;position: absolute;border: 1px solid #aaa;border-radius: 5px;}</style>
|
| 255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
/**
|
| 3 |
* @see Bluesnap_Payment_Block_Payment_Form_Cse
|
| 4 |
* @var $this Bluesnap_Payment_Block_Payment_Form_Cse
|
|
|
|
| 5 |
*/
|
| 6 |
?>
|
|
|
|
| 7 |
<?php $_code = $this->getMethodCode() ?>
|
| 8 |
+
<?php $cards = $this->getCards() ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
<script type="text/javascript">
|
| 11 |
+
CreditCartScriptLoaded = false;
|
| 12 |
+
|
| 13 |
+
// load scripts if they are not available
|
| 14 |
+
|
| 15 |
+
if(typeof BlueSnap == "undefined") {
|
| 16 |
+
var bluesnap = document.createElement('script');
|
| 17 |
+
bluesnap.type = 'text/javascript';
|
| 18 |
+
bluesnap.src = 'https://gateway.bluesnap.com/js/cse/v1.0.2/bluesnap.js';
|
| 19 |
+
document.head.appendChild(bluesnap);
|
| 20 |
+
|
| 21 |
+
var creditcard = document.createElement('script');
|
| 22 |
+
creditcard.type = 'text/javascript';
|
| 23 |
+
creditcard.src = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>js/bluesnap/credit-card-detect.js';
|
| 24 |
+
document.head.appendChild(creditcard);
|
| 25 |
+
|
| 26 |
+
var payformSourceFile = document.createElement('script');
|
| 27 |
+
payformSourceFile.type = 'text/javascript';
|
| 28 |
+
payformSourceFile.src = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>js/bluesnap/payform.js';
|
| 29 |
+
|
| 30 |
+
document.head.appendChild(payformSourceFile);
|
| 31 |
+
|
| 32 |
+
var jqueryui = document.createElement('script');
|
| 33 |
+
jqueryui.type = 'text/javascript';
|
| 34 |
+
jqueryui.src = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>js/lib/jquery/jquery-ui/jquery-ui.js';
|
| 35 |
+
|
| 36 |
+
document.head.appendChild(jqueryui);
|
| 37 |
+
|
| 38 |
+
var checkout = document.createElement('link');
|
| 39 |
+
checkout.rel = 'stylesheet';
|
| 40 |
+
checkout.type = 'text/css';
|
| 41 |
+
checkout.media = 'all';
|
| 42 |
+
checkout.href = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>skin/frontend/base/default/css/bluesnap/buynow/checkout.css';
|
| 43 |
+
|
| 44 |
+
document.head.appendChild(checkout);
|
| 45 |
+
|
| 46 |
+
var jquerycss = document.createElement('link');
|
| 47 |
+
jquerycss.rel = 'stylesheet';
|
| 48 |
+
jquerycss.type = 'text/css';
|
| 49 |
+
jquerycss.media = 'all';
|
| 50 |
+
jquerycss.href = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>js/lib/jquery/jquery-ui/jquery-ui.css';
|
| 51 |
+
|
| 52 |
+
document.getElementsByTagName('head')[0].appendChild(jquerycss);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
// Add new cc types to magento validation
|
| 56 |
+
|
| 57 |
+
Validation.creditCartTypes.set('DC', [new RegExp('^3(?:0[0-5]|[68][0-9])[0-9]{11}$'), new RegExp('^[0-9]{3}$'), true]);
|
| 58 |
+
Validation.creditCartTypes.set('CB', [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true]);
|
| 59 |
+
|
| 60 |
+
// load cc validation jquery plugin
|
| 61 |
+
|
| 62 |
+
var loading = jQuery.getScript('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>js/bluesnap/credit-card-detect.js');
|
| 63 |
+
|
| 64 |
+
jQuery.when( loading ).then(function() {
|
| 65 |
+
jQuery.creditCardType();
|
| 66 |
+
jQuery("#<?php echo $_code ?>_cc_number").blur(function(){
|
| 67 |
+
removeSpaceCc(this);
|
| 68 |
+
bsencrypt(this);
|
| 69 |
+
});
|
| 70 |
+
|
| 71 |
+
});
|
| 72 |
+
jQuery(document).ready(function($) {
|
| 73 |
+
var loading = jQuery.getScript('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>js/bluesnap/credit-card-detect.js');
|
| 74 |
+
|
| 75 |
+
jQuery.when( loading ).then(function() {
|
| 76 |
+
jQuery.creditCardType();
|
| 77 |
+
jQuery("#<?php echo $_code ?>_cc_number").blur(function(){
|
| 78 |
+
removeSpaceCc(this);
|
| 79 |
+
bsencrypt(this);
|
| 80 |
+
});
|
| 81 |
+
|
| 82 |
+
});
|
| 83 |
+
if(typeof jQuery.fn.tooltip != 'undefined') {
|
| 84 |
+
jQuery( ".tooltip" ).tooltip(
|
| 85 |
+
{
|
| 86 |
+
position: { my: 'center bottom', at: 'center top-10' },
|
| 87 |
+
show: { effect: "fade", duration: 800 }
|
| 88 |
+
}
|
| 89 |
+
);
|
| 90 |
+
}
|
| 91 |
+
<?php if (count($cards)):?>$('card-form').hide();<?php endif?>
|
| 92 |
+
|
| 93 |
+
jQuery('.bluesnap-payment-container').bind("DOMSubtreeModified",function(){
|
| 94 |
+
var findEl = jQuery(".bluesnap-payment-container .opc-cc-list");
|
| 95 |
+
if(findEl.length > 0) {
|
| 96 |
+
findEl.parent().parent().hide();
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
if(jQuery(".ssl-placeholder").length > 1) {
|
| 100 |
+
for(i=1; i <= jQuery(".ssl-placeholder").length; i++) {
|
| 101 |
+
var item = jQuery(".ssl-placeholder")[i];
|
| 102 |
+
jQuery(item).hide();
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
});
|
| 106 |
+
|
| 107 |
+
});
|
| 108 |
+
|
| 109 |
function removeSpaceCc(el){
|
| 110 |
var val = el.value.replace(/\s/g, "");
|
| 111 |
document.getElementById("cse_cc_number").value=val;
|
| 112 |
+
if(document.getElementById("cse_cc_type").value==''){
|
| 113 |
+
var creditCardType = payform.parseCardType(val);
|
| 114 |
+
switch(creditCardType) {
|
| 115 |
+
case 'visa':
|
| 116 |
+
jQuery('.pli-cc-VISA').addClass('pli-active');
|
| 117 |
+
jQuery("select[id=cse_cc_type]").val('VI');
|
| 118 |
+
break;
|
| 119 |
+
case 'mastercard':
|
| 120 |
+
jQuery('.pli-cc-MASTERCARD').addClass('pli-active');
|
| 121 |
+
jQuery("select[id=cse_cc_type]").val('MC');
|
| 122 |
+
break;
|
| 123 |
+
case 'amex':
|
| 124 |
+
jQuery('.pli-cc-AMEX').addClass('pli-active');
|
| 125 |
+
jQuery("select[id=cse_cc_type]").val('AE');
|
| 126 |
+
break;
|
| 127 |
+
case 'discover':
|
| 128 |
+
jQuery('.pli-cc-DISCOVER').addClass('pli-active');
|
| 129 |
+
jQuery("select[id=cse_cc_type]").val('DI');
|
| 130 |
+
break;
|
| 131 |
+
case 'jcb':
|
| 132 |
+
jQuery('.pli-cc-JCB').addClass('pli-active');
|
| 133 |
+
jQuery("select[id=cse_cc_type]").val('JCB');
|
| 134 |
+
break;
|
| 135 |
+
case 'dinersclub':
|
| 136 |
+
jQuery('.pli-cc-DINERS').addClass('pli-active');
|
| 137 |
+
jQuery("select[id=cse_cc_type]").val('DC');
|
| 138 |
+
break;
|
| 139 |
+
case 'carteblue':
|
| 140 |
+
jQuery('.pli-cc-CARTE_BLEUE').addClass('pli-active');
|
| 141 |
+
jQuery("select[id=cse_cc_type]").val('CB');
|
| 142 |
+
break;
|
| 143 |
+
};
|
| 144 |
+
|
| 145 |
+
if(jQuery(".validation-advice")) {
|
| 146 |
+
jQuery(".validation-advice").hide();
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
}
|
| 150 |
}
|
| 151 |
+
</script>
|
| 152 |
|
| 153 |
+
<ul class="form-list bluesnap-payment-container" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
<?php if (count($cards)): ?>
|
| 156 |
<li>
|
| 168 |
</li>
|
| 169 |
<?php endforeach ?>
|
| 170 |
<li><a href="#"
|
| 171 |
+
onclick="$('card-form').show();$('card-form').removeClassName('no-display');$('no_saved_card').checked=true;jQuery('#cse_cc_number').creditCardType();return false;"><?php echo $this->__('Provide another card') ?></a>
|
| 172 |
<input type="radio" name="bluesnap_card_saved" id="no_saved_card" value="no"
|
| 173 |
class="validate-one-required-by-name bluesnap_card_saved" style="display:none"/>
|
| 174 |
</li>
|
| 176 |
</li>
|
| 177 |
<?php endif ?>
|
| 178 |
<li>
|
| 179 |
+
<ul id="card-form"<?php if (count($cards)):?> class="no-display"<?php endif?> <?php if (count($cards)):?>style="display:none;"<?php endif?>>
|
| 180 |
|
| 181 |
<?php
|
| 182 |
$showCcTypesDropdown = $this->getMethod()->getConfigData('show_cctypes_dropdown'); ?>
|
| 183 |
|
| 184 |
<li style="display:<?php echo $showCcTypesDropdown ? 'block':'none'?>">
|
| 185 |
+
<label for="<?php echo $_code ?>_cc_type"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
|
|
|
| 186 |
|
| 187 |
<div class="input-box">
|
| 188 |
+
<select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]">
|
|
|
|
| 189 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
| 190 |
<?php $_ccType = $this->getInfoData('cc_type') ?>
|
| 191 |
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
| 226 |
|
| 227 |
<input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]"
|
| 228 |
title="<?php echo $this->__('Credit Card Number') ?>"
|
| 229 |
+
class="input-text required-entry validate-cc-number" value=""
|
| 230 |
+
data-bluesnap="encryptedCreditCard" onchange="removeSpaceCc(this);if (typeof bsencrypt == 'function') bsencrypt(this);"
|
| 231 |
|
| 232 |
/>
|
| 233 |
<span id="cse_cc_number_valid" class="pli-cc pli-cc-valid" style="display: none;" ></span>
|
| 234 |
<span id="cse_cc_number_not_valid" class="pli-cc pli-cc-not-valid tooltip" style="display: none;"
|
| 235 |
+
title="<?php echo $this->__("Card Number should be between 12 and 21 characters long")?>"></span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
|
| 237 |
|
| 238 |
<input type="hidden" name="<?php echo $_code ?>_cc_last" id="<?php echo $_code ?>_cc_last" value=""/>
|
| 252 |
<?php endforeach ?>
|
| 253 |
</select>
|
| 254 |
|
|
|
|
|
|
|
| 255 |
</div>
|
| 256 |
<div class="v-fix">
|
| 257 |
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
| 278 |
<div class="input-box">
|
| 279 |
<div class="v-fix">
|
| 280 |
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>"
|
| 281 |
+
class="input-text cvv validate-cc-cvn required-entry"
|
| 282 |
id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" data-bluesnap="encryptedCvv"
|
| 283 |
+
value="" onchange="if (typeof bsencrypt == 'function') bsencrypt(this);"/>
|
| 284 |
|
| 285 |
<span id="cse_cc_cid_valid" class="pli-cc pli-cc-valid" style="display: none;" ></span>
|
| 286 |
<span id="cse_cc_cid_not_valid" class="pli-cc pli-cc-not-valid tooltip" style="display: none;"
|
| 287 |
+
title="<?php echo $this->__("Security Code should be between 3 and 4 characters long")?>"></span>
|
|
|
|
|
|
|
| 288 |
|
| 289 |
</div>
|
| 290 |
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
| 292 |
</li>
|
| 293 |
<?php endif; ?>
|
| 294 |
</ul>
|
| 295 |
+
<?php $storeId = Mage::app()->getStore()->getStoreId();?>
|
| 296 |
+
<iframe width='1' height='1' frameborder='0' scrolling='no' src='https://www.bluesnap.com/servlet/logo.htm?d=<?php echo $configValue = Mage::getStoreConfig('bluesnap/general/merchant_id', $storeId);?>&s=<?php echo Mage::getSingleton('checkout/session')->getSessionId()?>'>
|
| 297 |
+
<img width='1' height='1' src='https://www.bluesnap.com/logo.gif?d=<?php echo $configValue = Mage::getStoreConfig('bluesnap/general/merchant_id', $storeId);?>&s=<?php echo Mage::getSingleton('checkout/session')->getSessionId()?>'>
|
| 298 |
</iframe>
|
| 299 |
</li>
|
| 300 |
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
<style type="text/css">#payment-tool-tip{background:#FFFFFF;padding:4px;position: absolute;border: 1px solid #aaa;border-radius: 5px;}</style>
|
| 302 |
+
<script type="text/javascript">
|
| 303 |
+
if (typeof Payment !== 'undefined') {
|
| 304 |
+
// the Payment is defined
|
| 305 |
+
|
| 306 |
+
Payment.addMethods({
|
| 307 |
+
save: function () {
|
| 308 |
+
if (checkout.loadWaiting != false) return;
|
| 309 |
+
|
| 310 |
+
if (payment.currentMethod == 'cse') {
|
| 311 |
+
var saved_card = $$('input:checked[type=radio][name=bluesnap_card_saved]');
|
| 312 |
+
if (saved_card.length) {
|
| 313 |
+
var card_saved_value = saved_card[0].value;
|
| 314 |
+
if (card_saved_value == 'no' && $('<?php echo $_code ?>_cc_number').value.length < 12) {
|
| 315 |
+
// alert('<?php echo $this->__('Card was not selected')?>');
|
| 316 |
+
// checkout.loadWaiting = false;
|
| 317 |
+
//return;
|
| 318 |
+
}
|
| 319 |
+
}
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
jQuery("#cse_cc_type_valid").hide();
|
| 323 |
+
jQuery("#cse_cc_type_not_valid").hide();
|
| 324 |
+
|
| 325 |
+
jQuery("#cse_cc_number_valid").hide();
|
| 326 |
+
jQuery("#cse_cc_number_not_valid").hide();
|
| 327 |
+
|
| 328 |
+
jQuery("#cse_cc_expiration_valid").hide();
|
| 329 |
+
jQuery("#cse_cc_expiration_not_valid").hide();
|
| 330 |
+
|
| 331 |
+
jQuery("#cse_cc_cid_valid").hide();
|
| 332 |
+
jQuery("#cse_cc_cid_not_valid").hide();
|
| 333 |
+
|
| 334 |
+
var validator = new Validation(this.form);
|
| 335 |
+
//BSNPMG-108 dc validation fix https://github.com/Adyen/magento/commit/55095cbd6078fa9420490600ed1c9a3d3d1c173b
|
| 336 |
+
if (this.validate() && validator.validate()) {
|
| 337 |
+
checkout.setLoadWaiting('payment');
|
| 338 |
+
var bsnp = new BlueSnap('<?php echo $this->getpublicKey()?>');
|
| 339 |
+
bsnp.encrypt('co-payment-form');
|
| 340 |
+
$('<?php echo $_code?>_cc_last').value = $('<?php echo $_code ?>_cc_number').value.substr(-4);
|
| 341 |
+
var request = new Ajax.Request(
|
| 342 |
+
this.saveUrl,
|
| 343 |
+
{
|
| 344 |
+
method: 'post',
|
| 345 |
+
onComplete: this.onComplete,
|
| 346 |
+
onSuccess: this.onSave,
|
| 347 |
+
onFailure: checkout.ajaxFailure.bind(checkout),
|
| 348 |
+
parameters: Form.serialize(this.form)
|
| 349 |
+
}
|
| 350 |
+
);
|
| 351 |
+
}
|
| 352 |
+
}
|
| 353 |
+
});
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
function bsencrypt(el){
|
| 357 |
+
// var bskey = $('bspubkey').value;
|
| 358 |
+
var bsnp = new BlueSnap('<?php echo $this->getpublicKey()?>');
|
| 359 |
+
|
| 360 |
+
<?php if(Mage::registry('bluesnap_disable_encryption')) : ?>
|
| 361 |
+
// bsnp.encrypt(el.up('form').id);
|
| 362 |
+
<?php else : ?>
|
| 363 |
+
bsnp.encrypt(el.up('form').id);
|
| 364 |
+
<?php endif; ?>
|
| 365 |
+
$('<?php echo $_code?>_cc_last').value = $('<?php echo $_code ?>_cc_number').value.substr(-4);
|
| 366 |
+
};
|
| 367 |
+
|
| 368 |
+
</script>
|
js/bluesnap/credit-card-detect.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(function($) {
|
| 2 |
+
//https://github.com/jessepollak/card/blob/master/lib/js/jquery.card.js
|
| 3 |
+
//https://github.com/jondavidjohn/payform#custom-cards
|
| 4 |
+
$.validateCreditCard = function(number,month,year,type) {
|
| 5 |
+
return payform.validateCardNumber(number) && payform.validateCardExpiry(month, year) && payform.validateCardCVC(cvc, type);
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
$.getCreditCardType = function(val) {
|
| 9 |
+
return payform.parseCardType(val);
|
| 10 |
+
};
|
| 11 |
+
|
| 12 |
+
$.creditCardType = function(options) {
|
| 13 |
+
//formatter
|
| 14 |
+
//https://learn.jquery.com/using-jquery-core/faq/how-do-i-pull-a-native-dom-element-from-a-jquery-object/
|
| 15 |
+
|
| 16 |
+
var settings = {
|
| 17 |
+
target: '#credit-card-type'
|
| 18 |
+
};
|
| 19 |
+
|
| 20 |
+
if(options) {
|
| 21 |
+
$.extend(settings, options);
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
var ccNumberKeyupHandler = function() {
|
| 25 |
+
$(".pli-credit-cards span").removeClass("pli-active");
|
| 26 |
+
$("select[id=cse_cc_type]").val('');
|
| 27 |
+
creditCardType=$.getCreditCardType($(this).val());
|
| 28 |
+
|
| 29 |
+
switch(creditCardType) {
|
| 30 |
+
case 'visa':
|
| 31 |
+
$('.pli-cc-VISA').addClass('pli-active');
|
| 32 |
+
$("select[id=cse_cc_type]").val('VI');
|
| 33 |
+
break;
|
| 34 |
+
case 'mastercard':
|
| 35 |
+
$('.pli-cc-MASTERCARD').addClass('pli-active');
|
| 36 |
+
$("select[id=cse_cc_type]").val('MC');
|
| 37 |
+
break;
|
| 38 |
+
case 'amex':
|
| 39 |
+
$('.pli-cc-AMEX').addClass('pli-active');
|
| 40 |
+
$("select[id=cse_cc_type]").val('AE');
|
| 41 |
+
break;
|
| 42 |
+
case 'discover':
|
| 43 |
+
$('.pli-cc-DISCOVER').addClass('pli-active');
|
| 44 |
+
$("select[id=cse_cc_type]").val('DI');
|
| 45 |
+
break;
|
| 46 |
+
case 'jcb':
|
| 47 |
+
$('.pli-cc-JCB').addClass('pli-active');
|
| 48 |
+
$("select[id=cse_cc_type]").val('JCB');
|
| 49 |
+
break;
|
| 50 |
+
case 'dinersclub':
|
| 51 |
+
$('.pli-cc-DINERS').addClass('pli-active');
|
| 52 |
+
$("select[id=cse_cc_type]").val('DC');
|
| 53 |
+
break;
|
| 54 |
+
case 'carteblue':
|
| 55 |
+
$('.pli-cc-CARTE_BLEUE').addClass('pli-active');
|
| 56 |
+
$("select[id=cse_cc_type]").val('CB');
|
| 57 |
+
break;
|
| 58 |
+
};
|
| 59 |
+
|
| 60 |
+
if($(".validation-advice")) {
|
| 61 |
+
$(".validation-advice").hide();
|
| 62 |
+
}
|
| 63 |
+
if(payform.validateCardNumber($("input[id=cse_cc_number]").val())) {
|
| 64 |
+
$("input[id=cse_cc_number]")[0].setStyle({'borderColor':'green'});
|
| 65 |
+
} else {
|
| 66 |
+
$("input[id=cse_cc_number]")[0].setStyle({'borderColor':'red'});
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
};
|
| 70 |
+
|
| 71 |
+
var ccCvvKeyupHandler = function() {
|
| 72 |
+
if($('#advice-required-entry-cse_cc_cid')) {
|
| 73 |
+
$('#advice-required-entry-cse_cc_cid').hide();
|
| 74 |
+
}
|
| 75 |
+
var card = payform.cardFromNumber($("input[id=cse_cc_number]").val());
|
| 76 |
+
|
| 77 |
+
if(payform.validateCardCVC($("input[id=cse_cc_cid]").val(), card.type)) {
|
| 78 |
+
$("input[id=cse_cc_cid]")[0].setStyle({'borderColor':'green'});
|
| 79 |
+
|
| 80 |
+
} else {
|
| 81 |
+
$("input[id=cse_cc_cid]")[0].setStyle({'borderColor':'red'});
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
var ccExpChangeHandler = function() {
|
| 87 |
+
if(payform.validateCardExpiry($("select[id=cse_expiration]").val(),$("select[id=cse_expiration_yr]").val())) {
|
| 88 |
+
$("select[id=cse_expiration]")[0].setStyle({'borderColor':'green'});
|
| 89 |
+
$("select[id=cse_expiration_yr]")[0].setStyle({'borderColor':'green'});
|
| 90 |
+
} else {
|
| 91 |
+
$("select[id=cse_expiration]")[0].setStyle({'borderColor':'red'});
|
| 92 |
+
$("select[id=cse_expiration_yr]")[0].setStyle({'borderColor':'red'});
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
var ccNumberBlurHandler = function() {
|
| 99 |
+
if(payform.validateCardNumber($("input[id=cse_cc_number]").val())) {
|
| 100 |
+
$("#cse_cc_number_valid").show();
|
| 101 |
+
$("#cse_cc_number_not_valid").hide();
|
| 102 |
+
|
| 103 |
+
$("#cse_cc_type_valid").show();
|
| 104 |
+
$("#cse_cc_type_not_valid").hide();
|
| 105 |
+
|
| 106 |
+
} else {
|
| 107 |
+
$("#cse_cc_number_valid").hide();
|
| 108 |
+
$("#cse_cc_number_not_valid").show();
|
| 109 |
+
|
| 110 |
+
$("#cse_cc_type_valid").hide();
|
| 111 |
+
$("#cse_cc_type_not_valid").show();
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
var ccCidBlurHandler = function() {
|
| 116 |
+
var card = payform.cardFromNumber($("input[id=cse_cc_number]").val());
|
| 117 |
+
|
| 118 |
+
if(payform.validateCardCVC($("input[id=cse_cc_cid]").val(), card.type)) {
|
| 119 |
+
$("#cse_cc_cid_valid").show();
|
| 120 |
+
$("#cse_cc_cid_not_valid").hide();
|
| 121 |
+
|
| 122 |
+
} else {
|
| 123 |
+
$("#cse_cc_cid_valid").hide();
|
| 124 |
+
$("#cse_cc_cid_not_valid").show();
|
| 125 |
+
|
| 126 |
+
}
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
var ccExpBlurHandler = function() {
|
| 130 |
+
if(payform.validateCardExpiry($("#cse_expiration").val(),$("#cse_expiration_yr").val() ) ) {
|
| 131 |
+
$("#cse_cc_expiration_valid").show();
|
| 132 |
+
$("#cse_cc_expiration_not_valid").hide();
|
| 133 |
+
|
| 134 |
+
} else {
|
| 135 |
+
$("#cse_cc_expiration_valid").hide();
|
| 136 |
+
$("#cse_cc_expiration_not_valid").show();
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
return $("#cse_cc_number").each(function() {
|
| 141 |
+
$(this).on('keyup', ccNumberKeyupHandler);
|
| 142 |
+
$("input[id=cse_cc_cid]").bind('keyup',ccCvvKeyupHandler);
|
| 143 |
+
$("select[id=cse_expiration]").bind('change',ccExpChangeHandler);
|
| 144 |
+
$("select[id=cse_expiration_yr]").bind('change',ccExpChangeHandler);
|
| 145 |
+
|
| 146 |
+
$("input[id=cse_cc_number]").bind('blur',ccNumberBlurHandler);
|
| 147 |
+
$("input[id=cse_cc_cid]").bind('blur',ccCidBlurHandler);
|
| 148 |
+
|
| 149 |
+
$("select[id=cse_expiration]").bind('blur',ccExpBlurHandler);
|
| 150 |
+
$("select[id=cse_expiration_yr]").bind('blur',ccExpBlurHandler);
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
});
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
};
|
| 157 |
+
})(jQuery);
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
function removeSpaceCc(el){
|
| 161 |
+
var val = el.value.replace(/\s/g, "");
|
| 162 |
+
document.getElementById("cse_cc_number").value=val;
|
| 163 |
+
|
| 164 |
+
if(document.getElementById("cse_cc_type").value=='' || payform.parseCardType(val) != getType(document.getElementById("cse_cc_type").value)){
|
| 165 |
+
if(document.getElementById("cse_cc_type").value!='') jQuery(".pli-credit-cards span").removeClass("pli-active");
|
| 166 |
+
var creditCardType = payform.parseCardType(val);
|
| 167 |
+
switch(creditCardType) {
|
| 168 |
+
case 'visa':
|
| 169 |
+
jQuery('.pli-cc-VISA').addClass('pli-active');
|
| 170 |
+
jQuery("select[id=cse_cc_type]").val('VI');
|
| 171 |
+
break;
|
| 172 |
+
case 'mastercard':
|
| 173 |
+
jQuery('.pli-cc-MASTERCARD').addClass('pli-active');
|
| 174 |
+
jQuery("select[id=cse_cc_type]").val('MC');
|
| 175 |
+
break;
|
| 176 |
+
case 'amex':
|
| 177 |
+
jQuery('.pli-cc-AMEX').addClass('pli-active');
|
| 178 |
+
jQuery("select[id=cse_cc_type]").val('AE');
|
| 179 |
+
break;
|
| 180 |
+
case 'discover':
|
| 181 |
+
jQuery('.pli-cc-DISCOVER').addClass('pli-active');
|
| 182 |
+
jQuery("select[id=cse_cc_type]").val('DI');
|
| 183 |
+
break;
|
| 184 |
+
case 'jcb':
|
| 185 |
+
jQuery('.pli-cc-JCB').addClass('pli-active');
|
| 186 |
+
jQuery("select[id=cse_cc_type]").val('JCB');
|
| 187 |
+
break;
|
| 188 |
+
case 'dinersclub':
|
| 189 |
+
jQuery('.pli-cc-DINERS').addClass('pli-active');
|
| 190 |
+
jQuery("select[id=cse_cc_type]").val('DC');
|
| 191 |
+
break;
|
| 192 |
+
case 'carteblue':
|
| 193 |
+
jQuery('.pli-cc-CARTE_BLEUE').addClass('pli-active');
|
| 194 |
+
jQuery("select[id=cse_cc_type]").val('CB');
|
| 195 |
+
break;
|
| 196 |
+
};
|
| 197 |
+
|
| 198 |
+
if(jQuery(".validation-advice")) {
|
| 199 |
+
jQuery(".validation-advice").hide();
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
function getType(code){
|
| 206 |
+
switch(code) {
|
| 207 |
+
case 'VI':
|
| 208 |
+
return "visa";
|
| 209 |
+
break;
|
| 210 |
+
case 'MC':
|
| 211 |
+
return 'mastercard';
|
| 212 |
+
break;
|
| 213 |
+
case 'AE':
|
| 214 |
+
return "amex";
|
| 215 |
+
break;
|
| 216 |
+
case 'DI':
|
| 217 |
+
return 'discover';
|
| 218 |
+
break;
|
| 219 |
+
case 'JCB':
|
| 220 |
+
return 'jcb';
|
| 221 |
+
break;
|
| 222 |
+
case 'DC':
|
| 223 |
+
return "dinersclub";
|
| 224 |
+
break;
|
| 225 |
+
case 'CB':
|
| 226 |
+
return 'carteblue';
|
| 227 |
+
break;
|
| 228 |
+
};
|
| 229 |
+
}
|
js/bluesnap/payform.js
ADDED
|
@@ -0,0 +1,683 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
/*
|
| 3 |
+
Payform Javascript Library
|
| 4 |
+
|
| 5 |
+
URL: https://github.com/jondavidjohn/payform
|
| 6 |
+
Author: Jonathan D. Johnson <me@jondavidjohn.com>
|
| 7 |
+
License: MIT
|
| 8 |
+
Version: 1.1.0
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
(function() {
|
| 12 |
+
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
| 13 |
+
|
| 14 |
+
(function(name, definition) {
|
| 15 |
+
if (typeof module !== "undefined" && module !== null) {
|
| 16 |
+
return module.exports = definition();
|
| 17 |
+
} else if (typeof define === 'function' && typeof define.amd === 'object') {
|
| 18 |
+
return define(name, definition);
|
| 19 |
+
} else {
|
| 20 |
+
return this[name] = definition();
|
| 21 |
+
}
|
| 22 |
+
})('payform', function() {
|
| 23 |
+
var _eventNormalize, _getCaretPos, _on, cardFromNumber, cardFromType, defaultFormat, formatBackCardNumber, formatBackExpiry, formatCardExpiry, formatCardNumber, formatForwardExpiry, formatForwardSlashAndSpace, hasTextSelected, luhnCheck, payform, reFormatCVC, reFormatCardNumber, reFormatExpiry, replaceFullWidthChars, restrictCVC, restrictCardNumber, restrictExpiry, restrictNumeric;
|
| 24 |
+
_getCaretPos = function(ele) {
|
| 25 |
+
var r, rc, re;
|
| 26 |
+
if (ele.selectionStart != null) {
|
| 27 |
+
return ele.selectionStart;
|
| 28 |
+
} else if (document.selection != null) {
|
| 29 |
+
ele.focus();
|
| 30 |
+
r = document.selection.createRange();
|
| 31 |
+
re = ele.createTextRange();
|
| 32 |
+
rc = re.duplicate();
|
| 33 |
+
re.moveToBookmark(r.getBookmark());
|
| 34 |
+
rc.setEndPoint('EndToStart', re);
|
| 35 |
+
return rc.text.length;
|
| 36 |
+
}
|
| 37 |
+
};
|
| 38 |
+
_eventNormalize = function(listener) {
|
| 39 |
+
return function(e) {
|
| 40 |
+
if (e == null) {
|
| 41 |
+
e = window.event;
|
| 42 |
+
}
|
| 43 |
+
e.target = e.target || e.srcElement;
|
| 44 |
+
e.which = e.which || e.keyCode;
|
| 45 |
+
if (e.preventDefault == null) {
|
| 46 |
+
e.preventDefault = function() {
|
| 47 |
+
return this.returnValue = false;
|
| 48 |
+
};
|
| 49 |
+
}
|
| 50 |
+
return listener(e);
|
| 51 |
+
};
|
| 52 |
+
};
|
| 53 |
+
_on = function(ele, event, listener) {
|
| 54 |
+
listener = _eventNormalize(listener);
|
| 55 |
+
if (ele.addEventListener != null) {
|
| 56 |
+
return ele.addEventListener(event, listener, false);
|
| 57 |
+
} else {
|
| 58 |
+
return ele.attachEvent("on" + event, listener);
|
| 59 |
+
}
|
| 60 |
+
};
|
| 61 |
+
payform = {};
|
| 62 |
+
defaultFormat = /(\d{1,4})/g;
|
| 63 |
+
payform.cards = [
|
| 64 |
+
|
| 65 |
+
{
|
| 66 |
+
type: 'carteblue',
|
| 67 |
+
pattern: /^((3(6[1-4]|77451))|(4(059(?!34)|150|201|561|562|533|556|97))|(5(0[1-4]|13|30066|341[0-1]|587[0-2]|6|8))|(6(27244|390|75[1-6]|799999998))).*/,
|
| 68 |
+
format: defaultFormat,
|
| 69 |
+
length: [16],
|
| 70 |
+
cvcLength: [3],
|
| 71 |
+
luhn: true
|
| 72 |
+
},
|
| 73 |
+
|
| 74 |
+
{
|
| 75 |
+
type: 'visaelectron',
|
| 76 |
+
pattern: /^4(026|17500|405|508|844|91[37])/,
|
| 77 |
+
format: defaultFormat,
|
| 78 |
+
length: [16],
|
| 79 |
+
cvcLength: [3],
|
| 80 |
+
luhn: true
|
| 81 |
+
}, {
|
| 82 |
+
type: 'maestro',
|
| 83 |
+
pattern: /^(5(018|0[23]|[68])|6(39|7))/,
|
| 84 |
+
format: defaultFormat,
|
| 85 |
+
length: [12, 13, 14, 15, 16, 17, 18, 19],
|
| 86 |
+
cvcLength: [3],
|
| 87 |
+
luhn: true
|
| 88 |
+
}, {
|
| 89 |
+
type: 'forbrugsforeningen',
|
| 90 |
+
pattern: /^600/,
|
| 91 |
+
format: defaultFormat,
|
| 92 |
+
length: [16],
|
| 93 |
+
cvcLength: [3],
|
| 94 |
+
luhn: true
|
| 95 |
+
}, {
|
| 96 |
+
type: 'dankort',
|
| 97 |
+
pattern: /^5019/,
|
| 98 |
+
format: defaultFormat,
|
| 99 |
+
length: [16],
|
| 100 |
+
cvcLength: [3],
|
| 101 |
+
luhn: true
|
| 102 |
+
}, {
|
| 103 |
+
type: 'visa',
|
| 104 |
+
pattern: /^4/,
|
| 105 |
+
format: defaultFormat,
|
| 106 |
+
length: [13, 16],
|
| 107 |
+
cvcLength: [3],
|
| 108 |
+
luhn: true
|
| 109 |
+
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
type: 'mastercard',
|
| 113 |
+
pattern: /^(5[1-5]|2[2-7])/,
|
| 114 |
+
format: defaultFormat,
|
| 115 |
+
length: [16],
|
| 116 |
+
cvcLength: [3],
|
| 117 |
+
luhn: true
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
type: 'amex',
|
| 121 |
+
pattern: /^3(4|7)/,
|
| 122 |
+
// pattern: /^3[47]/,
|
| 123 |
+
format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
|
| 124 |
+
length: [15],
|
| 125 |
+
cvcLength: [4],
|
| 126 |
+
luhn: true
|
| 127 |
+
}, {
|
| 128 |
+
type: 'dinersclub',
|
| 129 |
+
pattern: /^3[0689]/,
|
| 130 |
+
format: /(\d{1,4})(\d{1,6})?(\d{1,4})?/,
|
| 131 |
+
length: [14],
|
| 132 |
+
cvcLength: [3],
|
| 133 |
+
luhn: true
|
| 134 |
+
},
|
| 135 |
+
{
|
| 136 |
+
type: 'discover',
|
| 137 |
+
pattern: /^6([045]|22)/,
|
| 138 |
+
format: defaultFormat,
|
| 139 |
+
length: [16],
|
| 140 |
+
cvcLength: [3],
|
| 141 |
+
luhn: true
|
| 142 |
+
}, {
|
| 143 |
+
type: 'unionpay',
|
| 144 |
+
pattern: /^(62|88)/,
|
| 145 |
+
format: defaultFormat,
|
| 146 |
+
length: [16, 17, 18, 19],
|
| 147 |
+
cvcLength: [3],
|
| 148 |
+
luhn: false
|
| 149 |
+
}, {
|
| 150 |
+
type: 'jcb',
|
| 151 |
+
pattern: /^35/,
|
| 152 |
+
format: defaultFormat,
|
| 153 |
+
length: [16],
|
| 154 |
+
cvcLength: [3],
|
| 155 |
+
luhn: true
|
| 156 |
+
},
|
| 157 |
+
|
| 158 |
+
// from https://github.com/PawelDecowski/jquery-creditcardvalidator/blob/master/jquery.creditCardValidator.js
|
| 159 |
+
|
| 160 |
+
{
|
| 161 |
+
type: 'carte_blanche',
|
| 162 |
+
// name: 'carte_blanche',
|
| 163 |
+
pattern: /^30[0-5]/,
|
| 164 |
+
format: defaultFormat,
|
| 165 |
+
length: [14],
|
| 166 |
+
cvcLength: [3],
|
| 167 |
+
luhn: true
|
| 168 |
+
},
|
| 169 |
+
{
|
| 170 |
+
type: 'dinersclub',
|
| 171 |
+
// name: 'dinersclub',
|
| 172 |
+
pattern: /^36/,
|
| 173 |
+
format: defaultFormat,
|
| 174 |
+
length: [14],
|
| 175 |
+
cvcLength: [3],
|
| 176 |
+
luhn: true
|
| 177 |
+
}, {
|
| 178 |
+
type: 'jcb',
|
| 179 |
+
// name: 'jcb',
|
| 180 |
+
format: defaultFormat,
|
| 181 |
+
pattern: /^35(2[89]|[3-8][0-9])/,
|
| 182 |
+
length: [16],
|
| 183 |
+
cvcLength: [3],
|
| 184 |
+
luhn: true
|
| 185 |
+
|
| 186 |
+
}, {
|
| 187 |
+
type: 'laser',
|
| 188 |
+
// name: 'laser',
|
| 189 |
+
format: defaultFormat,
|
| 190 |
+
pattern: /^(6304|670[69]|6771)/,
|
| 191 |
+
length: [16, 17, 18, 19]
|
| 192 |
+
}, {
|
| 193 |
+
type: 'visa_electron',
|
| 194 |
+
// name: 'visa_electron',
|
| 195 |
+
format: defaultFormat,
|
| 196 |
+
pattern: /^(4026|417500|4508|4844|491(3|7))/,
|
| 197 |
+
length: [16],
|
| 198 |
+
cvcLength: [3],
|
| 199 |
+
luhn: true
|
| 200 |
+
}, {
|
| 201 |
+
type: 'visa',
|
| 202 |
+
// name: 'visa',
|
| 203 |
+
format: defaultFormat,
|
| 204 |
+
pattern: /^4/,
|
| 205 |
+
length: [16],
|
| 206 |
+
cvcLength: [3],
|
| 207 |
+
luhn: true
|
| 208 |
+
}, {
|
| 209 |
+
type: 'mastercard',
|
| 210 |
+
// name: 'mastercard',
|
| 211 |
+
format: defaultFormat,
|
| 212 |
+
pattern: /^5[1-5]/,
|
| 213 |
+
length: [16],
|
| 214 |
+
cvcLength: [3],
|
| 215 |
+
luhn: true
|
| 216 |
+
}, {
|
| 217 |
+
type: 'maestro',
|
| 218 |
+
// name: 'maestro',
|
| 219 |
+
format: defaultFormat,
|
| 220 |
+
pattern: /^(5018|5020|5038|6304|6759|676[1-3])/,
|
| 221 |
+
length: [12, 13, 14, 15, 16, 17, 18, 19],
|
| 222 |
+
cvcLength: [3],
|
| 223 |
+
luhn: true
|
| 224 |
+
}, {
|
| 225 |
+
type: 'discover',
|
| 226 |
+
// name: 'discover',
|
| 227 |
+
format: defaultFormat,
|
| 228 |
+
pattern: /^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,
|
| 229 |
+
length: [16],
|
| 230 |
+
cvcLength: [3],
|
| 231 |
+
luhn: true
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
];
|
| 237 |
+
cardFromNumber = function(num) {
|
| 238 |
+
var card, i, len, ref;
|
| 239 |
+
num = (num + '').replace(/\D/g, '');
|
| 240 |
+
ref = payform.cards;
|
| 241 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
| 242 |
+
card = ref[i];
|
| 243 |
+
if (card.pattern.test(num)) {
|
| 244 |
+
return card;
|
| 245 |
+
}
|
| 246 |
+
}
|
| 247 |
+
};
|
| 248 |
+
cardFromType = function(type) {
|
| 249 |
+
var card, i, len, ref;
|
| 250 |
+
ref = payform.cards;
|
| 251 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
| 252 |
+
card = ref[i];
|
| 253 |
+
if (card.type === type) {
|
| 254 |
+
return card;
|
| 255 |
+
}
|
| 256 |
+
}
|
| 257 |
+
};
|
| 258 |
+
luhnCheck = function(num) {
|
| 259 |
+
var digit, digits, i, len, odd, sum;
|
| 260 |
+
odd = true;
|
| 261 |
+
sum = 0;
|
| 262 |
+
digits = (num + '').split('').reverse();
|
| 263 |
+
for (i = 0, len = digits.length; i < len; i++) {
|
| 264 |
+
digit = digits[i];
|
| 265 |
+
digit = parseInt(digit, 10);
|
| 266 |
+
if ((odd = !odd)) {
|
| 267 |
+
digit *= 2;
|
| 268 |
+
}
|
| 269 |
+
if (digit > 9) {
|
| 270 |
+
digit -= 9;
|
| 271 |
+
}
|
| 272 |
+
sum += digit;
|
| 273 |
+
}
|
| 274 |
+
return sum % 10 === 0;
|
| 275 |
+
};
|
| 276 |
+
hasTextSelected = function(target) {
|
| 277 |
+
var ref;
|
| 278 |
+
if ((typeof document !== "undefined" && document !== null ? (ref = document.selection) != null ? ref.createRange : void 0 : void 0) != null) {
|
| 279 |
+
if (document.selection.createRange().text) {
|
| 280 |
+
return true;
|
| 281 |
+
}
|
| 282 |
+
}
|
| 283 |
+
return (target.selectionStart != null) && target.selectionStart !== target.selectionEnd;
|
| 284 |
+
};
|
| 285 |
+
replaceFullWidthChars = function(str) {
|
| 286 |
+
var char, chars, fullWidth, halfWidth, i, idx, len, value;
|
| 287 |
+
if (str == null) {
|
| 288 |
+
str = '';
|
| 289 |
+
}
|
| 290 |
+
fullWidth = '\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19';
|
| 291 |
+
halfWidth = '0123456789';
|
| 292 |
+
value = '';
|
| 293 |
+
chars = str.split('');
|
| 294 |
+
for (i = 0, len = chars.length; i < len; i++) {
|
| 295 |
+
char = chars[i];
|
| 296 |
+
idx = fullWidth.indexOf(char);
|
| 297 |
+
if (idx > -1) {
|
| 298 |
+
char = halfWidth[idx];
|
| 299 |
+
}
|
| 300 |
+
value += char;
|
| 301 |
+
}
|
| 302 |
+
return value;
|
| 303 |
+
};
|
| 304 |
+
reFormatCardNumber = function(e) {
|
| 305 |
+
var cursor;
|
| 306 |
+
cursor = _getCaretPos(e.target);
|
| 307 |
+
e.target.value = payform.formatCardNumber(e.target.value);
|
| 308 |
+
if ((cursor != null) && e.type !== 'change') {
|
| 309 |
+
return e.target.setSelectionRange(cursor, cursor);
|
| 310 |
+
}
|
| 311 |
+
};
|
| 312 |
+
formatCardNumber = function(e) {
|
| 313 |
+
var card, cursor, digit, length, re, upperLength, value;
|
| 314 |
+
digit = String.fromCharCode(e.which);
|
| 315 |
+
if (!/^\d+$/.test(digit)) {
|
| 316 |
+
return;
|
| 317 |
+
}
|
| 318 |
+
value = e.target.value;
|
| 319 |
+
card = cardFromNumber(value + digit);
|
| 320 |
+
length = (value.replace(/\D/g, '') + digit).length;
|
| 321 |
+
upperLength = 16;
|
| 322 |
+
if (card) {
|
| 323 |
+
upperLength = card.length[card.length.length - 1];
|
| 324 |
+
}
|
| 325 |
+
if (length >= upperLength) {
|
| 326 |
+
return;
|
| 327 |
+
}
|
| 328 |
+
cursor = _getCaretPos(e.target);
|
| 329 |
+
if (cursor && cursor !== value.length) {
|
| 330 |
+
return;
|
| 331 |
+
}
|
| 332 |
+
if (card && card.type === 'amex') {
|
| 333 |
+
re = /^(\d{4}|\d{4}\s\d{6})$/;
|
| 334 |
+
} else {
|
| 335 |
+
re = /(?:^|\s)(\d{4})$/;
|
| 336 |
+
}
|
| 337 |
+
if (re.test(value)) {
|
| 338 |
+
e.preventDefault();
|
| 339 |
+
return setTimeout(function() {
|
| 340 |
+
return e.target.value = value + " " + digit;
|
| 341 |
+
});
|
| 342 |
+
} else if (re.test(value + digit)) {
|
| 343 |
+
e.preventDefault();
|
| 344 |
+
return setTimeout(function() {
|
| 345 |
+
return e.target.value = (value + digit) + " ";
|
| 346 |
+
});
|
| 347 |
+
}
|
| 348 |
+
};
|
| 349 |
+
formatBackCardNumber = function(e) {
|
| 350 |
+
var cursor, value;
|
| 351 |
+
value = e.target.value;
|
| 352 |
+
if (e.which !== 8) {
|
| 353 |
+
return;
|
| 354 |
+
}
|
| 355 |
+
cursor = _getCaretPos(e.target);
|
| 356 |
+
if (cursor && cursor !== value.length) {
|
| 357 |
+
return;
|
| 358 |
+
}
|
| 359 |
+
if (/\d\s$/.test(value)) {
|
| 360 |
+
e.preventDefault();
|
| 361 |
+
return setTimeout(function() {
|
| 362 |
+
return e.target.value = value.replace(/\d\s$/, '');
|
| 363 |
+
});
|
| 364 |
+
} else if (/\s\d?$/.test(value)) {
|
| 365 |
+
e.preventDefault();
|
| 366 |
+
return setTimeout(function() {
|
| 367 |
+
return e.target.value = value.replace(/\d$/, '');
|
| 368 |
+
});
|
| 369 |
+
}
|
| 370 |
+
};
|
| 371 |
+
reFormatExpiry = function(e) {
|
| 372 |
+
var cursor;
|
| 373 |
+
cursor = _getCaretPos(e.target);
|
| 374 |
+
e.target.value = payform.formatCardExpiry(e.target.value);
|
| 375 |
+
if ((cursor != null) && e.type !== 'change') {
|
| 376 |
+
return e.target.setSelectionRange(cursor, cursor);
|
| 377 |
+
}
|
| 378 |
+
};
|
| 379 |
+
|
| 380 |
+
formatCardExpiry = function(e) {
|
| 381 |
+
var digit, val;
|
| 382 |
+
digit = String.fromCharCode(e.which);
|
| 383 |
+
if (!/^\d+$/.test(digit)) {
|
| 384 |
+
return;
|
| 385 |
+
}
|
| 386 |
+
val = e.target.value + digit;
|
| 387 |
+
if (/^\d$/.test(val) && (val !== '0' && val !== '1')) {
|
| 388 |
+
e.preventDefault();
|
| 389 |
+
return setTimeout(function() {
|
| 390 |
+
return e.target.value = "0" + val + " / ";
|
| 391 |
+
});
|
| 392 |
+
} else if (/^\d\d$/.test(val)) {
|
| 393 |
+
e.preventDefault();
|
| 394 |
+
return setTimeout(function() {
|
| 395 |
+
return e.target.value = val + " / ";
|
| 396 |
+
});
|
| 397 |
+
}
|
| 398 |
+
};
|
| 399 |
+
formatForwardExpiry = function(e) {
|
| 400 |
+
var digit, val;
|
| 401 |
+
digit = String.fromCharCode(e.which);
|
| 402 |
+
if (!/^\d+$/.test(digit)) {
|
| 403 |
+
return;
|
| 404 |
+
}
|
| 405 |
+
val = e.target.value;
|
| 406 |
+
if (/^\d\d$/.test(val)) {
|
| 407 |
+
return e.target.value = val + " / ";
|
| 408 |
+
}
|
| 409 |
+
};
|
| 410 |
+
formatForwardSlashAndSpace = function(e) {
|
| 411 |
+
var val, which;
|
| 412 |
+
which = String.fromCharCode(e.which);
|
| 413 |
+
if (!(which === '/' || which === ' ')) {
|
| 414 |
+
return;
|
| 415 |
+
}
|
| 416 |
+
val = e.target.value;
|
| 417 |
+
if (/^\d$/.test(val) && val !== '0') {
|
| 418 |
+
return e.target.value = "0" + val + " / ";
|
| 419 |
+
}
|
| 420 |
+
};
|
| 421 |
+
formatBackExpiry = function(e) {
|
| 422 |
+
var cursor, value;
|
| 423 |
+
value = e.target.value;
|
| 424 |
+
if (e.which !== 8) {
|
| 425 |
+
return;
|
| 426 |
+
}
|
| 427 |
+
cursor = _getCaretPos(e.target);
|
| 428 |
+
if (cursor && cursor !== value.length) {
|
| 429 |
+
return;
|
| 430 |
+
}
|
| 431 |
+
if (/\d\s\/\s$/.test(value)) {
|
| 432 |
+
e.preventDefault();
|
| 433 |
+
return setTimeout(function() {
|
| 434 |
+
return e.target.value = value.replace(/\d\s\/\s$/, '');
|
| 435 |
+
});
|
| 436 |
+
}
|
| 437 |
+
};
|
| 438 |
+
reFormatCVC = function(e) {
|
| 439 |
+
var cursor;
|
| 440 |
+
cursor = _getCaretPos(e.target);
|
| 441 |
+
e.target.value = replaceFullWidthChars(e.target.value).replace(/\D/g, '').slice(0, 4);
|
| 442 |
+
if ((cursor != null) && e.type !== 'change') {
|
| 443 |
+
return e.target.setSelectionRange(cursor, cursor);
|
| 444 |
+
}
|
| 445 |
+
};
|
| 446 |
+
restrictNumeric = function(e) {
|
| 447 |
+
var input;
|
| 448 |
+
if (e.metaKey || e.ctrlKey) {
|
| 449 |
+
return;
|
| 450 |
+
}
|
| 451 |
+
if (e.which === 0) {
|
| 452 |
+
return;
|
| 453 |
+
}
|
| 454 |
+
if (e.which < 33) {
|
| 455 |
+
return;
|
| 456 |
+
}
|
| 457 |
+
input = String.fromCharCode(e.which);
|
| 458 |
+
if (!/^\d+$/.test(input)) {
|
| 459 |
+
return e.preventDefault();
|
| 460 |
+
}
|
| 461 |
+
};
|
| 462 |
+
restrictCardNumber = function(e) {
|
| 463 |
+
var card, digit, value;
|
| 464 |
+
digit = String.fromCharCode(e.which);
|
| 465 |
+
if (!/^\d+$/.test(digit)) {
|
| 466 |
+
return;
|
| 467 |
+
}
|
| 468 |
+
if (hasTextSelected(e.target)) {
|
| 469 |
+
return;
|
| 470 |
+
}
|
| 471 |
+
value = (e.target.value + digit).replace(/\D/g, '');
|
| 472 |
+
card = cardFromNumber(value);
|
| 473 |
+
if (card && value.length > card.length[card.length.length - 1]) {
|
| 474 |
+
return e.preventDefault();
|
| 475 |
+
} else if (value.length > 16) {
|
| 476 |
+
return e.preventDefault();
|
| 477 |
+
}
|
| 478 |
+
};
|
| 479 |
+
restrictExpiry = function(e) {
|
| 480 |
+
var digit, value;
|
| 481 |
+
digit = String.fromCharCode(e.which);
|
| 482 |
+
if (!/^\d+$/.test(digit)) {
|
| 483 |
+
return;
|
| 484 |
+
}
|
| 485 |
+
if (hasTextSelected(e.target)) {
|
| 486 |
+
return;
|
| 487 |
+
}
|
| 488 |
+
value = e.target.value + digit;
|
| 489 |
+
value = value.replace(/\D/g, '');
|
| 490 |
+
if (value.length > 6) {
|
| 491 |
+
return e.preventDefault();
|
| 492 |
+
}
|
| 493 |
+
};
|
| 494 |
+
restrictCVC = function(e) {
|
| 495 |
+
var digit, val;
|
| 496 |
+
digit = String.fromCharCode(e.which);
|
| 497 |
+
if (!/^\d+$/.test(digit)) {
|
| 498 |
+
return;
|
| 499 |
+
}
|
| 500 |
+
if (hasTextSelected(e.target)) {
|
| 501 |
+
return;
|
| 502 |
+
}
|
| 503 |
+
val = e.target.value + digit;
|
| 504 |
+
if (val.length > 4) {
|
| 505 |
+
return e.preventDefault();
|
| 506 |
+
}
|
| 507 |
+
};
|
| 508 |
+
payform.cvcInput = function(input) {
|
| 509 |
+
_on(input, 'keypress', restrictNumeric);
|
| 510 |
+
_on(input, 'keypress', restrictCVC);
|
| 511 |
+
_on(input, 'paste', reFormatCVC);
|
| 512 |
+
_on(input, 'change', reFormatCVC);
|
| 513 |
+
return _on(input, 'input', reFormatCVC);
|
| 514 |
+
};
|
| 515 |
+
payform.expiryInput = function(input) {
|
| 516 |
+
_on(input, 'keypress', restrictNumeric);
|
| 517 |
+
_on(input, 'keypress', restrictExpiry);
|
| 518 |
+
_on(input, 'keypress', formatCardExpiry);
|
| 519 |
+
_on(input, 'keypress', formatForwardSlashAndSpace);
|
| 520 |
+
_on(input, 'keypress', formatForwardExpiry);
|
| 521 |
+
_on(input, 'keydown', formatBackExpiry);
|
| 522 |
+
_on(input, 'change', reFormatExpiry);
|
| 523 |
+
return _on(input, 'input', reFormatExpiry);
|
| 524 |
+
};
|
| 525 |
+
payform.cardNumberInput = function(input) {
|
| 526 |
+
_on(input, 'keypress', restrictNumeric);
|
| 527 |
+
_on(input, 'keypress', restrictCardNumber);
|
| 528 |
+
_on(input, 'keypress', formatCardNumber);
|
| 529 |
+
_on(input, 'keydown', formatBackCardNumber);
|
| 530 |
+
_on(input, 'paste', reFormatCardNumber);
|
| 531 |
+
_on(input, 'change', reFormatCardNumber);
|
| 532 |
+
return _on(input, 'input', reFormatCardNumber);
|
| 533 |
+
};
|
| 534 |
+
payform.numericInput = function(input) {
|
| 535 |
+
_on(input, 'keypress', restrictNumeric);
|
| 536 |
+
_on(input, 'paste', restrictNumeric);
|
| 537 |
+
_on(input, 'change', restrictNumeric);
|
| 538 |
+
return _on(input, 'input', restrictNumeric);
|
| 539 |
+
};
|
| 540 |
+
payform.cardFromNumber = function(num) {
|
| 541 |
+
return cardFromNumber(num);
|
| 542 |
+
};
|
| 543 |
+
payform.parseCardExpiry = function(value) {
|
| 544 |
+
var month, prefix, ref, year;
|
| 545 |
+
value = value.replace(/\s/g, '');
|
| 546 |
+
ref = value.split('/', 2), month = ref[0], year = ref[1];
|
| 547 |
+
if ((year != null ? year.length : void 0) === 2 && /^\d+$/.test(year)) {
|
| 548 |
+
prefix = (new Date).getFullYear();
|
| 549 |
+
prefix = prefix.toString().slice(0, 2);
|
| 550 |
+
year = prefix + year;
|
| 551 |
+
}
|
| 552 |
+
month = parseInt(month, 10);
|
| 553 |
+
year = parseInt(year, 10);
|
| 554 |
+
return {
|
| 555 |
+
month: month,
|
| 556 |
+
year: year
|
| 557 |
+
};
|
| 558 |
+
};
|
| 559 |
+
payform.validateCardNumber = function(num) {
|
| 560 |
+
var card, ref;
|
| 561 |
+
|
| 562 |
+
num = (num + '').replace(/\s+|-/g, '');
|
| 563 |
+
if (!/^\d+$/.test(num)) {
|
| 564 |
+
return false;
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
card = cardFromNumber(num);
|
| 568 |
+
if (!card) {
|
| 569 |
+
return false;
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
return (ref = num.length, indexOf.call(card.length, ref) >= 0) && (card.luhn === false || luhnCheck(num));
|
| 573 |
+
};
|
| 574 |
+
payform.validateCardExpiry = function(month, year) {
|
| 575 |
+
var currentTime, expiry, ref;
|
| 576 |
+
if (typeof month === 'object' && 'month' in month) {
|
| 577 |
+
ref = month, month = ref.month, year = ref.year;
|
| 578 |
+
}
|
| 579 |
+
if (!(month && year)) {
|
| 580 |
+
return false;
|
| 581 |
+
}
|
| 582 |
+
month = String(month).trim();
|
| 583 |
+
year = String(year).trim();
|
| 584 |
+
if (!/^\d+$/.test(month)) {
|
| 585 |
+
return false;
|
| 586 |
+
}
|
| 587 |
+
if (!/^\d+$/.test(year)) {
|
| 588 |
+
return false;
|
| 589 |
+
}
|
| 590 |
+
if (!((1 <= month && month <= 12))) {
|
| 591 |
+
return false;
|
| 592 |
+
}
|
| 593 |
+
if (year.length === 2) {
|
| 594 |
+
if (year < 70) {
|
| 595 |
+
year = "20" + year;
|
| 596 |
+
} else {
|
| 597 |
+
year = "19" + year;
|
| 598 |
+
}
|
| 599 |
+
}
|
| 600 |
+
if (year.length !== 4) {
|
| 601 |
+
return false;
|
| 602 |
+
}
|
| 603 |
+
expiry = new Date(year, month);
|
| 604 |
+
currentTime = new Date;
|
| 605 |
+
expiry.setMonth(expiry.getMonth() - 1);
|
| 606 |
+
expiry.setMonth(expiry.getMonth() + 1, 1);
|
| 607 |
+
return expiry > currentTime;
|
| 608 |
+
};
|
| 609 |
+
payform.validateCardCVC = function(cvc, type) {
|
| 610 |
+
var card, ref;
|
| 611 |
+
cvc = String(cvc).trim();
|
| 612 |
+
|
| 613 |
+
if(!type) {
|
| 614 |
+
type = this.parseCardType($("cse_cc_number").getValue());
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
+
if (!/^\d+$/.test(cvc)) {
|
| 618 |
+
return false;
|
| 619 |
+
}
|
| 620 |
+
card = cardFromType(type);
|
| 621 |
+
|
| 622 |
+
if (card != null) {
|
| 623 |
+
return ref = cvc.length, indexOf.call(card.cvcLength, ref) >= 0;
|
| 624 |
+
} else {
|
| 625 |
+
return cvc.length >= 3 && cvc.length <= 4;
|
| 626 |
+
}
|
| 627 |
+
};
|
| 628 |
+
payform.parseCardType = function(num) {
|
| 629 |
+
var ref;
|
| 630 |
+
if (!num) {
|
| 631 |
+
return null;
|
| 632 |
+
}
|
| 633 |
+
return ((ref = cardFromNumber(num)) != null ? ref.type : void 0) || null;
|
| 634 |
+
};
|
| 635 |
+
payform.formatCardNumber = function(num) {
|
| 636 |
+
var card, groups, ref, upperLength;
|
| 637 |
+
num = replaceFullWidthChars(num);
|
| 638 |
+
num = num.replace(/\D/g, '');
|
| 639 |
+
card = cardFromNumber(num);
|
| 640 |
+
if (!card) {
|
| 641 |
+
return num;
|
| 642 |
+
}
|
| 643 |
+
upperLength = card.length[card.length.length - 1];
|
| 644 |
+
num = num.slice(0, upperLength);
|
| 645 |
+
if (card.format.global) {
|
| 646 |
+
return (ref = num.match(card.format)) != null ? ref.join(' ') : void 0;
|
| 647 |
+
} else {
|
| 648 |
+
groups = card.format.exec(num);
|
| 649 |
+
if (groups == null) {
|
| 650 |
+
return;
|
| 651 |
+
}
|
| 652 |
+
groups.shift();
|
| 653 |
+
groups = groups.filter(Boolean);
|
| 654 |
+
return groups.join(' ');
|
| 655 |
+
}
|
| 656 |
+
};
|
| 657 |
+
payform.formatCardExpiry = function(expiry) {
|
| 658 |
+
var mon, parts, sep, year;
|
| 659 |
+
expiry = replaceFullWidthChars(expiry);
|
| 660 |
+
parts = expiry.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/);
|
| 661 |
+
if (!parts) {
|
| 662 |
+
return '';
|
| 663 |
+
}
|
| 664 |
+
mon = parts[1] || '';
|
| 665 |
+
sep = parts[2] || '';
|
| 666 |
+
year = parts[3] || '';
|
| 667 |
+
if (year.length > 0) {
|
| 668 |
+
sep = ' / ';
|
| 669 |
+
} else if (sep === ' /') {
|
| 670 |
+
mon = mon.substring(0, 1);
|
| 671 |
+
sep = '';
|
| 672 |
+
} else if (mon.length === 2 || sep.length > 0) {
|
| 673 |
+
sep = ' / ';
|
| 674 |
+
} else if (mon.length === 1 && (mon !== '0' && mon !== '1')) {
|
| 675 |
+
mon = "0" + mon;
|
| 676 |
+
sep = ' / ';
|
| 677 |
+
}
|
| 678 |
+
return mon + sep + year;
|
| 679 |
+
};
|
| 680 |
+
return payform;
|
| 681 |
+
});
|
| 682 |
+
|
| 683 |
+
}).call(this);
|
js/lib/jquery/bluesnap-noconflict.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
var $j = jQuery.noConflict();
|
js/lib/jquery/jquery-3.0.0.min.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*! jQuery v3.0.0 | (c) jQuery Foundation | jquery.org/license */
|
| 2 |
+
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.0.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return a&&"[object Object]"===k.call(a)?(b=e(a))?(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n):!0:!1},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;d>f;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;return"string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a)?(d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e):void 0},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"===c||r.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\x00-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\x00"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[0>c?c+b:c]}),even:pa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,e>i&&ya(a.slice(i,e)),f>e&&ya(a=a.slice(e)),f>e&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;d>b;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;d>b;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(f>b)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(1>=b&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){
|
| 3 |
+
return j.call(r(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),aa=["Top","Right","Bottom","Left"],ba=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ca=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function da(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&_.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ea={};function fa(a){var b,c=a.ownerDocument,d=a.nodeName,e=ea[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ea[d]=e,e)}function ga(a,b){for(var c,d,e=[],f=0,g=a.length;g>f;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;g>f;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;d>c;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;o>n;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){return this.originalEvent?b(this.originalEvent):void 0}:function(){return this.originalEvent?this.originalEvent[a]:void 0},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==va()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===va()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&r.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ta:ua,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:ua,isPropagationStopped:ua,isImmediatePropagationStopped:ua,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ta,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ta,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ta,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&qa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ra.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return wa(this,a,b,c,d)},one:function(a,b,c,d){return wa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ua),this.each(function(){r.event.remove(this,a,c,b)})}});var xa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/<script|<style|<link/i,za=/checked\s*(?:[^=]|=\s*.checked.)/i,Aa=/^true\/(.*)/,Ba=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;m>l;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;i>l;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;e>d;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;e>d;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),0>=d||null==d){if(d=Ma(a,b,f),(0>d||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){return c?!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)}):void 0},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){return b?(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;e>g;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);g>f;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;e>d;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Ya=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){Za||(Za=a.requestAnimationFrame?a.requestAnimationFrame(ab):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame(Za):a.clearInterval(Za),Za=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var hb,ib=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c);
|
| 4 |
+
}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){return r.isArray(b)?a.checked=r.inArray(r(a).val(),b)>-1:void 0}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?r.event.trigger(a,b,c,!0):void 0}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",0>b&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;return o.cors||Pb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=oa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=r.trim(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||pa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Na(o.pixelPosition,function(a,c){return c?(c=Ma(a,b),Ka.test(c)?r(a).position()[b]+"px":c):void 0})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r});
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>bluesnap_payment</name>
|
| 4 |
-
<version>2.0.2
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Community GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Magento Extension for BlueSnap payment</summary>
|
| 10 |
<description>Magento Extension for BlueSnap payment</description>
|
| 11 |
-
<notes>-
|
| 12 |
<authors><author><name>Nachshon Fishbane</name><user>nahshf</user><email>nachshon@fisha.co.il</email></author></authors>
|
| 13 |
-
<date>2016-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magecommunity"><dir name="Bluesnap"><dir name="Payment"><dir name="Block"><dir name="Adminhtml"><dir name="Api"><dir name="Logger"><file name="Grid.php" hash="e35bcb916e09738a725c0a312e982feb"/></dir><file name="Logger.php" hash="7af64a11fe665ca23066a00ae1202613"/></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="d8b261305976d56263dbc85191a3cdb1"/></dir><dir name="Grid"><dir name="Renderer"><file name="Paymentmethod.php" hash="4480da922527c8112cf070fccaf1fb4c"/></dir></dir><file name="Grid.php" hash="920fa76250ae3ad33b182a8147364673"/><dir name="Invoice"><file name="Totals.php" hash="89e1277f55d54e6988a1570175b0b4c4"/></dir><file name="Totals.php" hash="f6792ad7311197814aa01be3ce820509"/><dir name="View"><dir name="Tab"><file name="Creditmemos.php" hash="41ac64fb7ec61359c51e9130731b2f33"/><file name="Invoices.php" hash="02a1e7dfdc8662e5336ef7982022d74a"/></dir></dir></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Xml.php" hash="1d1d40b7015a2cf644c322bf5c8c866c"/></dir></dir></dir></dir></dir><dir name="Buynow"><file name="Iframe.php" hash="52486def3cd9f2dcd83d54d3be08d578"/><dir name="Info"><file name="Order.php" hash="9c8b04eccc780a873b09a11cd080e547"/></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Totals.php" hash="7eae09cf26577676c617694aa7cf8640"/></dir><file name="Grandtotal.php" hash="ba6fd8aaf003c015abfa466adfb2e644"/></dir><dir name="Customer"><dir name="Widget"><file name="Name.php" hash="3a4e9de6e6068a9c9646eb68f24a0d48"/></dir></dir><dir name="Order"><file name="Totals.php" hash="30d2f0311e1aceb1ee3c2adf0aad284c"/></dir><dir name="Payment"><dir name="Form"><file name="Buynow.php" hash="36a0238b3949f3f9d3bc3bef4dc72203"/><file name="Cse.php" hash="d907c3832ae228d252dfc8558cf9695c"/><file name="Saved.php" hash="7ad6d859034c93e46f47380914539493"/></dir><dir name="Info"><file name="Buynow.php" hash="94237e9a306db4199df55aacddee8272"/><file name="Cse.php" hash="14f154e5371b2e376ff8b3d7c7b78b5c"/></dir></dir></dir><file name="Exception.php" hash="0337cb725383fa330ab08803d95d0770"/><dir name="Helper"><file name="Checkout.php" hash="63cdf126f87f2afb7dee46e34e94d45e"/><file name="Config.php" hash="6b7ec2cae242e75d9344d890d860e618"/><file name="Data.php" hash="87444919689cf622f532d0343f6c8cb4"/><file name="Email.php" hash="e3acaafcd503e947fc28ae39c2616893"/><file name="Sales.php" hash="0ffc35ee24e44fb5c921e2b0f72fc3f1"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="19516e30bef2d5c158627b3cbc42f0f2"/><file name="Buynow.php" hash="5dc62c76f61cbe70e08ea5fe842e2b40"/><file name="Config.php" hash="e45b9fd65420aa5172814e20160a66e6"/><file name="Cse.php" hash="49847d21cd091512785d2b39b47d74e9"/><file name="Currency.php" hash="c792fe8012211b8d89ebf6a171d20690"/><file name="Exception.php" hash="ecd51203c6ad643980b3c260f64df0bf"/><file name="Logger.php" hash="21a966590e313fb615e6660db19088d1"/><file name="Refund.php" hash="451622e145fb36df859941712d287772"/><file name="Saved.php" hash="f90f15b8b85f60fb539c30610d75bc43"/></dir><dir name="Directory"><dir name="Currency"><file name="Import.php" hash="709b8ab48804e96cfe86a95cc13ff00b"/></dir><file name="Currency.php" hash="8235b8195671a7d69708157469b2ed7b"/><file name="Observer.php" hash="de717bb7dcac6fe1c9c96623f17a919b"/></dir><file name="Ipn.php" hash="16066535e74cce434c532c09600b0020"/><dir name="Logger"><dir name="Db"><file name="Entry.php" hash="c8ec0373040489819cbdd653c31a179a"/></dir><file name="Db.php" hash="4da177acece44978edefb4e46c1c75dc"/><file name="File.php" hash="12eb5993943f7be0a0bb83c2b740abad"/><file name="Mail.php" hash="7ee74389226a425f4f10d78ad820dd5f"/></dir><file name="Observer.php" hash="d84ef7aed328da93a8ad1b983ae4ed30"/><dir name="Payment"><file name="Abstract.php" hash="23222f7e488f3e3898624866100447e9"/><file name="Buynow.php" hash="a7b96667c7ab05caf1b1c818c88acfdd"/><file name="Cse.php" hash="188ee440d1c7953492d9ce623159137b"/></dir><dir name="Resource"><dir name="Directory"><file name="Currency.php" hash="21fdc0c6e85652cc07cec3f7e287e1c9"/></dir><dir name="Logger"><dir name="Db"><dir name="Entry"><file name="Collection.php" hash="328246533e58befe7308120a0c6919ee"/></dir><file name="Entry.php" hash="8b7deb7f148846f3913390de6de5dccd"/></dir></dir></dir><dir name="Sales"><dir name="Order"><file name="Payment.php" hash="f2fb2ab21fdd463ccc19aa007d1486fc"/></dir><file name="Order.php" hash="901431fa7219a40200abcc9502f50ed6"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="PaymentAction.php" hash="575ee53a84e5dcb9f01db85af6a9f814"/><file name="Priorities.php" hash="836b142dee2ed56ee06d9c6de5ef0d30"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Bluesnap"><file name="LoggerController.php" hash="105c40df4cac28602b47677033d1c05c"/></dir></dir><file name="CheckoutController.php" hash="ffcc6df5e95e79cb0b464a27ea94304d"/><file name="IpnController.php" hash="2ccff15342071d1b02b710cd6bea06ee"/></dir><dir name="etc"><file name="adminhtml.xml" hash="fea2afd0b7b1bad56357d41a55c674e5"/><file name="config.xml" hash="44288dc8449f4596341d2524a40afbf0"/><file name="currencies.xml" hash="3945d48f94901335a17d60b8023734b3"/><file name="system.xml" hash="42521faf8af89246d745756c8d01e1cc"/></dir><dir name="sql"><dir name="bluesnap_setup"><file name="mysql4-install-1.0.0.php" hash="deff408cebf43a0da27df234b3a4a574"/><file name="mysql4-upgrade-1.0.0-1.0.2.php" hash="52410fd8ad042a40d689cdd11029336f"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="c46114a7c3d63191ad2f7981a28e6d61"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="0ca97a398e2217d46ae1bead746c13ee"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bluesnap_Payment.xml" hash="d3304c1c54e41d26ee462e511984e924"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bluesnap"><dir><dir name="customer"><dir name="widget"><file name="name.phtml" hash="98710530af5e22bedbcb48854f0f5bb6"/></dir></dir><dir name="payment"><dir name="buynow"><dir name="checkout"><dir name="info"><dir name="order"><dir name="items"><dir name="renderer"><file name="bundle.phtml" hash="867621a538e465f43f817a0ef75f85ae"/><file name="default.phtml" hash="31d37f4de5cd9661bc25c61f8ea72684"/><file name="downloadable.phtml" hash="daa576d0856a7808ba572246d10bf44b"/></dir></dir><file name="items.phtml" hash="3d7417a464c5cc98da6670305c7d7912"/></dir><file name="order.phtml" hash="db7b9d59b520e29d1c871518420dc7fa"/></dir></dir><file name="redirect.phtml" hash="6b5ad1684c9fe882df886b420f79c357"/></dir><dir name="form"><file name="buynow.phtml" hash="d18dc5a30deff9ea585e4b6a92553d2f"/><file name="cse.phtml" hash="b8ec8141b365b6110a65ee32e5e622c5"/><file name="saved.phtml" hash="63dba7d1300862d74523e673e5886d0a"/></dir><dir name="info"><file name="buynow.phtml" hash="a0b46dbd5993b7da89fea982b11c5b43"/></dir><file name="methods-test.phtml" hash="f495f87981d55bfad3b9897ee01e03ef"/><dir name="sales"><dir name="order"><file name="totals.phtml" hash="0144d7a8b2db6a0b491f22aac911582b"/></dir></dir><dir name="tax"><dir name="checkout"><file name="grandtotal.phtml" hash="e6aaa428653de04a146dfa5d588ab052"/></dir></dir></dir></dir></dir></dir><dir name="layout"><dir name="bluesnap"><file name="payment.xml" hash="21559c82102292fdd3867325f2e1a9c0"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="bluesnap"><file name="head_js.phtml" hash="874c25bd8bfcdbddd0e890de369e7c35"/><dir><dir name="payment"><dir name="form"><file name="buynow.phtml" hash="d18dc5a30deff9ea585e4b6a92553d2f"/><file name="cse.phtml" hash="355607f6ea20ab8e065961154d995c06"/><file name="saved.phtml" hash="c6a5ae314cba0f2ef8844886c8832b40"/></dir><dir name="info"><file name="buynow.phtml" hash="15118c84071e9111010a647cfb8e8ba3"/></dir></dir><dir name="sales"><dir name="order"><file name="totals.phtml" hash="4440829e839cd288d5220c2e6b9936e9"/></dir></dir></dir></dir></dir><dir name="layout"><file name="bluesnap.xml" hash="63ded7cc83af17f90ed419dc8f67b034"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="transaction_refunded.html" hash="63ed356d54eb6d8bebdd9e3f01d8577c"/><file name="transaction_refund_failed.html" hash="8d1dc8b5f2efd354a1e3f246323604f3"/><file name="transaction_declined.html" hash="3ad925930b208fca54375b7d223a87f1"/><file name="transaction_chargeback.html" hash="d209b430260880c27bb32f7ffd535b6b"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="bluesnap"><file name="credit-card-detect.js" hash="910c698e825854d3905113b37e5d52d9"/><file name="payform.js" hash="305e24d4a404eb512bbed5ab9ee186c6"/></dir></dir><dir name="css"><dir name="bluesnap"><dir name="buynow"><file name="checkout.css" hash="d15caa2328c6dd238479ff848510462c"/></dir></dir></dir><dir name="images"><dir name="bluesnap"><dir name="buynow"><file name="bluesnap-icons.png" hash="7e2c587b2fb4118753e542edf1ec99e1"/><file name="cards.png" hash="a428701f5315f2ca85f1e92fe08f6b33"/><file name="credit-card-icons.jpg" hash="605484903d131fbccfd71dc9c669efdd"/><file name="sprite-cards.png" hash="aac569c1960ff2b18fbeb1bcba2655e1"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="lib"><dir name="jquery"><dir name="jquery-ui"><dir><dir name="external"><dir name="jquery"><file name="jquery.js" hash="91515770ce8c55de23b306444d8ea998"/></dir></dir><dir name="images"><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="210d3532b494ab40582720391610fced"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="936672ede7670bf3137617a10ff5a822"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="a560a96b625b078136e0b8a7c44296e5"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="2f810182cc0cbc8379f224134e77115c"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="5c8670d69f9806c382e58d44e762be97"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="5ac041ef2a6a16a186195c21d7719d55"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="b62dea37c2b588ca16c615b4cd283f18"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="4a2b80d82a880c8feba6466c437ffaf7"/><file name="ui-icons_222222_256x240.png" hash="3a3c5468f484f07ac4a320d9e22acb8c"/><file name="ui-icons_228ef1_256x240.png" hash="92b29683b6a48eae7de7eb4b1cfa039c"/><file name="ui-icons_ef8c08_256x240.png" hash="f492970693640894fb54166c75dd2925"/><file name="ui-icons_ffd27a_256x240.png" hash="dda1b6f694b0d196aefc66a1d6d758f6"/><file name="ui-icons_ffffff_256x240.png" hash="41612b0f4a034424f8321c9f824a94da"/></dir></dir><file name="index.html" hash="599df27072772c383d59eff35ce47389"/><file name="jquery-ui.css" hash="d546ace9545c984dad3366bad72a2846"/><file name="jquery-ui.js" hash="b78f2c8ec1b19df2352bb7eac8449a31"/><file name="jquery-ui.min.css" hash="b38cb48591129782d11d8ed7dc907cba"/><file name="jquery-ui.min.js" hash="6b5d4f0060b4c9b850dc2c658fb621e5"/><file name="jquery-ui.structure.css" hash="d0513b6eb397ffd447a25b818bbf849a"/><file name="jquery-ui.structure.min.css" hash="fbd5637f600da6f2c183cddf1793e2a7"/><file name="jquery-ui.theme.css" hash="8ca374e05408e9710e3c389af2d1ccf5"/><file name="jquery-ui.theme.min.css" hash="55a14f8a1354b43b7f1ac8820b89ef94"/></dir></dir></dir><dir name="bluesnap"><file name="bsadmin.js" hash="66b4b771d221a69762f68fe7266c3ba2"/></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.3.0</min><max>5.7.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>bluesnap_payment</name>
|
| 4 |
+
<version>2.0.3.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Community GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Magento Extension for BlueSnap payment</summary>
|
| 10 |
<description>Magento Extension for BlueSnap payment</description>
|
| 11 |
+
<notes>- changed text in system </notes>
|
| 12 |
<authors><author><name>Nachshon Fishbane</name><user>nahshf</user><email>nachshon@fisha.co.il</email></author></authors>
|
| 13 |
+
<date>2016-07-28</date>
|
| 14 |
+
<time>17:12:29</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Bluesnap"><dir name="Payment"><dir name="Block"><dir name="Adminhtml"><dir name="Api"><dir name="Logger"><file name="Grid.php" hash="e35bcb916e09738a725c0a312e982feb"/></dir><file name="Logger.php" hash="7af64a11fe665ca23066a00ae1202613"/></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="d8b261305976d56263dbc85191a3cdb1"/></dir><dir name="Grid"><dir name="Renderer"><file name="Paymentmethod.php" hash="4480da922527c8112cf070fccaf1fb4c"/></dir></dir><file name="Grid.php" hash="61337375bdc7c2199cab847fc30f2e04"/><dir name="Invoice"><file name="Totals.php" hash="89e1277f55d54e6988a1570175b0b4c4"/></dir><file name="Totals.php" hash="f6792ad7311197814aa01be3ce820509"/><dir name="View"><dir name="Tab"><file name="Creditmemos.php" hash="41ac64fb7ec61359c51e9130731b2f33"/><file name="Invoices.php" hash="02a1e7dfdc8662e5336ef7982022d74a"/></dir></dir></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Xml.php" hash="1d1d40b7015a2cf644c322bf5c8c866c"/></dir></dir></dir></dir></dir><dir name="Buynow"><file name="Iframe.php" hash="52486def3cd9f2dcd83d54d3be08d578"/><dir name="Info"><file name="Order.php" hash="9c8b04eccc780a873b09a11cd080e547"/></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Totals.php" hash="7eae09cf26577676c617694aa7cf8640"/></dir><file name="Grandtotal.php" hash="ba6fd8aaf003c015abfa466adfb2e644"/></dir><dir name="Customer"><dir name="Widget"><file name="Name.php" hash="3a4e9de6e6068a9c9646eb68f24a0d48"/></dir></dir><dir name="Order"><file name="Totals.php" hash="30d2f0311e1aceb1ee3c2adf0aad284c"/></dir><dir name="Payment"><dir name="Form"><file name="Buynow.php" hash="36a0238b3949f3f9d3bc3bef4dc72203"/><file name="Cse.php" hash="9497889bc1f0e962efe4afb5c3b4a0aa"/><file name="Saved.php" hash="7ad6d859034c93e46f47380914539493"/></dir><dir name="Info"><file name="Buynow.php" hash="94237e9a306db4199df55aacddee8272"/><file name="Cse.php" hash="14f154e5371b2e376ff8b3d7c7b78b5c"/></dir></dir></dir><file name="Exception.php" hash="0337cb725383fa330ab08803d95d0770"/><dir name="Helper"><file name="Checkout.php" hash="63cdf126f87f2afb7dee46e34e94d45e"/><file name="Config.php" hash="6b7ec2cae242e75d9344d890d860e618"/><file name="Data.php" hash="87d778cea74dc17b7dff0b9231a08cfb"/><file name="Email.php" hash="e3acaafcd503e947fc28ae39c2616893"/><file name="Sales.php" hash="0ffc35ee24e44fb5c921e2b0f72fc3f1"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="19516e30bef2d5c158627b3cbc42f0f2"/><file name="Buynow.php" hash="5dc62c76f61cbe70e08ea5fe842e2b40"/><file name="Config.php" hash="e45b9fd65420aa5172814e20160a66e6"/><file name="Cse.php" hash="380f04f7a7a23ed73f2a14c735096dd7"/><file name="Currency.php" hash="c792fe8012211b8d89ebf6a171d20690"/><file name="Exception.php" hash="ecd51203c6ad643980b3c260f64df0bf"/><file name="Logger.php" hash="4ef0d3dae4ba2df0ba6c0fff7753a18b"/><file name="Refund.php" hash="78e23a01fefaabe7b673fbd8ff3929d9"/><file name="Saved.php" hash="27f0a9ab9d8498c046ccdb605cb8d490"/></dir><dir name="Directory"><dir name="Currency"><file name="Import.php" hash="4c75acef7a276dbacd34d4a9407055ae"/></dir><file name="Currency.php" hash="8235b8195671a7d69708157469b2ed7b"/><file name="Observer.php" hash="de717bb7dcac6fe1c9c96623f17a919b"/></dir><file name="Ipn.php" hash="16066535e74cce434c532c09600b0020"/><dir name="Logger"><dir name="Db"><file name="Entry.php" hash="c8ec0373040489819cbdd653c31a179a"/></dir><file name="Db.php" hash="a181a248d2b410a0d5964540a574343d"/><file name="File.php" hash="12eb5993943f7be0a0bb83c2b740abad"/><file name="Mail.php" hash="7ee74389226a425f4f10d78ad820dd5f"/></dir><file name="Observer.php" hash="5394eb772b0045c4b78b699ced24a8ab"/><dir name="Payment"><file name="Abstract.php" hash="23222f7e488f3e3898624866100447e9"/><file name="Buynow.php" hash="a7b96667c7ab05caf1b1c818c88acfdd"/><file name="Cse.php" hash="68cb0a93bf7e9ca276f0b152478647d6"/></dir><dir name="Resource"><dir name="Directory"><file name="Currency.php" hash="21fdc0c6e85652cc07cec3f7e287e1c9"/></dir><dir name="Logger"><dir name="Db"><dir name="Entry"><file name="Collection.php" hash="328246533e58befe7308120a0c6919ee"/></dir><file name="Entry.php" hash="8b7deb7f148846f3913390de6de5dccd"/></dir></dir></dir><dir name="Sales"><dir name="Order"><file name="Payment.php" hash="74bb18a53d41fa10a7ede2e740ae6375"/></dir><file name="Order.php" hash="901431fa7219a40200abcc9502f50ed6"/></dir><file name="Sslvalidation.php" hash="541f09f741591d5cb583f9021c312dc3"/><dir name="System"><dir name="Config"><dir name="Source"><file name="PaymentAction.php" hash="575ee53a84e5dcb9f01db85af6a9f814"/><file name="Priorities.php" hash="836b142dee2ed56ee06d9c6de5ef0d30"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Bluesnap"><file name="LoggerController.php" hash="105c40df4cac28602b47677033d1c05c"/></dir></dir><file name="CheckoutController.php" hash="ffcc6df5e95e79cb0b464a27ea94304d"/><file name="IpnController.php" hash="2ccff15342071d1b02b710cd6bea06ee"/></dir><dir name="etc"><file name="adminhtml.xml" hash="fea2afd0b7b1bad56357d41a55c674e5"/><file name="config.xml" hash="e1ad733fa695a81021ad3a85c907eace"/><file name="currencies.xml" hash="3945d48f94901335a17d60b8023734b3"/><file name="system.xml" hash="750418c4f637fce4d5bf43f9a629ba9c"/></dir><dir name="sql"><dir name="bluesnap_setup"><file name="mysql4-install-1.0.0.php" hash="deff408cebf43a0da27df234b3a4a574"/><file name="mysql4-upgrade-1.0.0-1.0.2.php" hash="52410fd8ad042a40d689cdd11029336f"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="920c513178069a52611c95612e3b8f13"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="1e71bac7b62e64233df39a669fb5effb"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bluesnap_Payment.xml" hash="d3304c1c54e41d26ee462e511984e924"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bluesnap"><dir><dir name="customer"><dir name="widget"><file name="name.phtml" hash="98710530af5e22bedbcb48854f0f5bb6"/></dir></dir><dir name="payment"><dir name="buynow"><dir name="checkout"><dir name="info"><dir name="order"><dir name="items"><dir name="renderer"><file name="bundle.phtml" hash="867621a538e465f43f817a0ef75f85ae"/><file name="default.phtml" hash="31d37f4de5cd9661bc25c61f8ea72684"/><file name="downloadable.phtml" hash="daa576d0856a7808ba572246d10bf44b"/></dir></dir><file name="items.phtml" hash="3d7417a464c5cc98da6670305c7d7912"/></dir><file name="order.phtml" hash="db7b9d59b520e29d1c871518420dc7fa"/></dir></dir><file name="redirect.phtml" hash="6b5ad1684c9fe882df886b420f79c357"/></dir><dir name="form"><file name="buynow.phtml" hash="d18dc5a30deff9ea585e4b6a92553d2f"/><file name="cse.phtml" hash="a402643578967212832487bc8c87587e"/><file name="saved.phtml" hash="63dba7d1300862d74523e673e5886d0a"/></dir><dir name="info"><file name="buynow.phtml" hash="a0b46dbd5993b7da89fea982b11c5b43"/></dir><file name="methods-test.phtml" hash="f495f87981d55bfad3b9897ee01e03ef"/><dir name="sales"><dir name="order"><file name="totals.phtml" hash="0144d7a8b2db6a0b491f22aac911582b"/></dir></dir><dir name="tax"><dir name="checkout"><file name="grandtotal.phtml" hash="e6aaa428653de04a146dfa5d588ab052"/></dir></dir></dir></dir></dir></dir><dir name="layout"><dir name="bluesnap"><file name="payment.xml" hash="38c606a548436e0aec20725555d7862d"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="bluesnap"><file name="head_js.phtml" hash="874c25bd8bfcdbddd0e890de369e7c35"/><dir><dir name="payment"><dir name="form"><file name="buynow.phtml" hash="d18dc5a30deff9ea585e4b6a92553d2f"/><file name="cse.phtml" hash="355607f6ea20ab8e065961154d995c06"/><file name="saved.phtml" hash="c6a5ae314cba0f2ef8844886c8832b40"/></dir><dir name="info"><file name="buynow.phtml" hash="15118c84071e9111010a647cfb8e8ba3"/></dir></dir><dir name="sales"><dir name="order"><file name="totals.phtml" hash="4440829e839cd288d5220c2e6b9936e9"/></dir></dir></dir></dir></dir><dir name="layout"><file name="bluesnap.xml" hash="63ded7cc83af17f90ed419dc8f67b034"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="transaction_refunded.html" hash="63ed356d54eb6d8bebdd9e3f01d8577c"/><file name="transaction_refund_failed.html" hash="8d1dc8b5f2efd354a1e3f246323604f3"/><file name="transaction_declined.html" hash="3ad925930b208fca54375b7d223a87f1"/><file name="transaction_chargeback.html" hash="d209b430260880c27bb32f7ffd535b6b"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="bluesnap"><file name="credit-card-detect.js" hash="2d42294168ebc3a211799a36bcf80a33"/><file name="payform.js" hash="2c6f09a9445ab1d2683543c84f5fc112"/></dir></dir><dir name="css"><dir name="bluesnap"><dir name="buynow"><file name="checkout.css" hash="d15caa2328c6dd238479ff848510462c"/></dir></dir></dir><dir name="images"><dir name="bluesnap"><dir name="buynow"><file name="bluesnap-icons.png" hash="7e2c587b2fb4118753e542edf1ec99e1"/><file name="cards.png" hash="a428701f5315f2ca85f1e92fe08f6b33"/><file name="credit-card-icons.jpg" hash="605484903d131fbccfd71dc9c669efdd"/><file name="sprite-cards.png" hash="aac569c1960ff2b18fbeb1bcba2655e1"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="bluesnap"><file name="bsadmin.js" hash="66b4b771d221a69762f68fe7266c3ba2"/><file name="payform.js" hash="2c6f09a9445ab1d2683543c84f5fc112"/><file name="credit-card-detect.js" hash="ae11ea2ff6e52c0d12e022077718176b"/></dir><dir name="lib"><dir name="jquery"><file name="jquery-3.0.0.min.js" hash="d0212568ce69457081dacf84e327fa5c"/><file name="bluesnap-noconflict.js" hash="aa385db0edc8478d5f7c7ae23e4b42f5"/><dir name="jquery-ui"><dir><dir name="external"><dir name="jquery"><file name="jquery.js" hash="91515770ce8c55de23b306444d8ea998"/></dir></dir><dir name="images"><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="210d3532b494ab40582720391610fced"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="936672ede7670bf3137617a10ff5a822"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="a560a96b625b078136e0b8a7c44296e5"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="2f810182cc0cbc8379f224134e77115c"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="5c8670d69f9806c382e58d44e762be97"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="5ac041ef2a6a16a186195c21d7719d55"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="b62dea37c2b588ca16c615b4cd283f18"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="4a2b80d82a880c8feba6466c437ffaf7"/><file name="ui-icons_222222_256x240.png" hash="3a3c5468f484f07ac4a320d9e22acb8c"/><file name="ui-icons_228ef1_256x240.png" hash="92b29683b6a48eae7de7eb4b1cfa039c"/><file name="ui-icons_ef8c08_256x240.png" hash="f492970693640894fb54166c75dd2925"/><file name="ui-icons_ffd27a_256x240.png" hash="dda1b6f694b0d196aefc66a1d6d758f6"/><file name="ui-icons_ffffff_256x240.png" hash="41612b0f4a034424f8321c9f824a94da"/></dir></dir><file name="index.html" hash="599df27072772c383d59eff35ce47389"/><file name="jquery-ui.css" hash="d546ace9545c984dad3366bad72a2846"/><file name="jquery-ui.js" hash="b78f2c8ec1b19df2352bb7eac8449a31"/><file name="jquery-ui.min.css" hash="b38cb48591129782d11d8ed7dc907cba"/><file name="jquery-ui.min.js" hash="6b5d4f0060b4c9b850dc2c658fb621e5"/><file name="jquery-ui.structure.css" hash="d0513b6eb397ffd447a25b818bbf849a"/><file name="jquery-ui.structure.min.css" hash="fbd5637f600da6f2c183cddf1793e2a7"/><file name="jquery-ui.theme.css" hash="8ca374e05408e9710e3c389af2d1ccf5"/><file name="jquery-ui.theme.min.css" hash="55a14f8a1354b43b7f1ac8820b89ef94"/></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.3.0</min><max>5.7.0</max></php></required></dependencies>
|
| 18 |
</package>
|
skin/frontend/base/default/js/bluesnap/credit-card-detect.js
CHANGED
|
@@ -216,3 +216,76 @@
|
|
| 216 |
|
| 217 |
};
|
| 218 |
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
|
| 217 |
};
|
| 218 |
})(jQuery);
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
function removeSpaceCc(el){
|
| 222 |
+
var val = el.value.replace(/\s/g, "");
|
| 223 |
+
document.getElementById("cse_cc_number").value=val;
|
| 224 |
+
console.log(payform.parseCardType(val));
|
| 225 |
+
console.log(getType(document.getElementById("cse_cc_type").value));
|
| 226 |
+
|
| 227 |
+
if(document.getElementById("cse_cc_type").value=='' || payform.parseCardType(val) != getType(document.getElementById("cse_cc_type").value)){
|
| 228 |
+
var creditCardType = payform.parseCardType(val);
|
| 229 |
+
switch(creditCardType) {
|
| 230 |
+
case 'visa':
|
| 231 |
+
jQuery('.pli-cc-VISA').addClass('pli-active');
|
| 232 |
+
jQuery("select[id=cse_cc_type]").val('VI');
|
| 233 |
+
break;
|
| 234 |
+
case 'mastercard':
|
| 235 |
+
jQuery('.pli-cc-MASTERCARD').addClass('pli-active');
|
| 236 |
+
jQuery("select[id=cse_cc_type]").val('MC');
|
| 237 |
+
break;
|
| 238 |
+
case 'amex':
|
| 239 |
+
jQuery('.pli-cc-AMEX').addClass('pli-active');
|
| 240 |
+
jQuery("select[id=cse_cc_type]").val('AE');
|
| 241 |
+
break;
|
| 242 |
+
case 'discover':
|
| 243 |
+
jQuery('.pli-cc-DISCOVER').addClass('pli-active');
|
| 244 |
+
jQuery("select[id=cse_cc_type]").val('DI');
|
| 245 |
+
break;
|
| 246 |
+
case 'jcb':
|
| 247 |
+
jQuery('.pli-cc-JCB').addClass('pli-active');
|
| 248 |
+
jQuery("select[id=cse_cc_type]").val('JCB');
|
| 249 |
+
break;
|
| 250 |
+
case 'dinersclub':
|
| 251 |
+
jQuery('.pli-cc-DINERS').addClass('pli-active');
|
| 252 |
+
jQuery("select[id=cse_cc_type]").val('DC');
|
| 253 |
+
break;
|
| 254 |
+
case 'carteblue':
|
| 255 |
+
jQuery('.pli-cc-CARTE_BLEUE').addClass('pli-active');
|
| 256 |
+
jQuery("select[id=cse_cc_type]").val('CB');
|
| 257 |
+
break;
|
| 258 |
+
};
|
| 259 |
+
|
| 260 |
+
if(jQuery(".validation-advice")) {
|
| 261 |
+
jQuery(".validation-advice").hide();
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
}
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
function getType(code){
|
| 268 |
+
switch(code) {
|
| 269 |
+
case 'VI':
|
| 270 |
+
return "visa";
|
| 271 |
+
break;
|
| 272 |
+
case 'MC':
|
| 273 |
+
return 'mastercard';
|
| 274 |
+
break;
|
| 275 |
+
case 'AE':
|
| 276 |
+
return "amex";
|
| 277 |
+
break;
|
| 278 |
+
case 'DI':
|
| 279 |
+
return 'discover';
|
| 280 |
+
break;
|
| 281 |
+
case 'JCB':
|
| 282 |
+
return 'jcb';
|
| 283 |
+
break;
|
| 284 |
+
case 'DC':
|
| 285 |
+
return "dinersclub";
|
| 286 |
+
break;
|
| 287 |
+
case 'CB':
|
| 288 |
+
return 'carteblue';
|
| 289 |
+
break;
|
| 290 |
+
};
|
| 291 |
+
}
|
skin/frontend/base/default/js/bluesnap/payform.js
CHANGED
|
@@ -108,10 +108,6 @@
|
|
| 108 |
luhn: true
|
| 109 |
|
| 110 |
},
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
{
|
| 116 |
type: 'mastercard',
|
| 117 |
pattern: /^(5[1-5]|2[2-7])/,
|
|
@@ -122,10 +118,11 @@
|
|
| 122 |
},
|
| 123 |
{
|
| 124 |
type: 'amex',
|
| 125 |
-
|
|
|
|
| 126 |
format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
|
| 127 |
length: [15],
|
| 128 |
-
cvcLength: [
|
| 129 |
luhn: true
|
| 130 |
}, {
|
| 131 |
type: 'dinersclub',
|
|
@@ -135,9 +132,6 @@
|
|
| 135 |
cvcLength: [3],
|
| 136 |
luhn: true
|
| 137 |
},
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
{
|
| 142 |
type: 'discover',
|
| 143 |
pattern: /^6([045]|22)/,
|
|
@@ -162,16 +156,10 @@
|
|
| 162 |
},
|
| 163 |
|
| 164 |
// from https://github.com/PawelDecowski/jquery-creditcardvalidator/blob/master/jquery.creditCardValidator.js
|
| 165 |
-
|
| 166 |
-
name: 'amex',
|
| 167 |
-
pattern: /^3[47]/,
|
| 168 |
-
format: defaultFormat,
|
| 169 |
-
length: [15],
|
| 170 |
-
cvcLength: [3, 4],
|
| 171 |
-
luhn: true
|
| 172 |
-
},
|
| 173 |
{
|
| 174 |
-
|
|
|
|
| 175 |
pattern: /^30[0-5]/,
|
| 176 |
format: defaultFormat,
|
| 177 |
length: [14],
|
|
@@ -179,14 +167,16 @@
|
|
| 179 |
luhn: true
|
| 180 |
},
|
| 181 |
{
|
| 182 |
-
|
|
|
|
| 183 |
pattern: /^36/,
|
| 184 |
format: defaultFormat,
|
| 185 |
length: [14],
|
| 186 |
cvcLength: [3],
|
| 187 |
luhn: true
|
| 188 |
}, {
|
| 189 |
-
|
|
|
|
| 190 |
format: defaultFormat,
|
| 191 |
pattern: /^35(2[89]|[3-8][0-9])/,
|
| 192 |
length: [16],
|
|
@@ -194,40 +184,46 @@
|
|
| 194 |
luhn: true
|
| 195 |
|
| 196 |
}, {
|
| 197 |
-
|
|
|
|
| 198 |
format: defaultFormat,
|
| 199 |
pattern: /^(6304|670[69]|6771)/,
|
| 200 |
length: [16, 17, 18, 19]
|
| 201 |
}, {
|
| 202 |
-
|
|
|
|
| 203 |
format: defaultFormat,
|
| 204 |
pattern: /^(4026|417500|4508|4844|491(3|7))/,
|
| 205 |
length: [16],
|
| 206 |
cvcLength: [3],
|
| 207 |
luhn: true
|
| 208 |
}, {
|
| 209 |
-
|
|
|
|
| 210 |
format: defaultFormat,
|
| 211 |
pattern: /^4/,
|
| 212 |
length: [16],
|
| 213 |
cvcLength: [3],
|
| 214 |
luhn: true
|
| 215 |
}, {
|
| 216 |
-
|
|
|
|
| 217 |
format: defaultFormat,
|
| 218 |
pattern: /^5[1-5]/,
|
| 219 |
length: [16],
|
| 220 |
cvcLength: [3],
|
| 221 |
luhn: true
|
| 222 |
}, {
|
| 223 |
-
|
|
|
|
| 224 |
format: defaultFormat,
|
| 225 |
pattern: /^(5018|5020|5038|6304|6759|676[1-3])/,
|
| 226 |
length: [12, 13, 14, 15, 16, 17, 18, 19],
|
| 227 |
cvcLength: [3],
|
| 228 |
luhn: true
|
| 229 |
}, {
|
| 230 |
-
|
|
|
|
| 231 |
format: defaultFormat,
|
| 232 |
pattern: /^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,
|
| 233 |
length: [16],
|
|
@@ -380,6 +376,7 @@
|
|
| 380 |
return e.target.setSelectionRange(cursor, cursor);
|
| 381 |
}
|
| 382 |
};
|
|
|
|
| 383 |
formatCardExpiry = function(e) {
|
| 384 |
var digit, val;
|
| 385 |
digit = String.fromCharCode(e.which);
|
|
@@ -540,6 +537,9 @@
|
|
| 540 |
_on(input, 'change', restrictNumeric);
|
| 541 |
return _on(input, 'input', restrictNumeric);
|
| 542 |
};
|
|
|
|
|
|
|
|
|
|
| 543 |
payform.parseCardExpiry = function(value) {
|
| 544 |
var month, prefix, ref, year;
|
| 545 |
value = value.replace(/\s/g, '');
|
|
@@ -558,14 +558,17 @@
|
|
| 558 |
};
|
| 559 |
payform.validateCardNumber = function(num) {
|
| 560 |
var card, ref;
|
|
|
|
| 561 |
num = (num + '').replace(/\s+|-/g, '');
|
| 562 |
if (!/^\d+$/.test(num)) {
|
| 563 |
return false;
|
| 564 |
}
|
| 565 |
-
|
|
|
|
| 566 |
if (!card) {
|
| 567 |
return false;
|
| 568 |
}
|
|
|
|
| 569 |
return (ref = num.length, indexOf.call(card.length, ref) >= 0) && (card.luhn === false || luhnCheck(num));
|
| 570 |
};
|
| 571 |
payform.validateCardExpiry = function(month, year) {
|
|
@@ -606,10 +609,16 @@
|
|
| 606 |
payform.validateCardCVC = function(cvc, type) {
|
| 607 |
var card, ref;
|
| 608 |
cvc = String(cvc).trim();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
if (!/^\d+$/.test(cvc)) {
|
| 610 |
return false;
|
| 611 |
}
|
| 612 |
card = cardFromType(type);
|
|
|
|
| 613 |
if (card != null) {
|
| 614 |
return ref = cvc.length, indexOf.call(card.cvcLength, ref) >= 0;
|
| 615 |
} else {
|
| 108 |
luhn: true
|
| 109 |
|
| 110 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
{
|
| 112 |
type: 'mastercard',
|
| 113 |
pattern: /^(5[1-5]|2[2-7])/,
|
| 118 |
},
|
| 119 |
{
|
| 120 |
type: 'amex',
|
| 121 |
+
pattern: /^3(4|7)/,
|
| 122 |
+
// pattern: /^3[47]/,
|
| 123 |
format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
|
| 124 |
length: [15],
|
| 125 |
+
cvcLength: [4],
|
| 126 |
luhn: true
|
| 127 |
}, {
|
| 128 |
type: 'dinersclub',
|
| 132 |
cvcLength: [3],
|
| 133 |
luhn: true
|
| 134 |
},
|
|
|
|
|
|
|
|
|
|
| 135 |
{
|
| 136 |
type: 'discover',
|
| 137 |
pattern: /^6([045]|22)/,
|
| 156 |
},
|
| 157 |
|
| 158 |
// from https://github.com/PawelDecowski/jquery-creditcardvalidator/blob/master/jquery.creditCardValidator.js
|
| 159 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
{
|
| 161 |
+
type: 'carte_blanche',
|
| 162 |
+
// name: 'carte_blanche',
|
| 163 |
pattern: /^30[0-5]/,
|
| 164 |
format: defaultFormat,
|
| 165 |
length: [14],
|
| 167 |
luhn: true
|
| 168 |
},
|
| 169 |
{
|
| 170 |
+
type: 'dinersclub',
|
| 171 |
+
// name: 'dinersclub',
|
| 172 |
pattern: /^36/,
|
| 173 |
format: defaultFormat,
|
| 174 |
length: [14],
|
| 175 |
cvcLength: [3],
|
| 176 |
luhn: true
|
| 177 |
}, {
|
| 178 |
+
type: 'jcb',
|
| 179 |
+
// name: 'jcb',
|
| 180 |
format: defaultFormat,
|
| 181 |
pattern: /^35(2[89]|[3-8][0-9])/,
|
| 182 |
length: [16],
|
| 184 |
luhn: true
|
| 185 |
|
| 186 |
}, {
|
| 187 |
+
type: 'laser',
|
| 188 |
+
// name: 'laser',
|
| 189 |
format: defaultFormat,
|
| 190 |
pattern: /^(6304|670[69]|6771)/,
|
| 191 |
length: [16, 17, 18, 19]
|
| 192 |
}, {
|
| 193 |
+
type: 'visa_electron',
|
| 194 |
+
// name: 'visa_electron',
|
| 195 |
format: defaultFormat,
|
| 196 |
pattern: /^(4026|417500|4508|4844|491(3|7))/,
|
| 197 |
length: [16],
|
| 198 |
cvcLength: [3],
|
| 199 |
luhn: true
|
| 200 |
}, {
|
| 201 |
+
type: 'visa',
|
| 202 |
+
// name: 'visa',
|
| 203 |
format: defaultFormat,
|
| 204 |
pattern: /^4/,
|
| 205 |
length: [16],
|
| 206 |
cvcLength: [3],
|
| 207 |
luhn: true
|
| 208 |
}, {
|
| 209 |
+
type: 'mastercard',
|
| 210 |
+
// name: 'mastercard',
|
| 211 |
format: defaultFormat,
|
| 212 |
pattern: /^5[1-5]/,
|
| 213 |
length: [16],
|
| 214 |
cvcLength: [3],
|
| 215 |
luhn: true
|
| 216 |
}, {
|
| 217 |
+
type: 'maestro',
|
| 218 |
+
// name: 'maestro',
|
| 219 |
format: defaultFormat,
|
| 220 |
pattern: /^(5018|5020|5038|6304|6759|676[1-3])/,
|
| 221 |
length: [12, 13, 14, 15, 16, 17, 18, 19],
|
| 222 |
cvcLength: [3],
|
| 223 |
luhn: true
|
| 224 |
}, {
|
| 225 |
+
type: 'discover',
|
| 226 |
+
// name: 'discover',
|
| 227 |
format: defaultFormat,
|
| 228 |
pattern: /^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,
|
| 229 |
length: [16],
|
| 376 |
return e.target.setSelectionRange(cursor, cursor);
|
| 377 |
}
|
| 378 |
};
|
| 379 |
+
|
| 380 |
formatCardExpiry = function(e) {
|
| 381 |
var digit, val;
|
| 382 |
digit = String.fromCharCode(e.which);
|
| 537 |
_on(input, 'change', restrictNumeric);
|
| 538 |
return _on(input, 'input', restrictNumeric);
|
| 539 |
};
|
| 540 |
+
payform.cardFromNumber = function(num) {
|
| 541 |
+
return cardFromNumber(num);
|
| 542 |
+
};
|
| 543 |
payform.parseCardExpiry = function(value) {
|
| 544 |
var month, prefix, ref, year;
|
| 545 |
value = value.replace(/\s/g, '');
|
| 558 |
};
|
| 559 |
payform.validateCardNumber = function(num) {
|
| 560 |
var card, ref;
|
| 561 |
+
|
| 562 |
num = (num + '').replace(/\s+|-/g, '');
|
| 563 |
if (!/^\d+$/.test(num)) {
|
| 564 |
return false;
|
| 565 |
}
|
| 566 |
+
|
| 567 |
+
card = cardFromNumber(num);
|
| 568 |
if (!card) {
|
| 569 |
return false;
|
| 570 |
}
|
| 571 |
+
|
| 572 |
return (ref = num.length, indexOf.call(card.length, ref) >= 0) && (card.luhn === false || luhnCheck(num));
|
| 573 |
};
|
| 574 |
payform.validateCardExpiry = function(month, year) {
|
| 609 |
payform.validateCardCVC = function(cvc, type) {
|
| 610 |
var card, ref;
|
| 611 |
cvc = String(cvc).trim();
|
| 612 |
+
|
| 613 |
+
if(!type) {
|
| 614 |
+
type = this.parseCardType($("cse_cc_number").getValue());
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
if (!/^\d+$/.test(cvc)) {
|
| 618 |
return false;
|
| 619 |
}
|
| 620 |
card = cardFromType(type);
|
| 621 |
+
|
| 622 |
if (card != null) {
|
| 623 |
return ref = cvc.length, indexOf.call(card.cvcLength, ref) >= 0;
|
| 624 |
} else {
|
