Version Notes
Payline payment module
Download this release
Release Info
| Developer | Payline |
| Extension | Payline |
| Version | 1.7.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.7.1 to 1.7.2
- app/code/community/Monext/Payline/Block/Adminhtml/Customer/Grid.php +200 -0
- app/code/community/Monext/Payline/Block/Cpt.php +1 -1
- app/code/community/Monext/Payline/Block/Direct.php +4 -4
- app/code/community/Monext/Payline/Block/Info/Direct.php +28 -0
- app/code/community/Monext/Payline/Block/Nx.php +1 -1
- app/code/community/Monext/Payline/Block/Wallet/Infos.php +9 -4
- app/code/community/Monext/Payline/Helper/Data.php +6 -0
- app/code/community/Monext/Payline/Model/Direct.php +1 -1
- app/code/community/Monext/Payline/PaylinePHPKit/lib/paylineSDK.php +20 -0
- app/code/community/Monext/Payline/controllers/CheckoutonepageController.php +4 -2
- app/code/community/Monext/Payline/controllers/IndexController.php +38 -21
- app/code/community/Monext/Payline/controllers/WalletController.php +3 -3
- app/code/community/Monext/Payline/etc/config.xml +10 -2
- app/code/community/Monext/Payline/etc/system.xml +11 -0
- app/design/adminhtml/default/default/layout/payline.xml +8 -0
- app/design/adminhtml/default/default/template/payline/customer/tab/view.phtml +62 -0
- app/design/frontend/default/default/layout/payline.xml +9 -0
- app/design/frontend/default/default/template/payline/checkout/onepage.phtml +2 -2
- app/design/frontend/default/default/template/payline/checkout/onepage/info/default.phtml +18 -0
- app/design/frontend/default/default/template/payline/logo.phtml +1 -1
- app/locale/fr_FR/Monext_Payline.csv +2 -0
- package.xml +6 -6
- skin/frontend/default/default/css/payline.css +12 -0
- skin/frontend/default/default/images/ae.gif +0 -0
- skin/frontend/default/default/images/amex.gif +0 -0
- skin/frontend/default/default/images/cb.gif +0 -0
- skin/frontend/default/default/images/mastercard.gif +0 -0
- skin/frontend/default/default/images/mc.gif +0 -0
- skin/frontend/default/default/images/payline-logo.png +0 -0
- skin/frontend/default/default/images/vi.gif +0 -0
- skin/frontend/default/default/images/visa.gif +0 -0
app/code/community/Monext/Payline/Block/Adminhtml/Customer/Grid.php
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
* $Id: Grid.php 27 2012-01-24 09:56:23Z cesav $
|
| 4 |
+
* $HeadURL: https://svn.mpl.intranet/svn/monext/trunk/Payline/Monext/Payline/Block/Adminhtml/Customer/Grid.php $
|
| 5 |
+
*
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
class Monext_Payline_Block_Adminhtml_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
| 9 |
+
{
|
| 10 |
+
public function __construct()
|
| 11 |
+
{
|
| 12 |
+
parent::__construct();
|
| 13 |
+
$this->setId('customerGrid');
|
| 14 |
+
$this->setUseAjax(true);
|
| 15 |
+
$this->setDefaultSort('entity_id');
|
| 16 |
+
$this->setSaveParametersInSession(true);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
protected function _prepareCollection()
|
| 20 |
+
{
|
| 21 |
+
$collection = Mage::getResourceModel('customer/customer_collection')
|
| 22 |
+
->addNameToSelect()
|
| 23 |
+
->addAttributeToSelect('email')
|
| 24 |
+
->addAttributeToSelect('created_at')
|
| 25 |
+
->addAttributeToSelect('group_id')
|
| 26 |
+
->addAttributeToSelect('wallet_id')
|
| 27 |
+
->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
|
| 28 |
+
->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
|
| 29 |
+
->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
|
| 30 |
+
->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
|
| 31 |
+
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
|
| 32 |
+
|
| 33 |
+
$this->setCollection($collection);
|
| 34 |
+
|
| 35 |
+
return parent::_prepareCollection();
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
protected function _prepareColumns()
|
| 39 |
+
{
|
| 40 |
+
$this->addColumn('entity_id', array(
|
| 41 |
+
'header' => Mage::helper('customer')->__('ID'),
|
| 42 |
+
'width' => '50px',
|
| 43 |
+
'index' => 'entity_id',
|
| 44 |
+
'type' => 'number',
|
| 45 |
+
));
|
| 46 |
+
/*$this->addColumn('firstname', array(
|
| 47 |
+
'header' => Mage::helper('customer')->__('First Name'),
|
| 48 |
+
'index' => 'firstname'
|
| 49 |
+
));
|
| 50 |
+
$this->addColumn('lastname', array(
|
| 51 |
+
'header' => Mage::helper('customer')->__('Last Name'),
|
| 52 |
+
'index' => 'lastname'
|
| 53 |
+
));*/
|
| 54 |
+
$this->addColumn('name', array(
|
| 55 |
+
'header' => Mage::helper('customer')->__('Name'),
|
| 56 |
+
'index' => 'name'
|
| 57 |
+
));
|
| 58 |
+
$this->addColumn('email', array(
|
| 59 |
+
'header' => Mage::helper('customer')->__('Email'),
|
| 60 |
+
'width' => '150',
|
| 61 |
+
'index' => 'email'
|
| 62 |
+
));
|
| 63 |
+
$this->addColumn('wallet_id', array(
|
| 64 |
+
'header' => Mage::helper('payline')->__('Wallet Payline'),
|
| 65 |
+
'width' => '150',
|
| 66 |
+
'index' => 'wallet_id'
|
| 67 |
+
));
|
| 68 |
+
|
| 69 |
+
$groups = Mage::getResourceModel('customer/group_collection')
|
| 70 |
+
->addFieldToFilter('customer_group_id', array('gt'=> 0))
|
| 71 |
+
->load()
|
| 72 |
+
->toOptionHash();
|
| 73 |
+
|
| 74 |
+
$this->addColumn('group', array(
|
| 75 |
+
'header' => Mage::helper('customer')->__('Group'),
|
| 76 |
+
'width' => '100',
|
| 77 |
+
'index' => 'group_id',
|
| 78 |
+
'type' => 'options',
|
| 79 |
+
'options' => $groups,
|
| 80 |
+
));
|
| 81 |
+
|
| 82 |
+
$this->addColumn('Telephone', array(
|
| 83 |
+
'header' => Mage::helper('customer')->__('Telephone'),
|
| 84 |
+
'width' => '100',
|
| 85 |
+
'index' => 'billing_telephone'
|
| 86 |
+
));
|
| 87 |
+
|
| 88 |
+
$this->addColumn('billing_postcode', array(
|
| 89 |
+
'header' => Mage::helper('customer')->__('ZIP'),
|
| 90 |
+
'width' => '90',
|
| 91 |
+
'index' => 'billing_postcode',
|
| 92 |
+
));
|
| 93 |
+
|
| 94 |
+
$this->addColumn('billing_country_id', array(
|
| 95 |
+
'header' => Mage::helper('customer')->__('Country'),
|
| 96 |
+
'width' => '100',
|
| 97 |
+
'type' => 'country',
|
| 98 |
+
'index' => 'billing_country_id',
|
| 99 |
+
));
|
| 100 |
+
|
| 101 |
+
$this->addColumn('billing_region', array(
|
| 102 |
+
'header' => Mage::helper('customer')->__('State/Province'),
|
| 103 |
+
'width' => '100',
|
| 104 |
+
'index' => 'billing_region',
|
| 105 |
+
));
|
| 106 |
+
|
| 107 |
+
$this->addColumn('customer_since', array(
|
| 108 |
+
'header' => Mage::helper('customer')->__('Customer Since'),
|
| 109 |
+
'type' => 'datetime',
|
| 110 |
+
'align' => 'center',
|
| 111 |
+
'index' => 'created_at',
|
| 112 |
+
'gmtoffset' => true
|
| 113 |
+
));
|
| 114 |
+
|
| 115 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
| 116 |
+
$this->addColumn('website_id', array(
|
| 117 |
+
'header' => Mage::helper('customer')->__('Website'),
|
| 118 |
+
'align' => 'center',
|
| 119 |
+
'width' => '80px',
|
| 120 |
+
'type' => 'options',
|
| 121 |
+
'options' => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(true),
|
| 122 |
+
'index' => 'website_id',
|
| 123 |
+
));
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
$this->addColumn('action',
|
| 127 |
+
array(
|
| 128 |
+
'header' => Mage::helper('customer')->__('Action'),
|
| 129 |
+
'width' => '100',
|
| 130 |
+
'type' => 'action',
|
| 131 |
+
'getter' => 'getId',
|
| 132 |
+
'actions' => array(
|
| 133 |
+
array(
|
| 134 |
+
'caption' => Mage::helper('customer')->__('Edit'),
|
| 135 |
+
'url' => array('base'=> '*/*/edit'),
|
| 136 |
+
'field' => 'id'
|
| 137 |
+
)
|
| 138 |
+
),
|
| 139 |
+
'filter' => false,
|
| 140 |
+
'sortable' => false,
|
| 141 |
+
'index' => 'stores',
|
| 142 |
+
'is_system' => true,
|
| 143 |
+
));
|
| 144 |
+
|
| 145 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
|
| 146 |
+
$this->addExportType('*/*/exportXml', Mage::helper('customer')->__('Excel XML'));
|
| 147 |
+
return parent::_prepareColumns();
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
protected function _prepareMassaction()
|
| 151 |
+
{
|
| 152 |
+
$this->setMassactionIdField('entity_id');
|
| 153 |
+
$this->getMassactionBlock()->setFormFieldName('customer');
|
| 154 |
+
|
| 155 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
| 156 |
+
'label' => Mage::helper('customer')->__('Delete'),
|
| 157 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
| 158 |
+
'confirm' => Mage::helper('customer')->__('Are you sure?')
|
| 159 |
+
));
|
| 160 |
+
|
| 161 |
+
$this->getMassactionBlock()->addItem('newsletter_subscribe', array(
|
| 162 |
+
'label' => Mage::helper('customer')->__('Subscribe to Newsletter'),
|
| 163 |
+
'url' => $this->getUrl('*/*/massSubscribe')
|
| 164 |
+
));
|
| 165 |
+
|
| 166 |
+
$this->getMassactionBlock()->addItem('newsletter_unsubscribe', array(
|
| 167 |
+
'label' => Mage::helper('customer')->__('Unsubscribe from Newsletter'),
|
| 168 |
+
'url' => $this->getUrl('*/*/massUnsubscribe')
|
| 169 |
+
));
|
| 170 |
+
|
| 171 |
+
$groups = $this->helper('customer')->getGroups()->toOptionArray();
|
| 172 |
+
|
| 173 |
+
array_unshift($groups, array('label'=> '', 'value'=> ''));
|
| 174 |
+
$this->getMassactionBlock()->addItem('assign_group', array(
|
| 175 |
+
'label' => Mage::helper('customer')->__('Assign a Customer Group'),
|
| 176 |
+
'url' => $this->getUrl('*/*/massAssignGroup'),
|
| 177 |
+
'additional' => array(
|
| 178 |
+
'visibility' => array(
|
| 179 |
+
'name' => 'group',
|
| 180 |
+
'type' => 'select',
|
| 181 |
+
'class' => 'required-entry',
|
| 182 |
+
'label' => Mage::helper('customer')->__('Group'),
|
| 183 |
+
'values' => $groups
|
| 184 |
+
)
|
| 185 |
+
)
|
| 186 |
+
));
|
| 187 |
+
|
| 188 |
+
return $this;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
public function getGridUrl()
|
| 192 |
+
{
|
| 193 |
+
return $this->getUrl('*/*/grid', array('_current'=> true));
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
public function getRowUrl($row)
|
| 197 |
+
{
|
| 198 |
+
return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
|
| 199 |
+
}
|
| 200 |
+
}
|
app/code/community/Monext/Payline/Block/Cpt.php
CHANGED
|
@@ -6,7 +6,7 @@ class Monext_Payline_Block_Cpt extends Mage_Payment_Block_Form {
|
|
| 6 |
$this->setTemplate('payline/Payline.phtml');
|
| 7 |
$redirectMsg=Mage::getStoreConfig('payment/PaylineCPT/redirect_message');
|
| 8 |
$this->setRedirectMessage($redirectMsg);
|
| 9 |
-
$this->setBannerSrc('
|
| 10 |
;
|
| 11 |
}
|
| 12 |
}
|
| 6 |
$this->setTemplate('payline/Payline.phtml');
|
| 7 |
$redirectMsg=Mage::getStoreConfig('payment/PaylineCPT/redirect_message');
|
| 8 |
$this->setRedirectMessage($redirectMsg);
|
| 9 |
+
$this->setBannerSrc($this->getSkinUrl('images/payline-logo.png'));
|
| 10 |
;
|
| 11 |
}
|
| 12 |
}
|
app/code/community/Monext/Payline/Block/Direct.php
CHANGED
|
@@ -8,18 +8,18 @@ class Monext_Payline_Block_Direct extends Mage_Payment_Block_Form {
|
|
| 8 |
$this->setTemplate('payline/Direct.phtml');
|
| 9 |
$redirectMsg=Mage::getStoreConfig('payment/PaylineNX/redirect_message');
|
| 10 |
$this->setRedirectMessage($redirectMsg);
|
| 11 |
-
$this->setBannerSrc('
|
| 12 |
}
|
| 13 |
|
| 14 |
public function getCcAvailableTypes()
|
| 15 |
{
|
| 16 |
$types = array();
|
| 17 |
if(Mage::getStoreConfig('payment/payline_common/contract_VISA') != '')
|
| 18 |
-
$types['VI'] = '
|
| 19 |
if(Mage::getStoreConfig('payment/payline_common/contract_AMEX') != '')
|
| 20 |
-
$types['AE'] = '
|
| 21 |
if(Mage::getStoreConfig('payment/payline_common/contract_MASTERCARD') != '')
|
| 22 |
-
$types['MC'] = '
|
| 23 |
|
| 24 |
return $types;
|
| 25 |
}
|
| 8 |
$this->setTemplate('payline/Direct.phtml');
|
| 9 |
$redirectMsg=Mage::getStoreConfig('payment/PaylineNX/redirect_message');
|
| 10 |
$this->setRedirectMessage($redirectMsg);
|
| 11 |
+
$this->setBannerSrc($this->getSkinUrl('images/payline-logo.png'));
|
| 12 |
}
|
| 13 |
|
| 14 |
public function getCcAvailableTypes()
|
| 15 |
{
|
| 16 |
$types = array();
|
| 17 |
if(Mage::getStoreConfig('payment/payline_common/contract_VISA') != '')
|
| 18 |
+
$types['VI'] = 'VISA';
|
| 19 |
if(Mage::getStoreConfig('payment/payline_common/contract_AMEX') != '')
|
| 20 |
+
$types['AE'] = 'AMERICAN EXPRESS';
|
| 21 |
if(Mage::getStoreConfig('payment/payline_common/contract_MASTERCARD') != '')
|
| 22 |
+
$types['MC'] = 'MASTERCARD';
|
| 23 |
|
| 24 |
return $types;
|
| 25 |
}
|
app/code/community/Monext/Payline/Block/Info/Direct.php
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Monext_Payline_Block_Info_Direct extends Mage_Payment_Block_Info_Cc
|
| 4 |
+
{
|
| 5 |
+
protected function _prepareSpecificInformation($transport = null)
|
| 6 |
+
{
|
| 7 |
+
if (null !== $this->_paymentSpecificInformation) {
|
| 8 |
+
return $this->_paymentSpecificInformation;
|
| 9 |
+
}
|
| 10 |
+
$transport = new Varien_Object($transport);;
|
| 11 |
+
$data = array();
|
| 12 |
+
if ($ccType = $this->getInfo()->getCcType()) {
|
| 13 |
+
$ccType = strtolower($ccType);
|
| 14 |
+
$img = '<img src="'.$this->getSkinUrl('images/'.$ccType.'.gif').'" />';
|
| 15 |
+
$data[Mage::helper('payline')->__('Credit Card Type')] = $img;
|
| 16 |
+
}
|
| 17 |
+
if ($this->getInfo()->getCcLast4()) {
|
| 18 |
+
$data[Mage::helper('payment')->__('Number')] = sprintf('xxxx-%s', $this->getInfo()->getCcLast4());
|
| 19 |
+
}
|
| 20 |
+
$year = $this->getInfo()->getCcExpYear();
|
| 21 |
+
$month = $this->getInfo()->getCcExpMonth();
|
| 22 |
+
if ($year && $month) {
|
| 23 |
+
$data[Mage::helper('payline')->__('Exp date')] = $this->_formatCardDate($year, $month);
|
| 24 |
+
}
|
| 25 |
+
$this->_paymentSpecificInformation = $transport;
|
| 26 |
+
return $transport->setData(array_merge($data, $transport->getData()));
|
| 27 |
+
}
|
| 28 |
+
}
|
app/code/community/Monext/Payline/Block/Nx.php
CHANGED
|
@@ -6,6 +6,6 @@ class Monext_Payline_Block_Nx extends Mage_Payment_Block_Form {
|
|
| 6 |
$this->setTemplate('payline/Payline.phtml');
|
| 7 |
$redirectMsg=Mage::getStoreConfig('payment/PaylineNX/redirect_message');
|
| 8 |
$this->setRedirectMessage($redirectMsg);
|
| 9 |
-
$this->setBannerSrc('
|
| 10 |
}
|
| 11 |
}
|
| 6 |
$this->setTemplate('payline/Payline.phtml');
|
| 7 |
$redirectMsg=Mage::getStoreConfig('payment/PaylineNX/redirect_message');
|
| 8 |
$this->setRedirectMessage($redirectMsg);
|
| 9 |
+
$this->setBannerSrc($this->getSkinUrl('images/payline-logo.png'));
|
| 10 |
}
|
| 11 |
}
|
app/code/community/Monext/Payline/Block/Wallet/Infos.php
CHANGED
|
@@ -17,11 +17,16 @@ class Monext_Payline_Block_Wallet_Infos extends Mage_Payment_Block_Info{
|
|
| 17 |
$wallet=$this->getInfo()->getMethodInstance()->getWalletData();
|
| 18 |
$data=array();
|
| 19 |
if (!empty($wallet)){
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
$data=array(
|
| 22 |
-
$this->__('Card type')
|
| 23 |
-
$this->__('Number')
|
| 24 |
-
$this->__('Exp
|
| 25 |
);
|
| 26 |
}
|
| 27 |
return $transport->setData(array_merge($data, $transport->getData()));
|
| 17 |
$wallet=$this->getInfo()->getMethodInstance()->getWalletData();
|
| 18 |
$data=array();
|
| 19 |
if (!empty($wallet)){
|
| 20 |
+
$cardNumber = substr($wallet['card']['number'], -4);
|
| 21 |
+
$expMonth = substr($wallet['card']['expirationDate'], 0, 2);
|
| 22 |
+
$expYear = substr($wallet['card']['expirationDate'], -2);
|
| 23 |
+
$cardType = $wallet['card']['type'];
|
| 24 |
+
$cardType = strtolower($cardType);
|
| 25 |
+
$img = '<img src="'.$this->getSkinUrl('images/'.$cardType.'.gif').'" />';
|
| 26 |
$data=array(
|
| 27 |
+
$this->__('Card type') => $img,
|
| 28 |
+
$this->__('Number') => sprintf('xxxx-%s', $cardNumber),
|
| 29 |
+
$this->__('Exp date') => $expMonth.'/'.$expYear
|
| 30 |
);
|
| 31 |
}
|
| 32 |
return $transport->setData(array_merge($data, $transport->getData()));
|
app/code/community/Monext/Payline/Helper/Data.php
CHANGED
|
@@ -552,4 +552,10 @@ class Monext_Payline_Helper_Data extends Mage_Core_Helper_Data {
|
|
| 552 |
Mage::throwException($this->__("The order #%s doesn't exist", $orderIncId));
|
| 553 |
}
|
| 554 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 555 |
}
|
| 552 |
Mage::throwException($this->__("The order #%s doesn't exist", $orderIncId));
|
| 553 |
}
|
| 554 |
}
|
| 555 |
+
|
| 556 |
+
public function encodeString($string)
|
| 557 |
+
{
|
| 558 |
+
$string = iconv('UTF-8', "ASCII//TRANSLIT", $string);
|
| 559 |
+
return $string;
|
| 560 |
+
}
|
| 561 |
}
|
app/code/community/Monext/Payline/Model/Direct.php
CHANGED
|
@@ -6,7 +6,7 @@ class Monext_Payline_Model_Direct extends Mage_Payment_Model_Method_Abstract
|
|
| 6 |
{
|
| 7 |
protected $_code = 'PaylineDIRECT';
|
| 8 |
protected $_formBlockType = 'payline/direct';
|
| 9 |
-
protected $_infoBlockType = '
|
| 10 |
protected $_canCapture = true;
|
| 11 |
protected $_canCapturePartial = true;
|
| 12 |
protected $_canRefund = true;
|
| 6 |
{
|
| 7 |
protected $_code = 'PaylineDIRECT';
|
| 8 |
protected $_formBlockType = 'payline/direct';
|
| 9 |
+
protected $_infoBlockType = 'payline/info_direct';
|
| 10 |
protected $_canCapture = true;
|
| 11 |
protected $_canCapturePartial = true;
|
| 12 |
protected $_canRefund = true;
|
app/code/community/Monext/Payline/PaylinePHPKit/lib/paylineSDK.php
CHANGED
|
@@ -125,12 +125,19 @@ class pl_buyer{
|
|
| 125 |
public $accountCreateDate;
|
| 126 |
public $accountAverageAmount;
|
| 127 |
public $accountOrderCount;
|
|
|
|
| 128 |
|
| 129 |
function __construct() {
|
| 130 |
$this->accountCreateDate = date('d/m/y', time());
|
| 131 |
}
|
| 132 |
}
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
//
|
| 135 |
// PL_ORDERDETAIL OBJECT DEFINITION
|
| 136 |
//
|
|
@@ -318,6 +325,7 @@ class paylineSDK{
|
|
| 318 |
const soap_transaction = 'transaction';
|
| 319 |
const soap_privateData = 'privateData';
|
| 320 |
const soap_buyer = 'buyer';
|
|
|
|
| 321 |
const soap_address = 'address';
|
| 322 |
const soap_capture = 'capture';
|
| 323 |
const soap_refund = 'refund';
|
|
@@ -470,6 +478,17 @@ class paylineSDK{
|
|
| 470 |
$buyer->shippingAdress = $this->address($address);
|
| 471 |
return new SoapVar($buyer, SOAP_ENC_OBJECT, paylineSDK::soap_buyer, paylineSDK::URL_SOAP);
|
| 472 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 473 |
|
| 474 |
/**
|
| 475 |
* function contracts
|
|
@@ -1246,6 +1265,7 @@ public function create_Wallet($array){
|
|
| 1246 |
'privateDataList' => $this->privates,
|
| 1247 |
// 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
|
| 1248 |
'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
|
|
|
|
| 1249 |
'version' => isset($array['version']) ? $array['version'] : self::KIT_VERSION
|
| 1250 |
);
|
| 1251 |
$this->SetCallSocketTimeOut();
|
| 125 |
public $accountCreateDate;
|
| 126 |
public $accountAverageAmount;
|
| 127 |
public $accountOrderCount;
|
| 128 |
+
public $ip;
|
| 129 |
|
| 130 |
function __construct() {
|
| 131 |
$this->accountCreateDate = date('d/m/y', time());
|
| 132 |
}
|
| 133 |
}
|
| 134 |
|
| 135 |
+
class pl_owner
|
| 136 |
+
{
|
| 137 |
+
public $lastName;
|
| 138 |
+
public $firstName;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
//
|
| 142 |
// PL_ORDERDETAIL OBJECT DEFINITION
|
| 143 |
//
|
| 325 |
const soap_transaction = 'transaction';
|
| 326 |
const soap_privateData = 'privateData';
|
| 327 |
const soap_buyer = 'buyer';
|
| 328 |
+
const soap_owner = 'owner';
|
| 329 |
const soap_address = 'address';
|
| 330 |
const soap_capture = 'capture';
|
| 331 |
const soap_refund = 'refund';
|
| 478 |
$buyer->shippingAdress = $this->address($address);
|
| 479 |
return new SoapVar($buyer, SOAP_ENC_OBJECT, paylineSDK::soap_buyer, paylineSDK::URL_SOAP);
|
| 480 |
}
|
| 481 |
+
|
| 482 |
+
protected function owner($array)
|
| 483 |
+
{
|
| 484 |
+
$owner = new pl_owner();
|
| 485 |
+
if ($array && is_array($array)) {
|
| 486 |
+
foreach($array as $k=>$v){
|
| 487 |
+
if(array_key_exists($k, $owner)&&(strlen($v)))$owner->$k = $v;
|
| 488 |
+
}
|
| 489 |
+
}
|
| 490 |
+
return new SoapVar($owner, SOAP_ENC_OBJECT, paylineSDK::soap_owner, paylineSDK::URL_SOAP);
|
| 491 |
+
}
|
| 492 |
|
| 493 |
/**
|
| 494 |
* function contracts
|
| 1265 |
'privateDataList' => $this->privates,
|
| 1266 |
// 'authentication3DSecure' =>$this->authentication3DSecure($array['3DSecure']),
|
| 1267 |
'wallet' => $this->wallet($array['wallet'],$array['address'],$array['card']),
|
| 1268 |
+
'owner' => $this->owner($array['owner']),
|
| 1269 |
'version' => isset($array['version']) ? $array['version'] : self::KIT_VERSION
|
| 1270 |
);
|
| 1271 |
$this->SetCallSocketTimeOut();
|
app/code/community/Monext/Payline/controllers/CheckoutonepageController.php
CHANGED
|
@@ -125,10 +125,9 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
|
|
| 125 |
$onepage->getQuote()->getShippingAddress()->collectShippingRates()->save();
|
| 126 |
$array=$onepage->saveShippingMethod($methodCode);
|
| 127 |
|
| 128 |
-
$shippingMethod=$onepage->getQuote()->getShippingAddress()->getShippingMethod();
|
| 129 |
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$quote));
|
| 130 |
}
|
| 131 |
-
|
| 132 |
|
| 133 |
$data=array('method'=>'PaylineWALLET');
|
| 134 |
$array=$onepage->savePayment($data);
|
|
@@ -136,11 +135,14 @@ class Monext_Payline_CheckoutonepageController extends Mage_Checkout_OnepageCont
|
|
| 136 |
$this->_initLayoutMessages('customer/session');
|
| 137 |
$this->_getChargeProgress();
|
| 138 |
|
|
|
|
| 139 |
//If the shipping method is not configured, or the shipping address doesn't fit,
|
| 140 |
//the shipping method template is different : when the form is validated, the payment method will be validated as well
|
| 141 |
if (!isset($shippingMethod) || empty($shippingMethod)){
|
| 142 |
$this->getLayout()->getBlock('checkout.onepage.shipping_method')->setTemplate('payline/checkout/onepage/shipping-method.phtml');
|
|
|
|
| 143 |
}
|
|
|
|
| 144 |
$this->getLayout()->getBlock('head')->setTitle($this->__('Checkout'));
|
| 145 |
$this->renderLayout();
|
| 146 |
}
|
| 125 |
$onepage->getQuote()->getShippingAddress()->collectShippingRates()->save();
|
| 126 |
$array=$onepage->saveShippingMethod($methodCode);
|
| 127 |
|
|
|
|
| 128 |
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$quote));
|
| 129 |
}
|
| 130 |
+
$shippingMethod=$onepage->getQuote()->getShippingAddress()->getShippingMethod();
|
| 131 |
|
| 132 |
$data=array('method'=>'PaylineWALLET');
|
| 133 |
$array=$onepage->savePayment($data);
|
| 135 |
$this->_initLayoutMessages('customer/session');
|
| 136 |
$this->_getChargeProgress();
|
| 137 |
|
| 138 |
+
$gotoSection = 'review';
|
| 139 |
//If the shipping method is not configured, or the shipping address doesn't fit,
|
| 140 |
//the shipping method template is different : when the form is validated, the payment method will be validated as well
|
| 141 |
if (!isset($shippingMethod) || empty($shippingMethod)){
|
| 142 |
$this->getLayout()->getBlock('checkout.onepage.shipping_method')->setTemplate('payline/checkout/onepage/shipping-method.phtml');
|
| 143 |
+
$gotoSection = 'shipping_method';
|
| 144 |
}
|
| 145 |
+
Mage::register('payline-goto-section', $gotoSection);
|
| 146 |
$this->getLayout()->getBlock('head')->setTitle($this->__('Checkout'));
|
| 147 |
$this->renderLayout();
|
| 148 |
}
|
app/code/community/Monext/Payline/controllers/IndexController.php
CHANGED
|
@@ -52,11 +52,15 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 52 |
* Reinit stocks & redirect to checkout
|
| 53 |
* @param string $cancelStatus
|
| 54 |
*/
|
| 55 |
-
private function cancelOrder($cancelStatus){
|
| 56 |
$this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$cancelStatus,'',false);
|
| 57 |
$this->updateStock();
|
| 58 |
$this->order->save();
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
}
|
| 61 |
|
| 62 |
/**
|
|
@@ -111,22 +115,22 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 111 |
if($buyerFirstName == null || $buyerFirstName == ''){
|
| 112 |
$buyerFirstName = substr($billingAddress->getFirstname(),0,50);
|
| 113 |
}
|
| 114 |
-
$array['buyer']['lastName'] = $buyerLastName;
|
| 115 |
-
$array['buyer']['firstName'] = $buyerFirstName;
|
| 116 |
|
| 117 |
|
| 118 |
$email=$this->order->getCustomerEmail();
|
| 119 |
if (strlen($email)<=50 && Zend_Validate::is($email, 'EmailAddress')) {
|
| 120 |
-
$array['buyer']['email']
|
| 121 |
}else{
|
| 122 |
$array['buyer']['email'] = '';
|
| 123 |
}
|
| 124 |
|
| 125 |
// ADDRESS
|
| 126 |
-
$array['address']['name'] = substr($billingAddress->getName(),0,100);
|
| 127 |
-
$array['address']['street1'] = substr($billingAddress->getStreet1(),0,100);
|
| 128 |
-
$array['address']['street2'] = substr($billingAddress->getStreet2(),0,100);
|
| 129 |
-
$array['address']['cityName'] = substr($billingAddress->getCity(),0,40);
|
| 130 |
$array['address']['zipCode'] = substr($billingAddress->getPostcode(),0,12);
|
| 131 |
//The $billing->getCountry() returns a 2 letter ISO2, should be fine
|
| 132 |
$array['address']['country'] = $billingAddress->getCountry();
|
|
@@ -246,10 +250,10 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 246 |
$itemPrice = round($item->getPrice()*100);
|
| 247 |
if($itemPrice > 0){
|
| 248 |
$product = array();
|
| 249 |
-
$product['ref'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50);
|
| 250 |
$product['price'] = $item->getPrice()*100;
|
| 251 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 252 |
-
$product['comment'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255);
|
| 253 |
$paylineSDK->setItem($product);
|
| 254 |
}
|
| 255 |
continue;
|
|
@@ -321,10 +325,10 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 321 |
$itemPrice = round($item->getPrice()*100);
|
| 322 |
if($itemPrice > 0){
|
| 323 |
$product = array();
|
| 324 |
-
$product['ref'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50);
|
| 325 |
$product['price'] = $item->getPrice()*100;
|
| 326 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 327 |
-
$product['comment'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255);
|
| 328 |
$paylineSDK->setItem($product);
|
| 329 |
}
|
| 330 |
continue;
|
|
@@ -337,6 +341,8 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 337 |
$array['card']['expirationDate'] = $_SESSION['payline_ccdata']->cc_exp_month.$_SESSION['payline_ccdata']->cc_exp_year;
|
| 338 |
$array['card']['cvx'] = $_SESSION['payline_ccdata']->cc_cid;
|
| 339 |
|
|
|
|
|
|
|
| 340 |
try{
|
| 341 |
$author_result = $paylineSDK->do_authorization($array);
|
| 342 |
}catch(Exception $e){
|
|
@@ -360,6 +366,7 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 360 |
$redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
|
| 361 |
$newOrderStatus = Mage::getStoreConfig('payment/payline_common/new_order_status');
|
| 362 |
$this->order->setState(Mage_Sales_Model_Order::STATE_PROCESSING,$newOrderStatus,'',false);
|
|
|
|
| 363 |
Mage::helper('payline')->createWalletForCurrentCustomer($paylineSDK, $array);
|
| 364 |
Mage::helper('payline')->automateCreateInvoiceAtShopReturn('DIRECT', $this->order);
|
| 365 |
}else{
|
|
@@ -430,10 +437,10 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 430 |
$itemPrice = round($item->getPrice()*100);
|
| 431 |
if($itemPrice > 0){
|
| 432 |
$product = array();
|
| 433 |
-
$product['ref'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50);
|
| 434 |
$product['price'] = $item->getPrice()*100;
|
| 435 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 436 |
-
$product['comment'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255);
|
| 437 |
$paylineSDK->setItem($product);
|
| 438 |
}
|
| 439 |
continue;
|
|
@@ -544,10 +551,10 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 544 |
$itemPrice = round($item->getPrice()*100);
|
| 545 |
if($itemPrice > 0){
|
| 546 |
$product = array();
|
| 547 |
-
$product['ref'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50);
|
| 548 |
$product['price'] = $item->getPrice()*100;
|
| 549 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 550 |
-
$product['comment'] = substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255);
|
| 551 |
$paylineSDK->setItem($product);
|
| 552 |
}
|
| 553 |
continue;
|
|
@@ -659,7 +666,12 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 659 |
}
|
| 660 |
Mage::helper('payline')->automateCreateInvoiceAtShopReturn('CPT', $this->order);
|
| 661 |
}else{
|
| 662 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 663 |
if(isset($res)){
|
| 664 |
$msgLog='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['longMessage'];
|
| 665 |
}else{
|
|
@@ -723,7 +735,12 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 723 |
Mage::helper('payline')->automateCreateInvoiceAtShopReturn('NX', $this->order);
|
| 724 |
}
|
| 725 |
}else{
|
| 726 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 727 |
if(isset($res)){
|
| 728 |
$msgLog='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['longMessage'];
|
| 729 |
}else{
|
|
@@ -767,7 +784,7 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 767 |
//Transaction cancelled by customer
|
| 768 |
$cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
|
| 769 |
}
|
| 770 |
-
$this->cancelOrder($cancelStatus);
|
| 771 |
}
|
| 772 |
|
| 773 |
/**
|
|
@@ -801,6 +818,6 @@ class Monext_Payline_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 801 |
//Transaction cancelled by customer
|
| 802 |
$cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
|
| 803 |
}
|
| 804 |
-
$this->cancelOrder($cancelStatus);
|
| 805 |
}
|
| 806 |
}
|
| 52 |
* Reinit stocks & redirect to checkout
|
| 53 |
* @param string $cancelStatus
|
| 54 |
*/
|
| 55 |
+
private function cancelOrder($cancelStatus, $resCode = ''){
|
| 56 |
$this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$cancelStatus,'',false);
|
| 57 |
$this->updateStock();
|
| 58 |
$this->order->save();
|
| 59 |
+
if ($resCode == '02319') {
|
| 60 |
+
$this->_redirect('sales/order/reorder', array('order_id' => $this->order->getId()));
|
| 61 |
+
} else {
|
| 62 |
+
$this->_redirect('checkout/onepage');
|
| 63 |
+
}
|
| 64 |
}
|
| 65 |
|
| 66 |
/**
|
| 115 |
if($buyerFirstName == null || $buyerFirstName == ''){
|
| 116 |
$buyerFirstName = substr($billingAddress->getFirstname(),0,50);
|
| 117 |
}
|
| 118 |
+
$array['buyer']['lastName'] = Mage::helper('payline')->encodeString($buyerLastName);
|
| 119 |
+
$array['buyer']['firstName'] = Mage::helper('payline')->encodeString($buyerFirstName);
|
| 120 |
|
| 121 |
|
| 122 |
$email=$this->order->getCustomerEmail();
|
| 123 |
if (strlen($email)<=50 && Zend_Validate::is($email, 'EmailAddress')) {
|
| 124 |
+
$array['buyer']['email']=Mage::helper('payline')->encodeString($email);
|
| 125 |
}else{
|
| 126 |
$array['buyer']['email'] = '';
|
| 127 |
}
|
| 128 |
|
| 129 |
// ADDRESS
|
| 130 |
+
$array['address']['name'] = Mage::helper('payline')->encodeString(substr($billingAddress->getName(),0,100));
|
| 131 |
+
$array['address']['street1'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet1(),0,100));
|
| 132 |
+
$array['address']['street2'] = Mage::helper('payline')->encodeString(substr($billingAddress->getStreet2(),0,100));
|
| 133 |
+
$array['address']['cityName'] = Mage::helper('payline')->encodeString(substr($billingAddress->getCity(),0,40));
|
| 134 |
$array['address']['zipCode'] = substr($billingAddress->getPostcode(),0,12);
|
| 135 |
//The $billing->getCountry() returns a 2 letter ISO2, should be fine
|
| 136 |
$array['address']['country'] = $billingAddress->getCountry();
|
| 250 |
$itemPrice = round($item->getPrice()*100);
|
| 251 |
if($itemPrice > 0){
|
| 252 |
$product = array();
|
| 253 |
+
$product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
|
| 254 |
$product['price'] = $item->getPrice()*100;
|
| 255 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 256 |
+
$product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
|
| 257 |
$paylineSDK->setItem($product);
|
| 258 |
}
|
| 259 |
continue;
|
| 325 |
$itemPrice = round($item->getPrice()*100);
|
| 326 |
if($itemPrice > 0){
|
| 327 |
$product = array();
|
| 328 |
+
$product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
|
| 329 |
$product['price'] = $item->getPrice()*100;
|
| 330 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 331 |
+
$product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
|
| 332 |
$paylineSDK->setItem($product);
|
| 333 |
}
|
| 334 |
continue;
|
| 341 |
$array['card']['expirationDate'] = $_SESSION['payline_ccdata']->cc_exp_month.$_SESSION['payline_ccdata']->cc_exp_year;
|
| 342 |
$array['card']['cvx'] = $_SESSION['payline_ccdata']->cc_cid;
|
| 343 |
|
| 344 |
+
// Customer IP
|
| 345 |
+
$array['buyer']['ip'] = Mage::helper('core/http')->getRemoteAddr();
|
| 346 |
try{
|
| 347 |
$author_result = $paylineSDK->do_authorization($array);
|
| 348 |
}catch(Exception $e){
|
| 366 |
$redirectUrl = Mage::getBaseUrl()."checkout/onepage/success/";
|
| 367 |
$newOrderStatus = Mage::getStoreConfig('payment/payline_common/new_order_status');
|
| 368 |
$this->order->setState(Mage_Sales_Model_Order::STATE_PROCESSING,$newOrderStatus,'',false);
|
| 369 |
+
$array['owner']['lastName'] = Mage::helper('payline')->encodeString($_SESSION['payline_ccdata']->cc_owner);
|
| 370 |
Mage::helper('payline')->createWalletForCurrentCustomer($paylineSDK, $array);
|
| 371 |
Mage::helper('payline')->automateCreateInvoiceAtShopReturn('DIRECT', $this->order);
|
| 372 |
}else{
|
| 437 |
$itemPrice = round($item->getPrice()*100);
|
| 438 |
if($itemPrice > 0){
|
| 439 |
$product = array();
|
| 440 |
+
$product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
|
| 441 |
$product['price'] = $item->getPrice()*100;
|
| 442 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 443 |
+
$product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
|
| 444 |
$paylineSDK->setItem($product);
|
| 445 |
}
|
| 446 |
continue;
|
| 551 |
$itemPrice = round($item->getPrice()*100);
|
| 552 |
if($itemPrice > 0){
|
| 553 |
$product = array();
|
| 554 |
+
$product['ref'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getName()),0,50));
|
| 555 |
$product['price'] = $item->getPrice()*100;
|
| 556 |
$product['quantity'] = round($item->getQtyOrdered());
|
| 557 |
+
$product['comment'] = Mage::helper('payline')->encodeString(substr(str_replace(array("\r","\n","\t"), array('','',''),$item->getDescription()), 0,255));
|
| 558 |
$paylineSDK->setItem($product);
|
| 559 |
}
|
| 560 |
continue;
|
| 666 |
}
|
| 667 |
Mage::helper('payline')->automateCreateInvoiceAtShopReturn('CPT', $this->order);
|
| 668 |
}else{
|
| 669 |
+
if ($res['result']['code'] == '02304') {
|
| 670 |
+
$abandonedStatus = Mage::getStoreConfig('payment/payline_common/resignation_order_status');
|
| 671 |
+
$this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$abandonedStatus,'',false);
|
| 672 |
+
} else {
|
| 673 |
+
$this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,'',false);
|
| 674 |
+
}
|
| 675 |
if(isset($res)){
|
| 676 |
$msgLog='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['longMessage'];
|
| 677 |
}else{
|
| 735 |
Mage::helper('payline')->automateCreateInvoiceAtShopReturn('NX', $this->order);
|
| 736 |
}
|
| 737 |
}else{
|
| 738 |
+
if ($res['result']['code'] == '02304') {
|
| 739 |
+
$abandonedStatus = Mage::getStoreConfig('payment/payline_common/resignation_order_status');
|
| 740 |
+
$this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$abandonedStatus,'',false);
|
| 741 |
+
} else {
|
| 742 |
+
$this->order->setState(Mage_Sales_Model_Order::STATE_CANCELED,$failedOrderStatus,'',false);
|
| 743 |
+
}
|
| 744 |
if(isset($res)){
|
| 745 |
$msgLog='PAYLINE ERROR : '.$res['result']['code']. ' '.$res['result']['longMessage'];
|
| 746 |
}else{
|
| 784 |
//Transaction cancelled by customer
|
| 785 |
$cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
|
| 786 |
}
|
| 787 |
+
$this->cancelOrder($cancelStatus, $res['result']['code']);
|
| 788 |
}
|
| 789 |
|
| 790 |
/**
|
| 818 |
//Transaction cancelled by customer
|
| 819 |
$cancelStatus = Mage::getStoreConfig('payment/payline_common/canceled_order_status');
|
| 820 |
}
|
| 821 |
+
$this->cancelOrder($cancelStatus, $res['result']['code']);
|
| 822 |
}
|
| 823 |
}
|
app/code/community/Monext/Payline/controllers/WalletController.php
CHANGED
|
@@ -79,8 +79,8 @@ class Monext_Payline_WalletController extends Mage_Core_Controller_Front_Action
|
|
| 79 |
//TODO add address data
|
| 80 |
$array=array(
|
| 81 |
'buyer'=>array(
|
| 82 |
-
'lastName'=>substr($customer->getLastname(),0,100),
|
| 83 |
-
'firstName'=>substr($customer->getFirstname(),0,100),
|
| 84 |
'walletId'=>Mage::getModel('payline/wallet')->generateWalletId()
|
| 85 |
),
|
| 86 |
'address'=>array(),
|
|
@@ -88,7 +88,7 @@ class Monext_Payline_WalletController extends Mage_Core_Controller_Front_Action
|
|
| 88 |
|
| 89 |
$email=$customer->getEmail();
|
| 90 |
if (strlen($email)<=50 && Zend_Validate::is($email, 'EmailAddress')) {
|
| 91 |
-
$array['buyer']['email']
|
| 92 |
}else{
|
| 93 |
$array['buyer']['email'] = '';
|
| 94 |
}
|
| 79 |
//TODO add address data
|
| 80 |
$array=array(
|
| 81 |
'buyer'=>array(
|
| 82 |
+
'lastName'=>Mage::helper('payline')->encodeString(substr($customer->getLastname(),0,100)),
|
| 83 |
+
'firstName'=>Mage::helper('payline')->encodeString(substr($customer->getFirstname(),0,100)),
|
| 84 |
'walletId'=>Mage::getModel('payline/wallet')->generateWalletId()
|
| 85 |
),
|
| 86 |
'address'=>array(),
|
| 88 |
|
| 89 |
$email=$customer->getEmail();
|
| 90 |
if (strlen($email)<=50 && Zend_Validate::is($email, 'EmailAddress')) {
|
| 91 |
+
$array['buyer']['email']=Mage::helper('payline')->encodeString($email);
|
| 92 |
}else{
|
| 93 |
$array['buyer']['email'] = '';
|
| 94 |
}
|
app/code/community/Monext/Payline/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Monext_Payline>
|
| 5 |
-
<version>1.7.
|
| 6 |
</Monext_Payline>
|
| 7 |
</modules>
|
| 8 |
<global>
|
|
@@ -13,7 +13,8 @@
|
|
| 13 |
<adminhtml>
|
| 14 |
<!-- Needed for Magento Enterprise 1.9 -->
|
| 15 |
<rewrite>
|
| 16 |
-
|
|
|
|
| 17 |
</rewrite>
|
| 18 |
</adminhtml>
|
| 19 |
</blocks>
|
|
@@ -97,6 +98,13 @@
|
|
| 97 |
</Monext_Payline>
|
| 98 |
</modules>
|
| 99 |
</translate>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
</adminhtml>
|
| 101 |
<default>
|
| 102 |
<payment>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Monext_Payline>
|
| 5 |
+
<version>1.7.2</version>
|
| 6 |
</Monext_Payline>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 13 |
<adminhtml>
|
| 14 |
<!-- Needed for Magento Enterprise 1.9 -->
|
| 15 |
<rewrite>
|
| 16 |
+
<sales_order_creditmemo_create_items>Monext_Payline_Block_Adminhtml_Sales_Order_Creditmemo_Create_Items</sales_order_creditmemo_create_items>
|
| 17 |
+
<customer_grid>Monext_Payline_Block_Adminhtml_Customer_Grid</customer_grid>
|
| 18 |
</rewrite>
|
| 19 |
</adminhtml>
|
| 20 |
</blocks>
|
| 98 |
</Monext_Payline>
|
| 99 |
</modules>
|
| 100 |
</translate>
|
| 101 |
+
<layout>
|
| 102 |
+
<updates>
|
| 103 |
+
<payline module="Monext_Payline">
|
| 104 |
+
<file>payline.xml</file>
|
| 105 |
+
</payline>
|
| 106 |
+
</updates>
|
| 107 |
+
</layout>
|
| 108 |
</adminhtml>
|
| 109 |
<default>
|
| 110 |
<payment>
|
app/code/community/Monext/Payline/etc/system.xml
CHANGED
|
@@ -9,6 +9,7 @@
|
|
| 9 |
<show_in_default>1</show_in_default>
|
| 10 |
<show_in_website>1</show_in_website>
|
| 11 |
<show_in_store>1</show_in_store>
|
|
|
|
| 12 |
<fields>
|
| 13 |
<merchant_id translate="label" module="payline">
|
| 14 |
<label>Merchant ID</label>
|
|
@@ -149,6 +150,16 @@
|
|
| 149 |
<show_in_website>1</show_in_website>
|
| 150 |
<show_in_store>1</show_in_store>
|
| 151 |
</failed_order_status>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
<automate_wallet_subscription translate="label comment">
|
| 153 |
<label>Automate wallet subscription</label>
|
| 154 |
<comment>A customer wallet will be created with the first payment using Payline</comment>
|
| 9 |
<show_in_default>1</show_in_default>
|
| 10 |
<show_in_website>1</show_in_website>
|
| 11 |
<show_in_store>1</show_in_store>
|
| 12 |
+
<comment><![CDATA[<a href="http://www.payline.com/support/tester-payline.html" target="_blank">Tester Payline</a>]]></comment>
|
| 13 |
<fields>
|
| 14 |
<merchant_id translate="label" module="payline">
|
| 15 |
<label>Merchant ID</label>
|
| 150 |
<show_in_website>1</show_in_website>
|
| 151 |
<show_in_store>1</show_in_store>
|
| 152 |
</failed_order_status>
|
| 153 |
+
<resignation_order_status translate="label">
|
| 154 |
+
<label>Order status when payment abandoned by Customer</label>
|
| 155 |
+
<comment></comment>
|
| 156 |
+
<frontend_type>select</frontend_type>
|
| 157 |
+
<source_model>payline/datasource_status</source_model>
|
| 158 |
+
<sort_order>155</sort_order>
|
| 159 |
+
<show_in_default>1</show_in_default>
|
| 160 |
+
<show_in_website>1</show_in_website>
|
| 161 |
+
<show_in_store>1</show_in_store>
|
| 162 |
+
</resignation_order_status>
|
| 163 |
<automate_wallet_subscription translate="label comment">
|
| 164 |
<label>Automate wallet subscription</label>
|
| 165 |
<comment>A customer wallet will be created with the first payment using Payline</comment>
|
app/design/adminhtml/default/default/layout/payline.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<layout>
|
| 3 |
+
<adminhtml_customer_edit>
|
| 4 |
+
<reference name="customer_edit_tab_view">
|
| 5 |
+
<action method="setTemplate"><template>payline/customer/tab/view.phtml</template></action>
|
| 6 |
+
</reference>
|
| 7 |
+
</adminhtml_customer_edit>
|
| 8 |
+
</layout>
|
app/design/adminhtml/default/default/template/payline/customer/tab/view.phtml
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Template for block Mage_Adminhtml_Block_Customer_Edit_Tab_View
|
| 4 |
+
*/
|
| 5 |
+
?>
|
| 6 |
+
<?php
|
| 7 |
+
$lastLoginDateAdmin = $this->getLastLoginDate();
|
| 8 |
+
$lastLoginDateStore = $this->getStoreLastLoginDate();
|
| 9 |
+
|
| 10 |
+
$createDateAdmin = $this->getCreateDate();
|
| 11 |
+
$createDateStore = $this->getStoreCreateDate();
|
| 12 |
+
?>
|
| 13 |
+
<div class="entry-edit">
|
| 14 |
+
<div class="entry-edit-head"><h4 class="icon-head head-customer-view"><?php echo Mage::helper('customer')->__('Personal Information') ?></h4></div>
|
| 15 |
+
<fieldset>
|
| 16 |
+
<table cellspacing="2" class="box-left">
|
| 17 |
+
<tr>
|
| 18 |
+
<td><strong><?php echo $this->__('Last Logged In:') ?></strong></td>
|
| 19 |
+
<td><?php echo $lastLoginDateAdmin ?> (<?php echo $this->getCurrentStatus() ?>)</td>
|
| 20 |
+
</tr>
|
| 21 |
+
<?php if ($lastLoginDateAdmin != $lastLoginDateStore): ?>
|
| 22 |
+
<tr>
|
| 23 |
+
<td><strong><?php echo $this->__('Last Logged In (%s):', $this->getStoreLastLoginDateTimezone()) ?></strong></td>
|
| 24 |
+
<td><?php echo $lastLoginDateStore ?> (<?php echo $this->getCurrentStatus() ?>)</td>
|
| 25 |
+
</tr>
|
| 26 |
+
<?php endif; ?>
|
| 27 |
+
<tr>
|
| 28 |
+
<td><strong><?php echo $this->__('Confirmed email:') ?></strong></td>
|
| 29 |
+
<td><?php echo $this->getIsConfirmedStatus() ?></td>
|
| 30 |
+
</tr>
|
| 31 |
+
<tr>
|
| 32 |
+
<td><strong><?php echo $this->__('Account Created on:') ?></strong></td>
|
| 33 |
+
<td><?php echo $createDateAdmin ?></td>
|
| 34 |
+
</tr>
|
| 35 |
+
<?php if ($createDateAdmin != $createDateStore): ?>
|
| 36 |
+
<tr>
|
| 37 |
+
<td><strong><?php echo $this->__('Account Created on (%s):', $this->getStoreCreateDateTimezone()) ?></strong></td>
|
| 38 |
+
<td><?php echo $createDateStore ?></td>
|
| 39 |
+
</tr>
|
| 40 |
+
<?php endif; ?>
|
| 41 |
+
<tr>
|
| 42 |
+
<td><strong><?php echo $this->__('Account Created in:') ?></strong></td>
|
| 43 |
+
<td><?php echo $this->getCreatedInStore() ?></td>
|
| 44 |
+
</tr>
|
| 45 |
+
<tr>
|
| 46 |
+
<td><strong><?php echo $this->__('Customer Group:') ?></strong></td>
|
| 47 |
+
<td><?php echo $this->getGroupName() ?></td>
|
| 48 |
+
</tr>
|
| 49 |
+
<?php if ($this->getCustomer()->getWalletId() != null) :?>
|
| 50 |
+
<tr>
|
| 51 |
+
<td><strong><?php echo $this->__('Payline Wallet ID:') ?></strong></td>
|
| 52 |
+
<td><?php echo $this->getCustomer()->getWalletId() ?></td>
|
| 53 |
+
</tr>
|
| 54 |
+
<?php endif?>
|
| 55 |
+
</table>
|
| 56 |
+
<address class="box-right">
|
| 57 |
+
<strong><?php echo $this->__('Default Billing Address') ?></strong><br/>
|
| 58 |
+
<?php echo $this->getBillingAddressHtml() ?>
|
| 59 |
+
</address>
|
| 60 |
+
</fieldset>
|
| 61 |
+
</div>
|
| 62 |
+
<?php echo $this->getChildHtml('', true, true); ?>
|
app/design/frontend/default/default/layout/payline.xml
CHANGED
|
@@ -30,6 +30,15 @@
|
|
| 30 |
</reference>
|
| 31 |
</cms_index_index>
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
<customer_account>
|
| 34 |
<reference name="customer_account_navigation">
|
| 35 |
<action method="addLink" translate="label" module="payline" ifconfig="payment/PaylineWALLET/active"><name>payline</name><path>payline/wallet/manage</path><label>Wallet management</label></action>
|
| 30 |
</reference>
|
| 31 |
</cms_index_index>
|
| 32 |
|
| 33 |
+
<checkout_onepage_progress>
|
| 34 |
+
<reference name="payment_info">
|
| 35 |
+
<action method="setInfoTemplate"><method>PaylineCPT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
|
| 36 |
+
<action method="setInfoTemplate"><method>PaylineDIRECT</method><template>payline/checkout/onepage/info/default.phtml</template></action>
|
| 37 |
+
<action method="setInfoTemplate"><method>PaylineNX</method><template>payline/checkout/onepage/info/default.phtml</template></action>
|
| 38 |
+
<action method="setInfoTemplate"><method>PaylineWALLET</method><template>payline/checkout/onepage/info/default.phtml</template></action>
|
| 39 |
+
</reference>
|
| 40 |
+
</checkout_onepage_progress>
|
| 41 |
+
|
| 42 |
<customer_account>
|
| 43 |
<reference name="customer_account_navigation">
|
| 44 |
<action method="addLink" translate="label" module="payline" ifconfig="payment/PaylineWALLET/active"><name>payline</name><path>payline/wallet/manage</path><label>Wallet management</label></action>
|
app/design/frontend/default/default/template/payline/checkout/onepage.phtml
CHANGED
|
@@ -4,8 +4,8 @@
|
|
| 4 |
</span>
|
| 5 |
<script type="text/javascript">
|
| 6 |
//<