From d7f8023bb1df8e119db6c42afcf02a48a4a9623e Mon Sep 17 00:00:00 2001 From: Daniel Fowler Date: Wed, 1 Nov 2023 14:12:30 +0700 Subject: [PATCH 1/4] Update CODEOWNERS --- .github/CODEOWNERS | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 68f412516..80dd3f8af 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,10 +1 @@ -# Lines starting with '#' are comments. -# Each line is a file pattern followed by one or more owners. - -# Order is important. The last matching pattern has the most precedence. -# So if a pull request only touches javascript files, only these owners -# will be requested to review. -# example: *.js @octocat @github/js - -# These owners will be the default owners for everything in the repo. -* @aashishgurung @ajzkk \ No newline at end of file +* @omise/maintainers From 0a2992921296e1bee1f06dd897ff53f4f357e2b9 Mon Sep 17 00:00:00 2001 From: Aashish Gurung <101558497+aashishgurung@users.noreply.github.com> Date: Fri, 17 Nov 2023 17:00:45 +0700 Subject: [PATCH 2/4] Updated OCBC digital logo (#457) * Updated OCBC digital logo * removed commented out code. --------- Co-authored-by: Aashish --- view/frontend/web/css/styles.css | 7 +------ view/frontend/web/images/ocbc_digital.png | Bin 1868 -> 0 bytes view/frontend/web/images/ocbc_digital.svg | 1 + .../omise-offsite-ocbc-digital-method.js | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 view/frontend/web/images/ocbc_digital.png create mode 100644 view/frontend/web/images/ocbc_digital.svg diff --git a/view/frontend/web/css/styles.css b/view/frontend/web/css/styles.css index 4f0722293..773071bb7 100644 --- a/view/frontend/web/css/styles.css +++ b/view/frontend/web/css/styles.css @@ -151,11 +151,6 @@ background-size: contain; } -/** MayBank **/ -/* #omise_offsite_installmentForm .mbb { - background: #007bc4; -} */ - #omise_offsite_installmentForm img.mbb { background: url('../images/fpx-maybank.svg'); } @@ -171,7 +166,7 @@ div.ocbc_pao { } div.ocbc_digital { - background-image: url('../images/ocbc_digital.png'); + background-image: url('../images/ocbc_digital.svg'); width: 30px; height: 30px; float: right; diff --git a/view/frontend/web/images/ocbc_digital.png b/view/frontend/web/images/ocbc_digital.png deleted file mode 100644 index 699b34bb3afe99f172c99a46191431d624b5e2d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1868 zcmV-S2ebHzP)Px#9#BkFMMrQ<;sp}q1QF!~66OXH<^vJr0~6&167dEU z1`w#$U$5}7gfgNH}k#a zds}DO|LNSnfB(B-)vs@<(yYGjeHXOdyLq9?Qs(-_cR+h$3n7dtg^sR~GmsTgj06(;Oj`9StZThL6lg?I3d{FG)nl zM_JQiH95(K@CPFtpedu0P02|K8TmH8cBK&PcR2#lWzTHTYUE$tEBJFprBvSmZ-RL( zFgp+FE^h`iy8f9FQO%k|LtcGExDX2=FF7@%hzeYQCh(^w^WHpre6T6Cn)2pel9J)I zx)hPe_K2)AB|{p`GTlT(`pR*)jrx~nL+$z1c5~J(VMbked>nzX^r4@Pe)QOOd#<``Y<)oMG=ori$r}FN zKh#oY-*Zk{`bFs%J?I-IOn!<7 zk;l+2i|VWrf<|3M{sSVLHq0vUIVFrr!QH6hB)B@MT!@?|G1l{j8?zvLrY5mn??lp* zMNC{dS_OW4a+MA}`Gx0LpU2$$ge|GqJ97IW5}w96vs~?TIy641u%s9-;*zOBl$4Pu z4+}R%x087Yr)XAUT$x2@rs%@>;_h!3L^`#C_PIX=5@pwl%3e|3+T9R6wE(EIYQN*D zsj1bRb$I)#KN~nFS+_WeajXP!$&{Bv^^EI{06mj_7v{ZT+=qpov+O_Eyc_qs$ey9c zGb(I~Su+>mQ@1MZRp7qIiQ|`35!K9|cHDtB8y7&GEbm>7??KAMV(t)qkYEcw`IQrt-BO?QMYq$>RS+vPgOt zP*+Z^d6aPWJy)=~-I=;e+T8*wuD)i8JMa0tt6XbrzXB0cy|k=sq8D5n)%UMGo)he= z2VcAXe6T+);#SdgwJjHUDYm1lcnRMZbG=x>GitKn+f!+hO9_=;@+{`kPijX@Q_ZeL z;dOJqL{n4QwJ3i+hniB_sq47~p6!<%(RsI#{Ww3)%=s4rW}qyiGA-f&0000 \ No newline at end of file diff --git a/view/frontend/web/js/view/payment/method-renderer/omise-offsite-ocbc-digital-method.js b/view/frontend/web/js/view/payment/method-renderer/omise-offsite-ocbc-digital-method.js index 862da171a..44f74d089 100644 --- a/view/frontend/web/js/view/payment/method-renderer/omise-offsite-ocbc-digital-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/omise-offsite-ocbc-digital-method.js @@ -23,8 +23,8 @@ define( code: 'omise_offsite_ocbc_digital', restrictedToCurrencies: ['sgd'], logo: { - file: "images/ocbc_digital.png", - width: "80", + file: "images/ocbc_digital.svg", + width: "30", height: "30", name: "ocbc_digital" } From e5f255e82f98c9b74152725406c7614f2c51fbe2 Mon Sep 17 00:00:00 2001 From: Aashish Gurung <101558497+aashishgurung@users.noreply.github.com> Date: Fri, 24 Nov 2023 18:40:36 +0700 Subject: [PATCH 3/4] Remove zero_interest_installments option from installment banks other than Maybank (#458) * WIP * Removed zero_interest_installment for installments except Maybank. * Fix syntax error * Fixed test issue --------- Co-authored-by: Aashish --- Gateway/Request/APMBuilder.php | 3 +-- Gateway/Request/PaymentDataBuilder.php | 24 ++++++++++++++++++------ Test/Unit/PaymentDataBuilderTest.php | 9 ++++++++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Gateway/Request/APMBuilder.php b/Gateway/Request/APMBuilder.php index 1fd069747..d8dee431c 100644 --- a/Gateway/Request/APMBuilder.php +++ b/Gateway/Request/APMBuilder.php @@ -179,8 +179,7 @@ public function build(array $buildSubject) self::SOURCE_TYPE => $installmentId, self::SOURCE_INSTALLMENT_TERMS => $method->getAdditionalInformation( InstallmentDataAssignObserver::TERMS - ), - self::ZERO_INTEREST_INSTALLMENTS => ('installment_mbb' === $installmentId) + ) ]; break; case Truemoney::CODE: diff --git a/Gateway/Request/PaymentDataBuilder.php b/Gateway/Request/PaymentDataBuilder.php index 9def17038..94496e251 100644 --- a/Gateway/Request/PaymentDataBuilder.php +++ b/Gateway/Request/PaymentDataBuilder.php @@ -10,6 +10,7 @@ use Omise\Payment\Model\Config\Cc; use Omise\Payment\Model\Config\Config; use Omise\Payment\Block\Adminhtml\System\Config\Form\Field\Webhook; +use Omise\Payment\Model\Capabilities; class PaymentDataBuilder implements BuilderInterface { @@ -53,14 +54,20 @@ class PaymentDataBuilder implements BuilderInterface */ private $money; + private $capabilities; + /** * @param \Omise\Payment\Helper\OmiseHelper $omiseHelper * @param Omise\Payment\Model\Config\Cc $ccConfig */ - public function __construct(Cc $ccConfig, OmiseMoney $money) - { + public function __construct( + Cc $ccConfig, + OmiseMoney $money, + Capabilities $capabilities + ) { $this->money = $money; $this->ccConfig = $ccConfig; + $this->capabilities = $capabilities; } /** @@ -99,8 +106,9 @@ public function build(array $buildSubject) $requestBody[self::WEBHOOKS_ENDPOINT] = [$webhookUrl]; } - if (Installment::CODE === $method->getMethod()) { - $requestBody[self::ZERO_INTEREST_INSTALLMENTS] = $this->isZeroInterestInstallment($method); + // Set zero_interest_installment to true for installment Maybank only + if ($this->enableZeroInterestInstallments($method)) { + $requestBody[self::ZERO_INTEREST_INSTALLMENTS] = true; } if (Cc::CODE === $method->getMethod()) { @@ -110,9 +118,13 @@ public function build(array $buildSubject) return $requestBody; } - public function isZeroInterestInstallment($method) + /** + * Set zero_interest_installment to true for installment Maybank + */ + public function enableZeroInterestInstallments($method) { + $isInstallment = Installment::CODE === $method->getMethod(); $installmentId = $method->getAdditionalInformation(InstallmentDataAssignObserver::OFFSITE); - return ('installment_mbb' === $installmentId); + return $isInstallment && (Installment::MBB_ID === $installmentId); } } diff --git a/Test/Unit/PaymentDataBuilderTest.php b/Test/Unit/PaymentDataBuilderTest.php index 6ad111ee8..383bc7b51 100644 --- a/Test/Unit/PaymentDataBuilderTest.php +++ b/Test/Unit/PaymentDataBuilderTest.php @@ -18,6 +18,7 @@ use Magento\Store\Api\Data\StoreInterface; use Omise\Payment\Model\Config\Installment; use Omise\Payment\Model\Config\Promptpay; +use Omise\Payment\Model\Capabilities; class PaymentDataBuilderTest extends TestCase { @@ -30,6 +31,7 @@ class PaymentDataBuilderTest extends TestCase private $configMock; private $storeManagerMock; private $storeMock; + private $capabilities; protected function setUp(): void { @@ -42,6 +44,7 @@ protected function setUp(): void $this->orderMock = m::mock(OrderInterface::class); $this->storeManagerMock = m::mock(StoreManagerInterface::class); $this->storeMock = m::mock(StoreInterface::class); + $this->capabilities = m::mock(Capabilities::class); } /** @@ -97,7 +100,11 @@ public function testBuild($paymentMethod, $expectedMetadata) $this->paymentDataMock->shouldReceive('getOrder')->andReturn($this->orderMock); $this->paymentDataMock->shouldReceive('getPayment')->andReturn($this->paymentMock); - $model = new PaymentDataBuilder($this->ccConfigMock, $this->omiseMoneyMock); + $model = new PaymentDataBuilder( + $this->ccConfigMock, + $this->omiseMoneyMock, + $this->capabilities + ); $result = $model->build(['payment' => $this->paymentDataMock]); $this->assertEquals(100000, $result['amount']); From ffcfb726f3bacff379d3431b3f336d53e665ec3a Mon Sep 17 00:00:00 2001 From: Aashish Date: Fri, 24 Nov 2023 18:44:11 +0700 Subject: [PATCH 4/4] Preparing release of v3.5.1 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- etc/module.xml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbb652158..36678ef1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## [v3.5.1 _(Nov, 24, 2023)_](https://github.com/omise/omise-magento/releases/tag/v3.5.1) +- Updated OCBC digital logo. (PR: [#457](https://github.com/omise/omise-magento/pull/457)) +- Remove zero_interest_installments option from installment banks other than Maybank. (PR: [#458](https://github.com/omise/omise-magento/pull/458)) + ## [v3.5.0 _(Oct, 24, 2023)_](https://github.com/omise/omise-magento/releases/tag/v3.5.0) - Added QR expires count down for promptpay. (PR: [#453](https://github.com/omise/omise-magento/pull/453)) diff --git a/composer.json b/composer.json index 56c8f0dae..230b22235 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "email": "support@omise.co" } ], - "version": "3.5.0", + "version": "3.5.1", "minimum-stability": "stable", "type": "magento2-module", "license": "MIT", diff --git a/etc/module.xml b/etc/module.xml index 7d5896fa0..2defbedd7 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +