Skip to content

Commit 7aacffb

Browse files
Merge pull request #459 from omise/release-v3.5.1
Preparing release of v3.5.1
2 parents 4ceb8ce + ffcfb72 commit 7aacffb

File tree

11 files changed

+38
-29
lines changed

11 files changed

+38
-29
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
# Lines starting with '#' are comments.
2-
# Each line is a file pattern followed by one or more owners.
3-
4-
# Order is important. The last matching pattern has the most precedence.
5-
# So if a pull request only touches javascript files, only these owners
6-
# will be requested to review.
7-
# example: *.js @octocat @github/js
8-
9-
# These owners will be the default owners for everything in the repo.
10-
* @aashishgurung @ajzkk
1+
* @omise/maintainers

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## [v3.5.1 _(Nov, 24, 2023)_](https://github.com/omise/omise-magento/releases/tag/v3.5.1)
4+
- Updated OCBC digital logo. (PR: [#457](https://github.com/omise/omise-magento/pull/457))
5+
- Remove zero_interest_installments option from installment banks other than Maybank. (PR: [#458](https://github.com/omise/omise-magento/pull/458))
6+
37
## [v3.5.0 _(Oct, 24, 2023)_](https://github.com/omise/omise-magento/releases/tag/v3.5.0)
48
- Added QR expires count down for promptpay. (PR: [#453](https://github.com/omise/omise-magento/pull/453))
59

Gateway/Request/APMBuilder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ public function build(array $buildSubject)
179179
self::SOURCE_TYPE => $installmentId,
180180
self::SOURCE_INSTALLMENT_TERMS => $method->getAdditionalInformation(
181181
InstallmentDataAssignObserver::TERMS
182-
),
183-
self::ZERO_INTEREST_INSTALLMENTS => ('installment_mbb' === $installmentId)
182+
)
184183
];
185184
break;
186185
case Truemoney::CODE:

Gateway/Request/PaymentDataBuilder.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Omise\Payment\Model\Config\Cc;
1111
use Omise\Payment\Model\Config\Config;
1212
use Omise\Payment\Block\Adminhtml\System\Config\Form\Field\Webhook;
13+
use Omise\Payment\Model\Capabilities;
1314

1415
class PaymentDataBuilder implements BuilderInterface
1516
{
@@ -53,14 +54,20 @@ class PaymentDataBuilder implements BuilderInterface
5354
*/
5455
private $money;
5556

57+
private $capabilities;
58+
5659
/**
5760
* @param \Omise\Payment\Helper\OmiseHelper $omiseHelper
5861
* @param Omise\Payment\Model\Config\Cc $ccConfig
5962
*/
60-
public function __construct(Cc $ccConfig, OmiseMoney $money)
61-
{
63+
public function __construct(
64+
Cc $ccConfig,
65+
OmiseMoney $money,
66+
Capabilities $capabilities
67+
) {
6268
$this->money = $money;
6369
$this->ccConfig = $ccConfig;
70+
$this->capabilities = $capabilities;
6471
}
6572

6673
/**
@@ -99,8 +106,9 @@ public function build(array $buildSubject)
99106
$requestBody[self::WEBHOOKS_ENDPOINT] = [$webhookUrl];
100107
}
101108

102-
if (Installment::CODE === $method->getMethod()) {
103-
$requestBody[self::ZERO_INTEREST_INSTALLMENTS] = $this->isZeroInterestInstallment($method);
109+
// Set zero_interest_installment to true for installment Maybank only
110+
if ($this->enableZeroInterestInstallments($method)) {
111+
$requestBody[self::ZERO_INTEREST_INSTALLMENTS] = true;
104112
}
105113

106114
if (Cc::CODE === $method->getMethod()) {
@@ -110,9 +118,13 @@ public function build(array $buildSubject)
110118
return $requestBody;
111119
}
112120

113-
public function isZeroInterestInstallment($method)
121+
/**
122+
* Set zero_interest_installment to true for installment Maybank
123+
*/
124+
public function enableZeroInterestInstallments($method)
114125
{
126+
$isInstallment = Installment::CODE === $method->getMethod();
115127
$installmentId = $method->getAdditionalInformation(InstallmentDataAssignObserver::OFFSITE);
116-
return ('installment_mbb' === $installmentId);
128+
return $isInstallment && (Installment::MBB_ID === $installmentId);
117129
}
118130
}

Test/Unit/PaymentDataBuilderTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Magento\Store\Api\Data\StoreInterface;
1919
use Omise\Payment\Model\Config\Installment;
2020
use Omise\Payment\Model\Config\Promptpay;
21+
use Omise\Payment\Model\Capabilities;
2122

2223
class PaymentDataBuilderTest extends TestCase
2324
{
@@ -30,6 +31,7 @@ class PaymentDataBuilderTest extends TestCase
3031
private $configMock;
3132
private $storeManagerMock;
3233
private $storeMock;
34+
private $capabilities;
3335

3436
protected function setUp(): void
3537
{
@@ -42,6 +44,7 @@ protected function setUp(): void
4244
$this->orderMock = m::mock(OrderInterface::class);
4345
$this->storeManagerMock = m::mock(StoreManagerInterface::class);
4446
$this->storeMock = m::mock(StoreInterface::class);
47+
$this->capabilities = m::mock(Capabilities::class);
4548
}
4649

4750
/**
@@ -97,7 +100,11 @@ public function testBuild($paymentMethod, $expectedMetadata)
97100
$this->paymentDataMock->shouldReceive('getOrder')->andReturn($this->orderMock);
98101
$this->paymentDataMock->shouldReceive('getPayment')->andReturn($this->paymentMock);
99102

100-
$model = new PaymentDataBuilder($this->ccConfigMock, $this->omiseMoneyMock);
103+
$model = new PaymentDataBuilder(
104+
$this->ccConfigMock,
105+
$this->omiseMoneyMock,
106+
$this->capabilities
107+
);
101108
$result = $model->build(['payment' => $this->paymentDataMock]);
102109

103110
$this->assertEquals(100000, $result['amount']);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"email": "support@omise.co"
1010
}
1111
],
12-
"version": "3.5.0",
12+
"version": "3.5.1",
1313
"minimum-stability": "stable",
1414
"type": "magento2-module",
1515
"license": "MIT",

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Omise_Payment" setup_version="3.5.0">
3+
<module name="Omise_Payment" setup_version="3.5.1">
44
<sequence>
55
<module name="Magento_Sales"/>
66
<module name="Magento_Payment"/>

view/frontend/web/css/styles.css

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@
151151
background-size: contain;
152152
}
153153

154-
/** MayBank **/
155-
/* #omise_offsite_installmentForm .mbb {
156-
background: #007bc4;
157-
} */
158-
159154
#omise_offsite_installmentForm img.mbb {
160155
background: url('../images/fpx-maybank.svg');
161156
}
@@ -171,7 +166,7 @@ div.ocbc_pao {
171166
}
172167

173168
div.ocbc_digital {
174-
background-image: url('../images/ocbc_digital.png');
169+
background-image: url('../images/ocbc_digital.svg');
175170
width: 30px;
176171
height: 30px;
177172
float: right;
-1.82 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)