Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 6eb3efa

Browse files
Release version 3.0.5
1 parent 98b4260 commit 6eb3efa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+217
-3129
lines changed

CHANGELOG.md

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Afterpay Magento 1 Extension Changelog
22

3+
## Version 3.0.5
4+
5+
_Wed 17 Jun 2020 (AEST)_
6+
7+
### Supported Editions & Versions
8+
9+
- Magento Community Edition (CE) version 1.7 and later.
10+
- Magento Enterprise Edition (EE) version 1.13 and later.
11+
12+
### Highlights
13+
14+
- Addressed a known potential XSS vulnerability in FancyBox v2.x.
15+
- Optimised image assets; using CDN-hosted images instead of bundled images.
16+
- Improved checkout assets to automatically update instalment amounts when option to spend available store credit is selected/deselected.
17+
- Improved handling of invalid Afterpay/Clearpay configuration.
18+
19+
---
20+
321
## Version 3.0.4
422

523
_Thu 19 Dec 2019 (AEDT)_
@@ -146,7 +164,7 @@ _Tue 17 Oct 2017 (AEDT)_
146164

147165
Version 2.0.3 of the Afterpay Magento 1 Extension includes:
148166

149-
- Single and Multi-Market Afterpay transaction processing.
167+
- Single and Multi-Market Afterpay transaction processing.
150168
- Extended support for Magento default OnePageCheckout.
151169
- Implemented Magento default Mini-Cart clearing.
152170
- Improved Payment Limits API call.
@@ -178,12 +196,12 @@ Version 2.0.3 of the Afterpay Magento 1 Extension includes:
178196
- Added logging on Payment Limits query to monitor incorrect Merchant ID and Key combinations.
179197
- Following a Payment Limits API call, an entry is created on the afterpay.log file with the Merchant ID and masked Secret Key.
180198
- The log entry includes both the Payment Limits API request and response.
181-
199+
182200
**Miscellaneous**
183201

184202
- Implemented coding structure improvements to transition from utilising Magento's auto-generated Getter and Setter functions to direct database field reading.
185203
- Implemented logging to identify Session initialisation error.
186-
- Implemented Afterpay Token variable removal from Magento Checkout Session following a cancelled or declined Afterpay transaction.
204+
- Implemented Afterpay Token variable removal from Magento Checkout Session following a cancelled or declined Afterpay transaction.
187205
- Set default configuration for Afterpay asset display on Product and Cart pages to enabled.
188206
- Previously set to disabled by default, requiring manual configuration changes.
189207

@@ -197,7 +215,7 @@ _Wed 28 Jun 2017 (AEST)_
197215

198216
- Magento Community Edition (CE) version 1.7 and later
199217
- Magento Enterprise Edition (EE) version 1.13 and later
200-
218+
201219
### Highlights
202220

203221
- Version 2.0.2 of the Afterpay Magento 1 Extension has been tested on a clean installation of Magento Community Edition (Version 1.9.3.3).
@@ -207,16 +225,16 @@ _Wed 28 Jun 2017 (AEST)_
207225
- Improved JavaScript handling on Magento Product, Cart and Checkout Pages
208226
- Enhanced Store Credit support (Magento 1 Enterprise Only)
209227
- Addition of Gift Card support (Magento 1 Enterprise Only)
210-
228+
211229
### Community & Enterprise Edition Enhancements
212-
230+
213231
**Magento Admin - Afterpay Configuration Updates**
214232

215233
- Afterpay front-end display can now be configured at both a Website and View (Store) level.
216234
- Additional Magento Admin error reporting on entry of invalid Afterpay Merchant Credentials.
217235
- Shipping Courier settings removed from Afterpay Configuration.
218236
- Magento Admin configuration labels and section naming revised.
219-
237+
220238
**Improved Afterpay Logging**
221239

222240
- Afterpay logging to 'afterpay.log' enhanced to capture additional events and logging detail around Transaction Integrity and Payment Capture.
@@ -227,21 +245,21 @@ _Wed 28 Jun 2017 (AEST)_
227245
- Front-end validation added to Billing Address on checkout to align with Afterpay API validation and reduce error messages.
228246
- Additional validation for Configurable Product types where variation falls outside of Afterpay Merchant Payment Limits.
229247
- Revised the default redirection target to '/default/onepage/checkout' on Magento Cart.
230-
248+
231249
**Miscellaneous**
232250

