Skip to content

Commit

Permalink
1.3.5: #8
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Oct 5, 2017
1 parent 522857a commit bbfcd54
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
11 changes: 10 additions & 1 deletion Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ final class Method extends \Df\Payment\Method {
* https://code.dmitry-fedyuk.com/m2e/square/issues/6
* https://www.sellercommunity.com/t5/Developers-API/Connect-API-v2-What-are-the-minimum-and-maximum-limits-for/m-p/26939#M346
* https://mage2.pro/t/2411
* 2017-10-05
* What are the minimum and maximum limits for payment amounts in JPY, GBP, and AUD?
* https://www.sellercommunity.com/t5/Developer-Discussions/Connect-API-v2-What-are-the-minimum-and-maximum-limits-for/m-p/52016#M891
* @override
* @see \Df\Payment\Method::amountLimits()
* @used-by isAvailable()
* @return array(string => array(int|float))
*/
protected function amountLimits() {return ['USD' => [1, 50000], 'CAD' => [1, 50000]];}
protected function amountLimits() {return [
'AUD' => [1, 50000], 'CAD' => [1, 50000], 'GBP' => [1, 50000]
// 2017-10-05 @todo It is certainly wrong!
// Need to be updated when I will have the right limits from the Square support.
,'JPY' => [1, 50000]
,'USD' => [1, 50000]
];}

/**
* 2016-09-30
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/square"
,"version": "1.3.4"
,"version": "1.3.5"
,"description": "The «Square» payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/square"
Expand Down
3 changes: 2 additions & 1 deletion etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<!-- 2016-11-13
Square currently supports only USD and CAD:
https://www.sellercommunity.com/t5/Developers-API/Connect-API-v2-How-can-I-know-the-smallest-denomination-of-a/m-p/20372#M11
2017-10-05 Square now supports JPY, GBP, and AUD: https://mage2.pro/t/4634
-->
<virtualType name='Dfe\Square\Validator\Currency' type='Df\Framework\Validator\Currency'>
<arguments><argument name='iso3' xsi:type='string'>CAD,USD</argument></arguments>
<arguments><argument name='iso3' xsi:type='string'>AUD,CAD,GBP,JPY,USD</argument></arguments>
</virtualType>
</config>
5 changes: 3 additions & 2 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ https://docs.connect.squareup.com/articles/adding-payment-form/#populatingfields
</field>
<!--
2016-11-13
Square на сегодняшний день поддерживает 2 валюты: USD и CAD.
Square currently supports only USD and CAD:
https://www.sellercommunity.com/t5/Developers-API/Connect-API-v2-How-can-I-know-the-smallest-denomination-of-a/m-p/20372#M11
2017-10-05 Square now supports JPY, GBP, and AUD: https://mage2.pro/t/4634
-->
<field
dfValues='USD,CAD'
dfValues='AUD,CAD,GBP,JPY,USD'
id='currency'
showInDefault='1' showInStore='1' showInWebsite='1'
sortOrder='10'
Expand Down
3 changes: 2 additions & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<requireBillingAddress>1</requireBillingAddress>
<!--
2016-11-13
Square на сегодняшний день поддерживает 2 валюты: USD и CAD.
Square currently supports only USD and CAD:
https://www.sellercommunity.com/t5/Developers-API/Connect-API-v2-How-can-I-know-the-smallest-denomination-of-a/m-p/20372#M11
2017-10-05 Square now supports JPY, GBP, and AUD: https://mage2.pro/t/4634
-->
<currency>USD</currency>
<payment_action>authorize_capture</payment_action>
Expand Down

0 comments on commit bbfcd54

Please sign in to comment.