Version Notes
New version paysonCheckout2
Download this release
Release Info
Developer | Oscar Villegas |
Extension | PaysonCheckout2 |
Version | 1.0.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.0.2 to 1.0.0.3
app/code/community/Payson/Checkout2/Helper/Order.php
CHANGED
@@ -10,8 +10,8 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
10 |
protected $controlKey;
|
11 |
|
12 |
const MODULE_NAME = 'PaysonCheckout2.0_magento';
|
13 |
-
const MODULE_VERSION = '1.0.0.
|
14 |
-
|
15 |
public function checkout() {
|
16 |
$order = $this->getOrder();
|
17 |
|
@@ -88,6 +88,8 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
88 |
|
89 |
$checkoutId = $callPaysonApi->CreateCheckout($checkout);
|
90 |
$quote->setData(Payson_Checkout2_Model_Order::CHECKOUT_ID_COLUMN, $checkoutId);
|
|
|
|
|
91 |
$quote->save();
|
92 |
|
93 |
$this->updateCheckoutControlKey($checkoutId);
|
@@ -318,6 +320,32 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
318 |
|
319 |
return $locale;
|
320 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
|
322 |
/**
|
323 |
* Helper for checkout()
|
@@ -487,6 +515,12 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
487 |
$testMode = $this->getConfig()->getTestMode();
|
488 |
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
$firstname = $testMode ? 'Tess T' : $customer->getFirstname();
|
491 |
$lastname = $testMode ? 'Persson' : $customer->getLastname();
|
492 |
$email = $testMode ? 'test@payson.se' : $customer->getEmail();
|
@@ -495,7 +529,7 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
495 |
$city = $testMode ? 'Stan' : '';
|
496 |
$street = $testMode ? 'Testgatan' : '';
|
497 |
$postCode = $testMode ? '99999' : '';
|
498 |
-
$country = $testMode ? '
|
499 |
|
500 |
if (!$testMode && $customer->getDefaultBilling()) {
|
501 |
$billingAddress = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
|
@@ -520,6 +554,13 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
520 |
$testMode = $this->getConfig()->getTestMode();
|
521 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
522 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
$firstname = $testMode ? 'Tess T' : $customer->getFirstname();
|
524 |
$lastname = $testMode ? 'Persson' : $customer->getLastname();
|
525 |
$email = $testMode ? 'test@payson.se' : $customer->getEmail();
|
@@ -528,7 +569,7 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
528 |
$city = $testMode ? 'Stan' : '';
|
529 |
$street = $testMode ? 'Testgatan' : '';
|
530 |
$postCode = $testMode ? '99999' : '';
|
531 |
-
$country = $testMode ? '
|
532 |
|
533 |
if ($quote->getBillingAddress()) {
|
534 |
$address = $quote->getBillingAddress();
|
@@ -644,16 +685,16 @@ class Payson_Checkout2_Helper_Order extends Mage_Core_Helper_Abstract
|
|
644 |
$quote->getPayment()->setMethod('checkout2');
|
645 |
$quote->setTotalsCollectedFlag(false)->collectTotals();
|
646 |
}
|
647 |
-
|
648 |
private function _udateShippingAddress($paysonCustomer) {
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
);
|
658 |
}
|
659 |
}
|
10 |
protected $controlKey;
|
11 |
|
12 |
const MODULE_NAME = 'PaysonCheckout2.0_magento';
|
13 |
+
const MODULE_VERSION = '1.0.0.2';
|
14 |
+
|
15 |
public function checkout() {
|
16 |
$order = $this->getOrder();
|
17 |
|
88 |
|
89 |
$checkoutId = $callPaysonApi->CreateCheckout($checkout);
|
90 |
$quote->setData(Payson_Checkout2_Model_Order::CHECKOUT_ID_COLUMN, $checkoutId);
|
91 |
+
//Set the email to the gest account Information
|
92 |
+
$quote->setCustomerEmail($customer->email);
|
93 |
$quote->save();
|
94 |
|
95 |
$this->updateCheckoutControlKey($checkoutId);
|
320 |
|
321 |
return $locale;
|
322 |
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Gets current lenguage
|
326 |
+
*
|
327 |
+
* @return string
|
328 |
+
*/
|
329 |
+
protected function getLenguageCode() {
|
330 |
+
$locale = Mage::getSingleton('core/locale')->getLocaleCode();
|
331 |
+
$locale = substr($locale, 0, 2);
|
332 |
+
|
333 |
+
if (strtoupper($locale )) {
|
334 |
+
switch ($locale) {
|
335 |
+
case 'da':
|
336 |
+
case 'no':
|
337 |
+
case 'se':
|
338 |
+
case 'sv':{
|
339 |
+
$locale = 'se';
|
340 |
+
break;
|
341 |
+
}
|
342 |
+
default: {
|
343 |
+
$locale = 'en';
|
344 |
+
}
|
345 |
+
}
|
346 |
+
}
|
347 |
+
return $locale;
|
348 |
+
}
|
349 |
|
350 |
/**
|
351 |
* Helper for checkout()
|
515 |
$testMode = $this->getConfig()->getTestMode();
|
516 |
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
517 |
|
518 |
+
$countryCodeCustomer = "";
|
519 |
+
if(is_object($customer->getDefaultBillingAddress()))
|
520 |
+
$countryCodeCustomer = $customer->getDefaultBillingAddress()->getCountry();
|
521 |
+
else
|
522 |
+
$countryCodeCustomer = $this->getLenguageCode();
|
523 |
+
|
524 |
$firstname = $testMode ? 'Tess T' : $customer->getFirstname();
|
525 |
$lastname = $testMode ? 'Persson' : $customer->getLastname();
|
526 |
$email = $testMode ? 'test@payson.se' : $customer->getEmail();
|
529 |
$city = $testMode ? 'Stan' : '';
|
530 |
$street = $testMode ? 'Testgatan' : '';
|
531 |
$postCode = $testMode ? '99999' : '';
|
532 |
+
$country = $testMode ? 'SE' : $countryCodeCustomer;
|
533 |
|
534 |
if (!$testMode && $customer->getDefaultBilling()) {
|
535 |
$billingAddress = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
|
554 |
$testMode = $this->getConfig()->getTestMode();
|
555 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
556 |
|
557 |
+
$countryCodeCustomer = "";
|
558 |
+
if(is_object($customer->getDefaultBillingAddress()))
|
559 |
+
$countryCodeCustomer = $customer->getDefaultBillingAddress()->getCountry();
|
560 |
+
else {
|
561 |
+
$countryCodeCustomer = $this->getLenguageCode();
|
562 |
+
}
|
563 |
+
|
564 |
$firstname = $testMode ? 'Tess T' : $customer->getFirstname();
|
565 |
$lastname = $testMode ? 'Persson' : $customer->getLastname();
|
566 |
$email = $testMode ? 'test@payson.se' : $customer->getEmail();
|
569 |
$city = $testMode ? 'Stan' : '';
|
570 |
$street = $testMode ? 'Testgatan' : '';
|
571 |
$postCode = $testMode ? '99999' : '';
|
572 |
+
$country = $testMode ? 'SE': $countryCodeCustomer;
|
573 |
|
574 |
if ($quote->getBillingAddress()) {
|
575 |
$address = $quote->getBillingAddress();
|
685 |
$quote->getPayment()->setMethod('checkout2');
|
686 |
$quote->setTotalsCollectedFlag(false)->collectTotals();
|
687 |
}
|
688 |
+
|
689 |
private function _udateShippingAddress($paysonCustomer) {
|
690 |
+
return array(
|
691 |
+
'firstname' => $paysonCustomer->firstName,
|
692 |
+
'lastname' => $paysonCustomer->lastName,
|
693 |
+
'street' => $paysonCustomer->street,
|
694 |
+
'city' => $paysonCustomer->city,
|
695 |
+
'postcode'=> $paysonCustomer->postalCode,
|
696 |
+
'telephone' => $paysonCustomer->phone,
|
697 |
+
'country_id' => $paysonCustomer->countryCode,
|
698 |
);
|
699 |
}
|
700 |
}
|
app/code/community/Payson/Checkout2/Model/Method/Checkout2.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
class Payson_Checkout2_Model_Method_Checkout2 extends Mage_Payment_Model_Method_Abstract
|
4 |
{
|
5 |
-
protected $_code = '
|
6 |
protected $_formBlockType = 'checkout2/form_checkout2';
|
7 |
protected $_infoBlockType = 'checkout2/info_checkout2';
|
8 |
|
@@ -22,6 +22,7 @@ class Payson_Checkout2_Model_Method_Checkout2 extends Mage_Payment_Model_Method_
|
|
22 |
protected $_canReviewPayment = false;
|
23 |
protected $_canCreateBillingAgreement = false;
|
24 |
protected $_canManageRecurringProfiles = false; // true
|
|
|
25 |
|
26 |
/**
|
27 |
* @inheritDoc
|
2 |
|
3 |
class Payson_Checkout2_Model_Method_Checkout2 extends Mage_Payment_Model_Method_Abstract
|
4 |
{
|
5 |
+
protected $_code = 'checkout2';
|
6 |
protected $_formBlockType = 'checkout2/form_checkout2';
|
7 |
protected $_infoBlockType = 'checkout2/info_checkout2';
|
8 |
|
22 |
protected $_canReviewPayment = false;
|
23 |
protected $_canCreateBillingAgreement = false;
|
24 |
protected $_canManageRecurringProfiles = false; // true
|
25 |
+
|
26 |
|
27 |
/**
|
28 |
* @inheritDoc
|
app/design/frontend/base/default/template/payson/Payson/standard_form.phtml
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$helper = Mage::Helper('payson');
|
3 |
-
$code = $this->getMethodCode();
|
4 |
-
$this->_config = Mage::getModel('payson/config');
|
5 |
-
|
6 |
-
?>
|
7 |
-
<fieldset class="form-list">
|
8 |
-
<label for="p_method_<?php echo($code); ?>" style="float: none"><img src="<?php echo(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)); ?>frontend/base/default/Payson/Payson/payson.png" alt="Payson" style="margin: 10px 0; display: block" /></label>
|
9 |
-
<p id="payment_form_<?php echo($code); ?>" style="display: none">
|
10 |
-
<?php
|
11 |
-
echo($helper->__('A payment window will be generated for your order'));
|
12 |
-
echo '<br /><br />'; ?>
|
13 |
-
</p>
|
14 |
-
</fieldset>
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>PaysonCheckout2</name>
|
4 |
-
<version>1.0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/bsd-license.php">BCD licence</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Official Payson module for Magento.</summary>
|
10 |
<description>Official Payson module for Magento. Use this to be able to handle invoice, card and direct bank transfers.</description>
|
11 |
-
<notes>New
|
12 |
-
<authors><author><name>
|
13 |
-
<date>2017-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Payson"><dir name="Checkout2"><dir name="Block"><dir name="Form"><file name="Checkout2.php" hash="2b67b75d9478b60388df76b60cbee459"/></dir><dir name="Info"><file name="Checkout2.php" hash="d577097f022794f5cd7a12fa88b17933"/></dir><file name="Payment.php" hash="9d9fd75b69580db7cccd60b225553690"/></dir><dir name="Helper"><file name="Data.php" hash="766f354fc4bccd415301b787b0fbd4f9"/><file name="Order.php" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.3.0</min><max>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>PaysonCheckout2</name>
|
4 |
+
<version>1.0.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/bsd-license.php">BCD licence</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Official Payson module for Magento.</summary>
|
10 |
<description>Official Payson module for Magento. Use this to be able to handle invoice, card and direct bank transfers.</description>
|
11 |
+
<notes>New version paysonCheckout2</notes>
|
12 |
+
<authors><author><name>Oscar</name><user>PaysonAB</user><email>integration@payson.se</email></author></authors>
|
13 |
+
<date>2017-09-05</date>
|
14 |
+
<time>08:33:11</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Payson"><dir name="Checkout2"><dir name="Block"><dir name="Form"><file name="Checkout2.php" hash="2b67b75d9478b60388df76b60cbee459"/></dir><dir name="Info"><file name="Checkout2.php" hash="d577097f022794f5cd7a12fa88b17933"/></dir><file name="Payment.php" hash="9d9fd75b69580db7cccd60b225553690"/></dir><dir name="Helper"><file name="Data.php" hash="766f354fc4bccd415301b787b0fbd4f9"/><file name="Order.php" hash="e5bb8dc63debbf6493b2685b142c90d0"/></dir><dir name="Model"><file name="Config.php" hash="98791c265d914dfc8fa2d3bde5cbbdc1"/><dir name="Method"><file name="Checkout2.php" hash="e4f9f49f923b747dedff23bbbe311c37"/></dir><file name="Notification.php" hash="7f7466bb8ce9ecdfc84f53a986c040c4"/><file name="Observer.php" hash="d5bc3717b51265d4b7b335debd23395c"/><file name="Order.php" hash="7caf0306a00499dbce2c756eeb7fdbc0"/><file name="Themes.php" hash="30c39fad25db4883bfbed8c79687958f"/><file name="VerificationTypes.php" hash="e8a9bccb0203a2af8140b3858684be56"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="1c8aeb17a1e55816fd1736d26224bb58"/></dir></dir></dir><file name="ExpressController.php" hash="19dc4319c4b6efea079f11dd35ab09dd"/><file name="NotificationController.php" hash="f3cba6067ac6fe9cc5060f1ce52eca6a"/><file name="PaymentController.php" hash="e70cfe80ef6aed32f6aba51d03a092ee"/></dir><dir name="etc"><file name="config.xml" hash="908d9295cdcdf73d85462f1d09e7eea6"/><file name="system.xml" hash="d2b161347c5c7cd4cf5d22080e141f26"/></dir><dir name="sql"><dir name="payson_checkout2_setup"><file name="mysql4-install-1.0.0.php" hash="c4139a6d4e830aa554b6d7cd106e4e25"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payson_checkout2.xml" hash="22b3bc15951f0c383c5e6f96d7949fad"/></dir><dir name="template"><dir name="payson"><dir name="checkout2"><dir name="elements"><file name="button.phtml" hash="1f63ccf569ff10d35e51616a413955d7"/><file name="minicartbutton.phtml" hash="a575c64a333be672cb8fc6aec89382d8"/></dir><dir name="form"><file name="checkout2.phtml" hash="99419617856e6c5ea93c3cf88ae4d490"/><file name="review.phtml" hash="2908826635a38b1dfd5640a1c6feba54"/><file name="shipping.phtml" hash="abd612bee8e11baf89c8468f76b00615"/></dir><dir name="page"><file name="blank.phtml" hash="509893c584213ad7d78e17a1a53249d1"/></dir><dir name="payment"><file name="confirmation.phtml" hash="d73bb16ae4b6d2b1d333079e84aa9b55"/><file name="express.phtml" hash="6d2757865efe818d2ab213992ffe40f3"/><file name="standard.phtml" hash="0da3b1e0080df8f31d808061939b430e"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Payson_Checkout2.xml" hash="dcbe0d3d1f1cad514c719d0a79f213e0"/></dir></target><target name="magelocale"><dir name="sv_SE"><file name="payson_checkout2.csv" hash="4555f2b2f86dffe56ccbe8e7ad373866"/></dir></target><target name="magelib"><dir name="Payson"><dir name="Checkout2"><dir name="PaysonCheckout2PHP"><file name="README.md" hash="bb8c8d92c7e18353d4d9d5a496a566da"/><file name="cancel_order.php" hash="094352d0bff59f9fed593707b8596679"/><dir name="example"><file name="cancel_order.php" hash="094352d0bff59f9fed593707b8596679"/><file name="config.php" hash="45966251b3cef234834cc1d2dc966e90"/><file name="confirmation.php" hash="7a50c9e9772ccc123c6d84cc8e2fe7f3"/><file name="index.php" hash="1b3081faa0d1835641c7259db5cf3837"/><file name="notification.php" hash="d80a0d41e083fb43cce844c7d23b7338"/><file name="update_order.php" hash="ad2367147e72a88428808dfaab231366"/><file name="validate.php" hash="436f44544aa97ef039e28977ca1f6380"/></dir><dir name="lib"><file name="account.php" hash="22acb8e56a837dfaf200252d99bc023f"/><file name="cancel_order.php" hash="094352d0bff59f9fed593707b8596679"/><file name="confirmation.php" hash="e23740168f2941741ffeb308cfa6aaa9"/><file name="customer.php" hash="34f1f9d76b729938118e72721cacd8af"/><file name="gui.php" hash="e234c46d3a046fd0989ecd535c1d9eb1"/><file name="index.php" hash="eb59320117f2668f615a19ee892fcf09"/><file name="orderitem.php" hash="3081930512e0d0ae705b361a5a5c104b"/><file name="paydata.php" hash="718479d8f056d6393e89c3de85d7526e"/><file name="paysonapi.php" hash="44665885f35c04edf78405159d01a4ff"/><file name="paysonapierror.php" hash="e3712bd19b64c3fbb5b64015ce944563"/><file name="paysonapiexception.php" hash="ee5a2ddad8fc7870b5dc121386ac3ef0"/><file name="paysoncheckout.php" hash="31efedcb1d197b3e230fcea9a9deef93"/><file name="paysonmerchant.php" hash="126ad5956d6efebedf4c2d6b35de1dff"/><file name="update_order.php" hash="500f71b5fb1fb31660626e4e12d113c7"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="payson"><dir name="checkout2"><file name="express.js" hash="47c95b1edf225fb3bc1c396bf0f4eb27"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="payson_checkout2"><file name="style.css" hash="f70e8d8d166a189383d5795620c162e3"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="."><file name="modman" hash="db5bef690345b40b09d58087ef9a3447"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.3.0</min><max>6.9.9</max></php></required></dependencies>
|
18 |
</package>
|