233251
- Added 'Get Config' mechanism to support multi-site implementations with varying Afterpay Payment Limits.
234252
- Eliminated 'Pending' status check and 'Shipping Courier' check from the cron job, reducing redundant calls to the API.
235-
253+
236254
### Enterprise Edition Enhancements
237-
255+
238256
**Enhanced Store Credit Handling**
239257

240258
- Enhanced Customer Balance (Store Credit) deduction processing. Transactions now include an additional end-of-transaction Store Credit balance check.
241259
- Native Magento Store Credit support for the following checkout extensions:
242260
- Default Magento Checkout
243261
- OneStepCheckout by OneStepCheckout
244-
262+
245263
**Implemented Gift Card Handling**
246264

247265
- Native Magento Gift Card support for the following checkout extensions:
@@ -258,7 +276,7 @@ _Mon 20 Feb 2017 (AEDT)_
258276

259277
- Magento Community Edition (CE) version 1.7 and later
260278
- Magento Enterprise Edition (EE) version 1.13 and later
261-
279+
262280
### Highlights
263281

264282
Version 2.0.1 of the Afterpay Magento 1 Extension delivers:
@@ -267,7 +285,7 @@ Version 2.0.1 of the Afterpay Magento 1 Extension delivers:
267285
- Verification of transaction integrity
268286
- Enhanced checkout extension support and front-end improvements for Magento 1 Community Edition and Enterprise Edition
269287
- Support for native store credit functionality for Magento 1 Enterprise Edition
270-
288+
271289
### Community & Enterprise Edition Enhancements
272290

273291
**Security**
@@ -277,7 +295,7 @@ Version 2.0.1 of the Afterpay Magento 1 Extension delivers:
277295
- Afterpay token ID
278296
- Magento Quote reserved order ID
279297
- Magento Quote total amount
280-
- In the instance of a discrepancy between these values, the transaction is cancelled and no payment capture attempts will be made.
298+
- In the instance of a discrepancy between these values, the transaction is cancelled and no payment capture attempts will be made.
281299

282300
**Checkout support**
283301

@@ -290,20 +308,20 @@ Version 2.0.1 of the Afterpay Magento 1 Extension delivers:
290308
- One Step Checkout by Aheadworks
291309
- LightCheckout by GoMage
292310
- FireCheckout by Template Masters
293-
311+
294312
**Product-level Configuration enhancements**
295313

296314
- Merchant's Afterpay transaction limits are now applied at the Product-level as well as at the Checkout-level.
297315
- Magento Admin Afterpay plugin Enabled / Disabled dropdown now removes Product-level assets when set to 'Disabled'.
298-
316+
299317
**Miscellaneous**
300318

301319
- Plugin version number convention now aligns for Composer support.
302320
- Validation of merchant credentials (Merchant ID and Merchant Key) extended to exclude non-alphanumeric characters.
303321
- Installation process improvement to allow Magento to handle install error.
304-
322+
305323
### Enterprise Edition Enhancements
306-
324+
307325
**Magento Store credit support**
308326

309327
- Afterpay plugin now supports transactions that utilise Magento's native store credit functionality.
@@ -328,19 +346,19 @@ Plugin now populates the following flags:
328346
This is an overriding measure should the flag be set to an incorrect state by another actor.
329347

330348

331-
[3] Revised error message handling for the scenario when a user attempts to register with Afterpay using an email address that already exists on Magento.
349+
[3] Revised error message handling for the scenario when a user attempts to register with Afterpay using an email address that already exists on Magento.
332350
Magento message now displayed in this scenario:
333351
'There was an error processing your order. There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account."
334-
335-
352+
353+
336354
[4] Added support for Registering users with OneStepCheckout shopping cart extension.
337355
https://www.onestepcheckout.com
338356
Enhancements to allow user creation in Magento for Registering users in transaction with OneStepCheckout.
339357

340358

341359
[5] Added support for Magento new batch confirmation email sending
342360
Prior to Magento version Community 1.9.1 and Enterprise 1.14.1, emails were triggered on transaction completion.
343-
From Magento version Community 1.9.1 and Enterprise 1.14.1 onwards, emails are batched.
361+
From Magento version Community 1.9.1 and Enterprise 1.14.1 onwards, emails are batched.
344362
This release includes support for this batched email sending.
345363

346364
---
@@ -351,11 +369,11 @@ This release includes support for this batched email sending.
351369
- Added ability to select API V0 or V1
352370
- Major code changes to accommodate API V1
353371
- Major code refactoring to streamline the coding
354-
- Plugin will only create orders after Payment Approval in V1
372+
- Plugin will only create orders after Payment Approval in V1
355373
- CRON jobs timing increase
356374
- Idev and MW Checkout supoort
357375
- Various Contents changes
358-
376+
359377
### 0.12.9 - 2016-05-26
360378

361379
- Admin Afterpay Transaction Update processing
@@ -377,7 +395,7 @@ This release includes support for this batched email sending.
377395

378396
- Added a better error handling for AfterPay Payment observers
379397
- Prevent AfterPay interference with eWay and Stripe plugins
380-
- Added default explanations for Late Fee
398+
- Added default explanations for Late Fee
381399

382400
### 0.10.1 - 2015-10-30
383401

@@ -394,7 +412,7 @@ This release includes support for this batched email sending.
394412
### 0.9.2 - 2015-05-15
395413

396414
- Fixed SetShipped API requests: Use PUT requests instead of POST
397-
- Fixed reading of system configuration by SetShipped API cron job, it was taken globally all the time, now it takes values from order's store ID
415+
- Fixed reading of system configuration by SetShipped API cron job, it was taken globally all the time, now it takes values from order's store ID
398416
- Don't show Installments Amount if price or special price equals to $0.00
399417
- Fixed SetShipped API requests: Observer new Shipments instead of Shipment Tracks with support of "No tracking information available" case
400418

src/app/code/community/Afterpay/Afterpay/Block/Catalog/Installments.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function isEnabled()
3030
{
3131
$product = $this->getProduct();
3232
return Mage::getStoreConfigFlag(self::XML_CONFIG_PREFIX . 'enable_' . $this->getPageType())
33+
&& Mage::helper('afterpay/checkout')->noConflict()
3334
&& Mage::getModel('afterpay/method_payovertime')->canUseForProduct($product)
3435
&& !$product->isGrouped();
3536
}

src/app/code/community/Afterpay/Afterpay/Block/Form/Payovertime.php

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class Afterpay_Afterpay_Block_Form_Payovertime extends Afterpay_Afterpay_Block_F
1717

1818
const CONFIG_PATH_SHOW_DETAILS = 'afterpay/payovertime_checkout/show_checkout_details';
1919

20-
const TEMPLATE_OPTION_TITLE_DEFAULT = 'afterpay/checkout/title.phtml';
21-
2220
const TEMPLATE_OPTION_DETAILS_DEFAULT = 'afterpay/form/payovertime.phtml';
2321

2422
const TEMPLATE_OPTION_TITLE_CUSTOM = 'afterpay/checkout/title_custom.phtml';
@@ -54,6 +52,16 @@ public function getInstalmentAmount()
5452
return $this->getData('instalment_amount');
5553
}
5654

55+
public function getInstalmentAmountCreditUsed()
56+
{
57+
if (!$this->hasData('instalment_amount_credit_used')) {
58+
$formatted = Mage::helper('afterpay')->calculateInstalment(true);
59+
$this->setData('instalment_amount_credit_used', $formatted);
60+
}
61+
62+
return $this->getData('instalment_amount_credit_used');
63+
}
64+
5765
public function getInstalmentAmountLast()
5866
{
5967
if (!$this->hasData('instalment_amount_last')) {
@@ -64,12 +72,32 @@ public function getInstalmentAmountLast()
6472
return $this->getData('instalment_amount_last');
6573
}
6674

75+
public function getInstalmentAmountLastCreditUsed()
76+
{
77+
if (!$this->hasData('instalment_amount_last_credit_used')) {
78+
$formatted = Mage::helper('afterpay')->calculateInstalmentLast(true);
79+
$this->setData('instalment_amount_last_credit_used', $formatted);
80+
}
81+
82+
return $this->getData('instalment_amount_last_credit_used');
83+
}
84+
6785
public function getOrderTotal()
6886
{
6987
$total = Mage::getSingleton('checkout/session')->getQuote()->getGrandTotal();
7088
return Mage::app()->getStore()->formatPrice($total, false);
7189
}
7290

91+
public function getOrderTotalCreditUsed()
92+
{
93+
$total = Mage::getSingleton('checkout/session')->getQuote()->getGrandTotal();
94+
$total = $total - Mage::helper('afterpay')->getCustomerBalance();
95+
if ($total < 0) {
96+
$total = 0;
97+
}
98+
return Mage::app()->getStore()->formatPrice($total, false);
99+
}
100+
73101
public function getDetailsConfiguration()
74102
{
75103
$config = $this->_getCommonConfiguration();
@@ -111,23 +139,27 @@ private function _getCommonConfiguration()
111139
{
112140
return array(
113141
'afterpayLogoSubstitution' => '{afterpay_logo}',
114-
'afterpayLogo' => $this->getSkinUrl('afterpay/images/ap-logo-152x31.png'),
142+
'afterpayLogo' => 'https://static.afterpay.com/integration/logo-afterpay-colour-72x15@2x.png',
115143
'orderAmountSubstitution' => '{order_amount}',
116144
'orderAmount' => $this->getOrderTotal(),
145+
'orderAmountCreditUsed' => $this->getOrderTotalCreditUsed(),
117146
'regionSpecificSubstitution' => '{region_specific_text}',
118147
'regionText' => $this->getRegionSpecificText(),
119148
'installmentAmountSubstitution' => '{instalment_amount}',
120149
'installmentAmount' => $this->getInstalmentAmount(),
150+
'installmentAmountCreditUsed' => $this->getInstalmentAmountCreditUsed(),
121151
'installmentAmountSubstitutionLast' => '{instalment_amount_last}',
122152
'installmentAmountLast' => $this->getInstalmentAmountLast(),
153+
'installmentAmountLastCreditUsed' => $this->getInstalmentAmountLastCreditUsed(),
123154
'imageCircleOneSubstitution' => '{img_circle_1}',
124-
'imageCircleOne' => $this->getSkinUrl('afterpay/images/checkout/[email protected]'),
155+
'imageCircleOne' => 'https://static.afterpay.com/checkout/[email protected]',
125156
'imageCircleTwoSubstitution' => '{img_circle_2}',
126-
'imageCircleTwo' => $this->getSkinUrl('afterpay/images/checkout/[email protected]'),
157+
'imageCircleTwo' => 'https://static.afterpay.com/checkout/[email protected]',
127158
'imageCircleThreeSubstitution' => '{img_circle_3}',
128-
'imageCircleThree' => $this->getSkinUrl('afterpay/images/checkout/[email protected]'),
159+
'imageCircleThree' => 'https://static.afterpay.com/checkout/[email protected]',
129160
'imageCircleFourSubstitution' => '{img_circle_4}',
130-
'imageCircleFour' => $this->getSkinUrl('afterpay/images/checkout/[email protected]')
161+
'imageCircleFour' => 'https://static.afterpay.com/checkout/[email protected]',
162+
'creditUsedSelector' => '#use_customer_balance'
131163
);
132164
}
133165

@@ -140,4 +172,4 @@ private function _getCustomTitleTemplate()
140172
{
141173
return Mage::getStoreConfig(self::CONFIG_PATH_CHECKOUT_TITLE_TEMPLATE);
142174
}
143-
}
175+
}

src/app/code/community/Afterpay/Afterpay/Block/Onetouch.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ protected function _toHtml()
1111
{
1212
if ( Mage::getStoreConfigFlag('afterpay/payovertime_cart/show_onetouch')
1313
&& Mage::getStoreConfig('payment/afterpaypayovertime/' . Afterpay_Afterpay_Model_Method_Base::API_ENABLED_FIELD)
14+
&& Mage::helper('afterpay/checkout')->noConflict()
1415
&& Mage::getModel('afterpay/method_payovertime')->canUseForCheckoutSession()
1516
&& $this->getTotalAmount() >= Mage::getStoreConfig('payment/afterpaypayovertime/' . Afterpay_Afterpay_Model_Method_Base::API_MIN_ORDER_TOTAL_FIELD)
1617
&& $this->getTotalAmount() <= Mage::getStoreConfig('payment/afterpaypayovertime/' . Afterpay_Afterpay_Model_Method_Base::API_MAX_ORDER_TOTAL_FIELD)

src/app/code/community/Afterpay/Afterpay/Helper/Checkout.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,7 @@ public function defaultUrlExtended()
131131

132132
public function noConflict()
133133
{
134-
switch (Mage::app()->getStore()->getCurrentCurrencyCode())
135-
{
136-
case 'AUD':
137-
case 'NZD':
138-
case 'USD':
139-
return true;
140-
default:
141-
return false;
142-
}
134+
$currency = Mage::app()->getStore()->getCurrentCurrencyCode();
135+
return in_array($currency, ['AUD', 'NZD', 'USD']);
143136
}
144137
}

0 commit comments

Comments
 (0)