From fe77d62b58df5a3f0813ba12be01e21d27921456 Mon Sep 17 00:00:00 2001 From: muthuswamyopn <95462571+muthuswamyopn@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:44:11 +0530 Subject: [PATCH 1/5] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8173c273..6f6acd97 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ Opn Payments provides a set of APIs that help merchants of any size accept payme **Omise Magento** is our official plugin providing support for processing payments on Magento through Opn Payments. +## Security Warning + +**Please do NOT use Omise Magento library versions less than 2.18.6, as they are outdated and have security vulnerabilities.** + ## Usage See our [official docs](https://docs.opn.ooo/magento-plugin) for details on installation and configuration. From 18d163021b59a189805da67955b3ffe804accd91 Mon Sep 17 00:00:00 2001 From: muthuswamyopn <95462571+muthuswamyopn@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:20:10 +0530 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f6acd97..ad6fd162 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Opn Payments provides a set of APIs that help merchants of any size accept payme ## Security Warning -**Please do NOT use Omise Magento library versions less than 2.18.6, as they are outdated and have security vulnerabilities.** +**Please do NOT use Omise Magento plugin versions less than 2.18.6, as they are outdated and have security vulnerabilities.** ## Usage From 76bfd3e9aaf6fe48fbe93723a718cf1ad4ae84e1 Mon Sep 17 00:00:00 2001 From: Aashish Gurung <101558497+aashishgurung@users.noreply.github.com> Date: Fri, 29 Mar 2024 17:15:17 +0700 Subject: [PATCH 3/5] Added WeChat Pay. (#475) * Added WeChat Pay. * Added tests and updated a few. * Fixed a few M2 standard alert. * Added and updated few tests * Added one more test. * Added @covers annotation * Fixed the dummy user agent in test. --------- Co-authored-by: Aashish --- Cron/OrderSyncStatus.php | 1 + Gateway/Request/APMBuilder.php | 50 +++--- Helper/OmiseHelper.php | 49 +----- Helper/RequestHelper.php | 99 +++++++++++ Model/Config/WeChatPay.php | 18 ++ Model/Ui/CapabilitiesConfigProvider.php | 13 +- Test/Mock/RequestMockInterface.php | 8 + .../Request/APMBuilders/APMBuilderTest.php | 6 +- .../APMBuilders/AlipayAPMBuilderTest.php | 107 ++++++++++-- .../APMBuilders/AtomeAPMBuilderTest.php | 6 +- .../APMBuilders/PayPayAPMBuilderTest.php | 2 +- .../APMBuilders/TruemoneyAPMBuilderTest.php | 4 +- Test/Unit/Helper/OmiseHelperTest.php | 40 +---- Test/Unit/Helper/RequestHelperTest.php | 154 ++++++++++++++++++ Test/Unit/Helper/ReturnUrlHelperTest.php | 2 - Test/Unit/Model/Config/AlipayConfigTest.php | 18 ++ .../Ui/CapabilitiesConfigProviderTest.php | 10 +- Test/Unit/OcbcDigitalAPMBuilderTest.php | 8 +- etc/adminhtml/system.xml | 29 ++++ etc/config.xml | 14 ++ etc/di.xml | 48 ++++++ view/frontend/layout/checkout_index_index.xml | 3 + view/frontend/web/images/wechat_pay.svg | 3 + .../omise-offsite-wechat-pay-method.js | 33 ++++ 24 files changed, 587 insertions(+), 138 deletions(-) create mode 100644 Helper/RequestHelper.php create mode 100644 Model/Config/WeChatPay.php create mode 100644 Test/Mock/RequestMockInterface.php create mode 100644 Test/Unit/Helper/RequestHelperTest.php create mode 100644 Test/Unit/Model/Config/AlipayConfigTest.php create mode 100644 view/frontend/web/images/wechat_pay.svg create mode 100644 view/frontend/web/js/view/payment/method-renderer/omise-offsite-wechat-pay-method.js diff --git a/Cron/OrderSyncStatus.php b/Cron/OrderSyncStatus.php index 41e6ccb2..1052c946 100644 --- a/Cron/OrderSyncStatus.php +++ b/Cron/OrderSyncStatus.php @@ -43,6 +43,7 @@ class OrderSyncStatus "omise_offsite_shopeepay", "omise_offsite_atome", "omise_offsite_paypay", + "omise_offiste_wechat_pay" ]; /** diff --git a/Gateway/Request/APMBuilder.php b/Gateway/Request/APMBuilder.php index 69f6c671..6a8d0c2c 100644 --- a/Gateway/Request/APMBuilder.php +++ b/Gateway/Request/APMBuilder.php @@ -28,9 +28,9 @@ use Omise\Payment\Model\Config\Mobilebanking; use Omise\Payment\Model\Config\Rabbitlinepay; use Omise\Payment\Model\Config\PayPay; +use Omise\Payment\Model\Config\WeChatPay; use Omise\Payment\Helper\OmiseMoney; -use Omise\Payment\Helper\OmiseHelper as Helper; use Omise\Payment\Model\Config\Internetbanking; use Omise\Payment\Model\Config\Conveniencestore; use Magento\Payment\Gateway\Helper\SubjectReader; @@ -43,6 +43,7 @@ use Omise\Payment\Observer\MobilebankingDataAssignObserver; use Omise\Payment\Observer\InternetbankingDataAssignObserver; use Omise\Payment\Observer\ConveniencestoreDataAssignObserver; +use Omise\Payment\Helper\RequestHelper; class APMBuilder implements BuilderInterface { @@ -107,14 +108,14 @@ class APMBuilder implements BuilderInterface const SOURCE_SHIPPING = 'shipping'; /** - * @var \Omise\Payment\Helper\ReturnUrlHelper + * @var string */ - protected $returnUrl; + const SOURCE_IP = 'ip'; /** - * @var Helper + * @var \Omise\Payment\Helper\ReturnUrlHelper */ - protected $helper; + protected $returnUrl; /** * @var OmiseMoney @@ -131,22 +132,27 @@ class APMBuilder implements BuilderInterface */ protected $config; + /** + * @var \Omise\Payment\Helper\RequestHelper + */ + private $requestHelper; + /** * @param $helper \Omise\Payment\Helper\OmiseHelper * @param $returnUrl \Omise\Payment\Helper\ReturnUrl */ public function __construct( - Helper $helper, ReturnUrlHelper $returnUrl, Config $config, Capabilities $capabilities, - OmiseMoney $money + OmiseMoney $money, + RequestHelper $requestHelper ) { - $this->helper = $helper; $this->returnUrl = $returnUrl; $this->config = $config; $this->capabilities = $capabilities; $this->money = $money; + $this->requestHelper = $requestHelper; } /** @@ -234,43 +240,43 @@ public function build(array $buildSubject) case Alipayplus::ALIPAY_CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'alipay_cn', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Alipayplus::ALIPAYHK_CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'alipay_hk', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Alipayplus::DANA_CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'dana', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Alipayplus::GCASH_CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'gcash', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Alipayplus::KAKAOPAY_CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'kakaopay', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Touchngo::CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'touch_n_go', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Mobilebanking::CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => $method->getAdditionalInformation(MobilebankingDataAssignObserver::OFFSITE), - self::PLATFORM_TYPE => $this->helper->getPlatformType() + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType() ]; break; case Rabbitlinepay::CODE: @@ -281,19 +287,19 @@ public function build(array $buildSubject) case Ocbcpao::CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'mobile_banking_ocbc_pao', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case OcbcDigital::CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => OcbcDigital::ID, - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Grabpay::CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'grabpay', - self::PLATFORM_TYPE => $this->helper->getPlatformType(), + self::PLATFORM_TYPE => $this->requestHelper->getPlatformType(), ]; break; case Boost::CODE: @@ -339,6 +345,12 @@ public function build(array $buildSubject) self::SOURCE_TYPE => PayPay::ID, ]; break; + case WeChatPay::CODE: + $paymentInfo[self::SOURCE] = [ + self::SOURCE_TYPE => WeChatPay::ID, + self::SOURCE_IP => $this->requestHelper->getClientIp() + ]; + break; } return $paymentInfo; @@ -350,7 +362,7 @@ private function getShopeepaySource() $isShopeepayEnabled = $this->capabilities->isBackendEnabled(Shopeepay::ID); // If user is in mobile and jump app is enabled then return shopeepay_jumpapp as source - if ($this->helper->isMobilePlatform() && $isShopeepayJumpAppEnabled) { + if ($this->requestHelper->isMobilePlatform() && $isShopeepayJumpAppEnabled) { return Shopeepay::JUMPAPP_ID; } diff --git a/Helper/OmiseHelper.php b/Helper/OmiseHelper.php index 7da7ff37..88a3c45e 100644 --- a/Helper/OmiseHelper.php +++ b/Helper/OmiseHelper.php @@ -16,7 +16,6 @@ use Omise\Payment\Model\Config\Config; use Omise\Payment\Model\Config\Paynow; use Omise\Payment\Model\Config\PayPay; -use Magento\Framework\App\Request\Http; use Magento\Store\Model\ScopeInterface; use Omise\Payment\Model\Config\Grabpay; use Omise\Payment\Model\Config\Ocbcpao; @@ -38,14 +37,10 @@ use Omise\Payment\Model\Config\Internetbanking; use Magento\Framework\App\Helper\AbstractHelper; use Omise\Payment\Model\Config\Conveniencestore; +use Omise\Payment\Model\Config\WeChatPay; class OmiseHelper extends AbstractHelper { - /** - * @var \Magento\Framework\HTTP\Header - */ - protected $header; - /** * @var array */ @@ -73,7 +68,8 @@ class OmiseHelper extends AbstractHelper MaybankQR::CODE, Shopeepay::CODE, Atome::CODE, - PayPay::CODE + PayPay::CODE, + WeChatPay::CODE ]; /** @@ -143,6 +139,7 @@ class OmiseHelper extends AbstractHelper Shopeepay::JUMPAPP_ID => Shopeepay::CODE, Atome::ID => Atome::CODE, PayPay::ID => PayPay::CODE, + WeChatPay::ID => WeChatPay::CODE, // offsite internet banking payment Internetbanking::BBL_ID => Internetbanking::CODE, @@ -209,6 +206,7 @@ class OmiseHelper extends AbstractHelper Shopeepay::CODE => "ShopeePay Payment", Atome::CODE => "Atome Payment", PayPay::CODE => "PayPay Payment", + WeChatPay::CODE => "WeChat Pay Payment", // offline payment Paynow::CODE => "PayNow QR Payment", @@ -225,16 +223,10 @@ class OmiseHelper extends AbstractHelper /** * @param Header $header * @param Config $config - * @param Http $httpRequest */ - public function __construct( - Header $header, - Config $config, - Http $httpRequest - ) { - $this->header = $header; + public function __construct(Config $config) + { $this->config = $config; - $this->httpRequest = $httpRequest; $this->omisePaymentMethods = array_merge( $this->offsitePaymentMethods, @@ -406,33 +398,6 @@ public function is3DSecureEnabled($charge) return false; } - /** - * Get platform Type of WEB, IOS or ANDROID to add to source API parameter. - * @return string - */ - public function getPlatformType() - { - $userAgent = $this->header->getHttpUserAgent(); - - if (preg_match("/(Android)/i", $userAgent)) { - return "ANDROID"; - } - - if (preg_match("/(iPad|iPhone|iPod)/i", $userAgent)) { - return "IOS"; - } - - return "WEB"; - } - - /** - * Check if current platform is mobile or not - */ - public function isMobilePlatform() - { - return 'WEB' !== $this->getPlatformType(); - } - /** * Depending on the setting of state to generate invoice, we will either create an invoice or return a created one. * Invoice will be marked as successfully paid and returned. diff --git a/Helper/RequestHelper.php b/Helper/RequestHelper.php new file mode 100644 index 00000000..8d1410ea --- /dev/null +++ b/Helper/RequestHelper.php @@ -0,0 +1,99 @@ +request = $request; + $this->header = $header; + } + + public function getClientIp() + { + $headersToCheck = [ + // Check for a client using a shared internet connection + 'HTTP_CLIENT_IP', + + // Check if the proxy is used for IP/IPs + 'HTTP_X_FORWARDED_FOR', + + // check for other possible forwarded IP headers + 'HTTP_X_FORWARDED', + 'HTTP_FORWARDED_FOR', + 'HTTP_FORWARDED', + ]; + + foreach ($headersToCheck as $header) { + $headerValue = $this->request->getServer($header, ''); + + if (empty($headerValue)) { + continue; + } + + if ($header === 'HTTP_X_FORWARDED_FOR' && !empty($headerValue)) { + return $this->processForwardedForHeader($headerValue); + } + + return $headerValue; + } + + // return default remote IP address + return $this->request->getServer('REMOTE_ADDR', ''); + } + + private function processForwardedForHeader($forwardedForHeader) + { + // Split if multiple IP addresses exist and get the last IP address + if (strpos($forwardedForHeader, ',') !== false) { + $multiple_ips = explode(",", $forwardedForHeader); + return trim(current($multiple_ips)); + } + + return $forwardedForHeader; + } + + /** + * Get platform Type of WEB, IOS or ANDROID to add to source API parameter. + * @return string + */ + public function getPlatformType() + { + $userAgent = $this->header->getHttpUserAgent(); + + if (preg_match("/(Android)/i", $userAgent)) { + return "ANDROID"; + } + + if (preg_match("/(iPad|iPhone|iPod)/i", $userAgent)) { + return "IOS"; + } + + return "WEB"; + } + + /** + * Check if current platform is mobile or not + */ + public function isMobilePlatform() + { + return 'WEB' !== $this->getPlatformType(); + } +} diff --git a/Model/Config/WeChatPay.php b/Model/Config/WeChatPay.php new file mode 100644 index 00000000..cb692c62 --- /dev/null +++ b/Model/Config/WeChatPay.php @@ -0,0 +1,18 @@ +capabilities = $capabilities; $this->_paymentLists = $paymentLists; $this->_storeManager = $storeManager; - $this->helper = $helper; + $this->requestHelper = $requestHelper; } /** @@ -116,7 +119,7 @@ private function getShopeeBackendByType($shopeeBackends) $isShopeepayEnabled = $this->capabilities->isBackendEnabled(Shopeepay::ID); // If user is in mobile and jump app is enabled then return jumpapp backend - if ($this->helper->isMobilePlatform() && $isShopeepayJumpAppEnabled) { + if ($this->requestHelper->isMobilePlatform() && $isShopeepayJumpAppEnabled) { return $jumpAppBackend; } diff --git a/Test/Mock/RequestMockInterface.php b/Test/Mock/RequestMockInterface.php new file mode 100644 index 00000000..3a6ea196 --- /dev/null +++ b/Test/Mock/RequestMockInterface.php @@ -0,0 +1,8 @@ +helper = $this->getMockBuilder(OmiseHelper::class)->disableOriginalConstructor()->getMock(); + $this->requestHelper = $this->getMockBuilder(RequestHelper::class)->disableOriginalConstructor()->getMock(); $this->returnUrlHelper = $this->getMockBuilder(ReturnUrlHelper::class)->disableOriginalConstructor()->getMock(); $this->config = $this->getMockBuilder(Config::class)->disableOriginalConstructor()->getMock(); $this->capabilities = $this->getMockBuilder(Capabilities::class)->disableOriginalConstructor()->getMock(); diff --git a/Test/Unit/Gateway/Request/APMBuilders/AlipayAPMBuilderTest.php b/Test/Unit/Gateway/Request/APMBuilders/AlipayAPMBuilderTest.php index dc4e9548..b0ee34c7 100644 --- a/Test/Unit/Gateway/Request/APMBuilders/AlipayAPMBuilderTest.php +++ b/Test/Unit/Gateway/Request/APMBuilders/AlipayAPMBuilderTest.php @@ -6,45 +6,126 @@ use Omise\Payment\Gateway\Request\APMBuilder; use Omise\Payment\Helper\OmiseMoney; use Omise\Payment\Model\Config\Alipay; +use Omise\Payment\Model\Config\Alipayplus; +use Omise\Payment\Model\Config\OcbcDigital; +use Omise\Payment\Model\Config\Ocbcpao; +use Omise\Payment\Model\Config\Grabpay; +use Omise\Payment\Model\Config\Boost; +use Omise\Payment\Model\Config\DuitnowQR; +use Omise\Payment\Model\Config\MaybankQR; +use Omise\Payment\Model\Config\Touchngo; +use Omise\Payment\Model\Config\Promptpay; +use Omise\Payment\Model\Config\Pointsciti; +use Omise\Payment\Model\Config\Paynow; +use Omise\Payment\Model\Config\Tesco; +use Omise\Payment\Model\Config\Rabbitlinepay; +use Omise\Payment\Model\Config\WeChatPay; use Omise\Payment\Test\Unit\Gateway\Request\APMBuilders\APMBuilderTest; class AlipayAPMBuilderTest extends APMBuilderTest { - /** - * @covers Omise\Payment\Gateway\Request\APMBuilder - * @covers Omise\Payment\Model\Config\Alipay - */ - public function testApmBuilder() + private function initialize($code) { - $this->infoMock->method('getMethod')->willReturn(Alipay::CODE); + $this->infoMock->method('getMethod')->willReturn($code); $this->returnUrlHelper->method('create')->willReturn([ 'url' => 'https://omise.co/complete', 'token' => '1234' ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper ); - $result = $this->builder->build(['payment' => new PaymentDataObject( + return $this->builder->build(['payment' => new PaymentDataObject( $this->orderMock, $this->infoMock )]); + } + + /** + * @dataProvider apmRequiringOnlySourceTypeDataProvider + * @covers Omise\Payment\Gateway\Request\APMBuilder + * @covers Omise\Payment\Model\Config\Alipay + * @test + */ + public function apmRequiringOnlySourceTypeBuilder($code, $id) + { + $result = $this->initialize($code); - $this->assertEquals('alipay', $result['source']['type']); + $this->assertEquals($id, $result['source']['type']); $this->assertEquals('https://omise.co/complete', $result['return_uri']); } /** - * @covers Omise\Payment\Model\Config\Alipay + * @dataProvider apmRequiringPlatformTypDataProvider + * @covers Omise\Payment\Gateway\Request\APMBuilder + * @test + */ + public function apmRequiringAdditionalPlatformType($code, $id) + { + $platformType = 'WEB'; + $this->requestHelper->method('getPlatformType')->willReturn($platformType); + $result = $this->initialize($code); + + $this->assertEquals($id, $result['source']['type']); + $this->assertEquals('https://omise.co/complete', $result['return_uri']); + $this->assertEquals($platformType, $result['source']['platform_type']); + } + + /** + * @dataProvider apmRequiringIpDataProvider + * @covers Omise\Payment\Gateway\Request\APMBuilder + * @test */ - public function testConstants() + public function apmRequiringAdditionalIp($code, $id) + { + $ip = '127.0.0.1'; + $this->requestHelper->method('getClientIp')->willReturn($ip); + $result = $this->initialize($code); + + $this->assertEquals($id, $result['source']['type']); + $this->assertEquals('https://omise.co/complete', $result['return_uri']); + $this->assertEquals($ip, $result['source']['ip']); + } + + public function apmRequiringOnlySourceTypeDataProvider() + { + return [ + [Alipay::CODE, Alipay::ID], + [Tesco::CODE, Tesco::ID], + [Paynow::CODE, Paynow::ID], + [Promptpay::CODE, Promptpay::ID], + [Pointsciti::CODE, Pointsciti::ID], + [Rabbitlinepay::CODE, Rabbitlinepay::ID], + [Boost::CODE, Boost::ID], + [DuitnowQR::CODE, DuitnowQR::ID], + [MaybankQR::CODE, MaybankQR::ID], + ]; + } + + public function apmRequiringPlatformTypDataProvider() + { + return [ + [Alipayplus::ALIPAY_CODE, Alipayplus::ALIPAY_ID], + [Alipayplus::ALIPAYHK_CODE, Alipayplus::ALIPAYHK_ID], + [Alipayplus::DANA_CODE, Alipayplus::DANA_ID], + [Alipayplus::GCASH_CODE, Alipayplus::GCASH_ID], + [Alipayplus::KAKAOPAY_CODE, Alipayplus::KAKAOPAY_ID], + [Grabpay::CODE, Grabpay::ID], + [OcbcDigital::CODE, OcbcDigital::ID], + [Ocbcpao::CODE, Ocbcpao::ID], + [Touchngo::CODE, Touchngo::ID], + ]; + } + + public function apmRequiringIpDataProvider() { - $this->assertEquals('omise_offsite_alipay', Alipay::CODE); - $this->assertEquals('alipay', Alipay::ID); + return [ + [WeChatPay::CODE, WeChatPay::ID], + ]; } } diff --git a/Test/Unit/Gateway/Request/APMBuilders/AtomeAPMBuilderTest.php b/Test/Unit/Gateway/Request/APMBuilders/AtomeAPMBuilderTest.php index f2f11a44..e95f5ed7 100644 --- a/Test/Unit/Gateway/Request/APMBuilders/AtomeAPMBuilderTest.php +++ b/Test/Unit/Gateway/Request/APMBuilders/AtomeAPMBuilderTest.php @@ -37,11 +37,11 @@ public function testApmBuilderWithItemPriceZero() ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper ); $result = $this->builder->build(['payment' => new PaymentDataObject( @@ -69,11 +69,11 @@ public function testApmBuilderWithItemPriceGreaterThanZero() ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper ); $result = $this->builder->build(['payment' => new PaymentDataObject( @@ -102,11 +102,11 @@ public function testApmBuilderWithSubProductNonZeroButHasParentItem() ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper ); $result = $this->builder->build(['payment' => new PaymentDataObject( diff --git a/Test/Unit/Gateway/Request/APMBuilders/PayPayAPMBuilderTest.php b/Test/Unit/Gateway/Request/APMBuilders/PayPayAPMBuilderTest.php index 4243582a..e60a5c9f 100644 --- a/Test/Unit/Gateway/Request/APMBuilders/PayPayAPMBuilderTest.php +++ b/Test/Unit/Gateway/Request/APMBuilders/PayPayAPMBuilderTest.php @@ -23,11 +23,11 @@ public function testApmBuilder() ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper ); $result = $this->builder->build(['payment' => new PaymentDataObject( diff --git a/Test/Unit/Gateway/Request/APMBuilders/TruemoneyAPMBuilderTest.php b/Test/Unit/Gateway/Request/APMBuilders/TruemoneyAPMBuilderTest.php index 6590fb90..3fe80e6d 100644 --- a/Test/Unit/Gateway/Request/APMBuilders/TruemoneyAPMBuilderTest.php +++ b/Test/Unit/Gateway/Request/APMBuilders/TruemoneyAPMBuilderTest.php @@ -22,11 +22,11 @@ public function testApmBuilderForTruemoneyJumpapp() ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper ); $result = $this->builder->build(['payment' => new PaymentDataObject( @@ -57,11 +57,11 @@ public function testApmBuilderForTruemoneyWallet() ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper ); $result = $this->builder->build(['payment' => new PaymentDataObject( diff --git a/Test/Unit/Helper/OmiseHelperTest.php b/Test/Unit/Helper/OmiseHelperTest.php index 4f7590d8..33898196 100644 --- a/Test/Unit/Helper/OmiseHelperTest.php +++ b/Test/Unit/Helper/OmiseHelperTest.php @@ -25,10 +25,8 @@ class OmiseHelperTest extends \PHPUnit\Framework\TestCase */ public function setUp(): void { - $this->headerMock = $this->createMock('Magento\Framework\HTTP\Header'); $this->configMock = $this->createMock('Omise\Payment\Model\Config\Config'); - $this->requestMock = $this->createMock('Magento\Framework\App\Request\Http'); - $this->model = new OmiseHelper($this->headerMock, $this->configMock, $this->requestMock); + $this->model = new OmiseHelper($this->configMock); } /** @@ -130,42 +128,6 @@ public function isCreditCardPaymentMethodReturnFalseIfWrongPaymentCodeIsPassed() $this->assertFalse($isCreditCardPaymentMethod); } - /** - * Test the function getPlatformType() return correct platform as per user agent - * - * @dataProvider platformTypeProvider - * @covers \Omise\Payment\Helper\OmiseHelper - * @test - */ - public function getPlatformTypeReturnsCorrectPlatform($platform, $expectedValue) - { - $headerMock = $this->headerMock; - $headerMock->method('getHttpUserAgent') - ->willReturn($platform); - - $result = $this->model->getPlatformType(); - - $this->assertEquals($expectedValue, $result); - } - - public function platformTypeProvider() - { - return [ - ['Android', 'ANDROID'], - ['android', 'ANDROID'], - ['ipad', 'IOS'], - ['IPAD', 'IOS'], - ['iPad', 'IOS'], - ['iphone', 'IOS'], - ['IPHONE', 'IOS'], - ['iPhone', 'IOS'], - ['ipod', 'IOS'], - ['IPOD', 'IOS'], - ['iPod', 'IOS'], - ['Mozilla', 'WEB'], - ]; - } - /** * Test the function is3DSecureEnabled() whether 3DS is enabled or not * by checking charge object diff --git a/Test/Unit/Helper/RequestHelperTest.php b/Test/Unit/Helper/RequestHelperTest.php new file mode 100644 index 00000000..72853ab6 --- /dev/null +++ b/Test/Unit/Helper/RequestHelperTest.php @@ -0,0 +1,154 @@ +requestMock = $this->createMock(RequestMockInterface::class); + $this->headerMock = $this->createMock('\Magento\Framework\HTTP\Header'); + $this->model = new RequestHelper($this->requestMock, $this->headerMock); + } + + /** + * Test the function getPlatformType() return correct platform as per user agent + * + * @dataProvider platformTypeProvider + * @covers \Omise\Payment\Helper\RequestHelper + * @test + */ + public function getPlatformTypeReturnsCorrectPlatform($platform, $expectedValue) + { + $headerMock = $this->headerMock; + $headerMock->method('getHttpUserAgent') + ->willReturn($platform); + + $result = $this->model->getPlatformType(); + $this->assertEquals($expectedValue, $result); + } + + public function platformTypeProvider() + { + return [ + ['Android', 'ANDROID'], + ['android', 'ANDROID'], + ['ipad', 'IOS'], + ['IPAD', 'IOS'], + ['iPad', 'IOS'], + ['iphone', 'IOS'], + ['IPHONE', 'IOS'], + ['iPhone', 'IOS'], + ['ipod', 'IOS'], + ['IPOD', 'IOS'], + ['iPod', 'IOS'], + ['Mozilla', 'WEB'], + ]; + } + + /** + * @covers \Omise\Payment\Helper\RequestHelper + * @test + */ + public function getClientIpRemoteAddrHeader() + { + $requestMock = $this->requestMock; + $requestMock->method('getServer') + ->withConsecutive( + ['HTTP_CLIENT_IP'], + ['HTTP_X_FORWARDED_FOR'], + ['HTTP_X_FORWARDED'], + ['HTTP_FORWARDED_FOR'], + ['HTTP_FORWARDED'], + ['REMOTE_ADDR'] + ) + ->willReturnOnConsecutiveCalls(null, null, null, null, null, '192.168.1.6'); + + $result = $this->model->getClientIp(); + $this->assertEquals('192.168.1.6', $result); + } + + /** + * @covers \Omise\Payment\Helper\RequestHelper + * @test + */ + public function getClientIpHttpXForwadedForHeader() + { + $requestMock = $this->requestMock; + $requestMock->method('getServer') + ->withConsecutive( + ['HTTP_CLIENT_IP'], + ['HTTP_X_FORWARDED_FOR'] + ) + ->willReturnOnConsecutiveCalls(null, '192.168.1.5,192.168.1.6'); + + $result = $this->model->getClientIp(); + $this->assertEquals('192.168.1.5', $result); + } + + /** + * @covers \Omise\Payment\Helper\RequestHelper + * @test + */ + public function getClientIpHttpXForwardedHeader() + { + $requestMock = $this->requestMock; + $requestMock->method('getServer') + ->withConsecutive( + ['HTTP_CLIENT_IP'], + ['HTTP_X_FORWARDED_FOR'], + ['HTTP_X_FORWARDED'], + ) + ->willReturnOnConsecutiveCalls(null, null, '192.168.1.8'); + + $result = $this->model->getClientIp(); + $this->assertEquals('192.168.1.8', $result); + } + + /** + * @dataProvider isMobilePlatformDataProvider + * @covers \Omise\Payment\Helper\RequestHelper + * @test + */ + public function isMobilePlatform($platform, $expected) + { + $headerMock = $this->headerMock; + $headerMock->method('getHttpUserAgent') + ->willReturn($platform); + + $result = $this->model->isMobilePlatform(); + $this->assertEquals($expected, $result); + } + + public function isMobilePlatformDataProvider() + { + return [ + ['ANDROID', true], + ['iPhone', true], + ['Mozilla', false] + ]; + } +} diff --git a/Test/Unit/Helper/ReturnUrlHelperTest.php b/Test/Unit/Helper/ReturnUrlHelperTest.php index 859a256c..1efe9a57 100644 --- a/Test/Unit/Helper/ReturnUrlHelperTest.php +++ b/Test/Unit/Helper/ReturnUrlHelperTest.php @@ -2,9 +2,7 @@ namespace Omise\Payment\Test\Unit\Helper; -use Omise\Payment\Helper\TokenHelper; use Omise\Payment\Helper\ReturnUrlHelper; -use Magento\Framework\UrlInterface; class ReturnUrlHelperTest extends \PHPUnit\Framework\TestCase { diff --git a/Test/Unit/Model/Config/AlipayConfigTest.php b/Test/Unit/Model/Config/AlipayConfigTest.php new file mode 100644 index 00000000..60825dd4 --- /dev/null +++ b/Test/Unit/Model/Config/AlipayConfigTest.php @@ -0,0 +1,18 @@ +assertEquals('omise_offsite_alipay', Alipay::CODE); + $this->assertEquals('alipay', Alipay::ID); + } +} diff --git a/Test/Unit/Model/Ui/CapabilitiesConfigProviderTest.php b/Test/Unit/Model/Ui/CapabilitiesConfigProviderTest.php index 60b2a578..6265b35c 100644 --- a/Test/Unit/Model/Ui/CapabilitiesConfigProviderTest.php +++ b/Test/Unit/Model/Ui/CapabilitiesConfigProviderTest.php @@ -3,7 +3,7 @@ namespace Omise\Payment\Test\Unit\Model\Ui; use PHPUnit\Framework\TestCase; -use Omise\Payment\Helper\OmiseHelper; +use Omise\Payment\Helper\RequestHelper; use Omise\Payment\Model\Capabilities; use Magento\Store\Model\StoreManagerInterface; use Magento\Payment\Api\PaymentMethodListInterface; @@ -16,7 +16,7 @@ class CapabilitiesConfigProviderTest extends TestCase { private $storeManagerMock; private $capabilitiesMock; - private $helperMock; + private $requestHelper; private $paymentListsMock; protected function setUp(): void @@ -27,7 +27,7 @@ protected function setUp(): void $this->capabilitiesMock = $this->getMockBuilder(Capabilities::class) ->disableOriginalConstructor() ->getMock(); - $this->helperMock = $this->getMockBuilder(OmiseHelper::class) + $this->requestHelper = $this->getMockBuilder(RequestHelper::class) ->disableOriginalConstructor() ->getMock(); $this->paymentListsMock = $this->getMockBuilder(PaymentMethodListInterface::class) @@ -44,7 +44,7 @@ public function testGetTruemoneyBackendByType() $this->capabilitiesMock, $this->paymentListsMock, $this->storeManagerMock, - $this->helperMock + $this->requestHelper ); $expected = [ @@ -80,7 +80,7 @@ public function testFilterActiveBackends($code, $backend) $this->capabilitiesMock, $this->paymentListsMock, $this->storeManagerMock, - $this->helperMock + $this->requestHelper ); $paymentList = []; diff --git a/Test/Unit/OcbcDigitalAPMBuilderTest.php b/Test/Unit/OcbcDigitalAPMBuilderTest.php index 461a8f86..61aa8744 100644 --- a/Test/Unit/OcbcDigitalAPMBuilderTest.php +++ b/Test/Unit/OcbcDigitalAPMBuilderTest.php @@ -5,7 +5,7 @@ use Magento\Payment\Gateway\Data\OrderAdapterInterface; use Magento\Payment\Gateway\Data\PaymentDataObject; use Omise\Payment\Gateway\Request\APMBuilder; -use Omise\Payment\Helper\OmiseHelper; +use Omise\Payment\Helper\RequestHelper; use Omise\Payment\Helper\OmiseMoney; use Omise\Payment\Helper\ReturnUrlHelper; use Omise\Payment\Model\Capabilities; @@ -17,7 +17,7 @@ class OcbcDigitalAPMBuilderTest extends TestCase { private $builder; - private $helper; + private $requestHelper; private $returnUrlHelper; private $config; private $capabilities; @@ -26,7 +26,7 @@ class OcbcDigitalAPMBuilderTest extends TestCase protected function setUp(): void { - $this->helper = $this->getMockBuilder(OmiseHelper::class)->disableOriginalConstructor()->getMock(); + $this->requestHelper = $this->getMockBuilder(RequestHelper::class)->disableOriginalConstructor()->getMock(); $this->returnUrlHelper = $this->getMockBuilder(ReturnUrlHelper::class)->disableOriginalConstructor()->getMock(); $this->config = $this->getMockBuilder(Config::class)->disableOriginalConstructor()->getMock(); $this->capabilities = $this->getMockBuilder(Capabilities::class)->disableOriginalConstructor()->getMock(); @@ -47,11 +47,11 @@ public function testApmBuilder() ]); $this->builder = new APMBuilder( - $this->helper, $this->returnUrlHelper, $this->config, $this->capabilities, new OmiseMoney(), + $this->requestHelper, ); $result = $this->builder->build(['payment' => new PaymentDataObject( diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 3c3e2dd3..ef5ac3d7 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -990,6 +990,35 @@ + + + Enable customers to pay using WeChat Pay payment method + + + Enable PayPay payment method. + Magento\Config\Model\Config\Source\Yesno + payment/omise_offsite_wechat_pay/active + + + + This controls the title which the user sees during checkout. + payment/omise_offsite_wechat_pay/title + + + + payment/omise_offsite_wechat_pay/allowspecific + Magento\Payment\Model\Config\Source\Allspecificcountries + If not set to all, guest customers will not have a billing country and may not be able to check out. + + + + payment/omise_offsite_wechat_pay/specificcountry + Magento\Directory\Model\Config\Source\Country + + 1 + + + diff --git a/etc/config.xml b/etc/config.xml index 6ce3d96e..a06a71b7 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -443,6 +443,20 @@ 1 authorize_capture + + + 0 + WeChat Pay + OmiseWeChatPayAdapter + 1 + 1 + 1 + 1 + 1 + 1 + 1 + authorize_capture + diff --git a/etc/di.xml b/etc/di.xml index ee3bdf37..13ceb0d8 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1466,6 +1466,54 @@ + + + + Omise\Payment\Model\Config\WeChatPay::CODE + Magento\Payment\Block\Form + Magento\Payment\Block\Info + OmiseAPMWeChatPayValueHandlerPool + OmiseAPMWeChatPayValidatorPool + OmiseAPMCommandPool + + + + + + + + OmiseAPMWeChatPayConfigValueHandler + + + + + + + + OmiseAPMWeChatPayCountryValidator + + + + + + + OmiseAPMWeChatPayConfig + + + + + + OmiseAPMWeChatPayConfig + + + + + + Omise\Payment\Model\Config\WeChatPay::CODE + + + + diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 5137ae90..cbf0b71c 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -110,6 +110,9 @@ true + + true + diff --git a/view/frontend/web/images/wechat_pay.svg b/view/frontend/web/images/wechat_pay.svg new file mode 100644 index 00000000..01775569 --- /dev/null +++ b/view/frontend/web/images/wechat_pay.svg @@ -0,0 +1,3 @@ + + + diff --git a/view/frontend/web/js/view/payment/method-renderer/omise-offsite-wechat-pay-method.js b/view/frontend/web/js/view/payment/method-renderer/omise-offsite-wechat-pay-method.js new file mode 100644 index 00000000..49c57006 --- /dev/null +++ b/view/frontend/web/js/view/payment/method-renderer/omise-offsite-wechat-pay-method.js @@ -0,0 +1,33 @@ +define( + [ + 'ko', + 'Omise_Payment/js/view/payment/omise-offsite-method-renderer', + 'Magento_Checkout/js/view/payment/default', + 'Magento_Checkout/js/model/quote', + ], + function ( + ko, + Base, + Component, + quote + ) { + 'use strict'; + + return Component.extend(Base).extend({ + defaults: { + template: 'Omise_Payment/payment/offsite-common-form' + }, + + isPlaceOrderActionAllowed: ko.observable(quote.billingAddress() != null), + + code: 'omise_offsite_wechat_pay', + restrictedToCurrencies: ['thb'], + logo: { + file: "images/wechat_pay.svg", + width: "30", + height: "30", + name: "wechat_pay" + } + }); + } +); From 1838599ecdb82738764d8db56e37e863cded057a Mon Sep 17 00:00:00 2001 From: Aashish Gurung <101558497+aashishgurung@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:50:55 +0700 Subject: [PATCH 4/5] Removed pointsciti and installment_citi (#476) Co-authored-by: Aashish --- Gateway/Request/APMBuilder.php | 6 --- Helper/OmiseHelper.php | 5 -- Model/Config/Installment.php | 2 - Model/Config/Pointsciti.php | 18 ------- .../APMBuilders/AlipayAPMBuilderTest.php | 2 - etc/adminhtml/system.xml | 29 ----------- etc/config.xml | 14 ------ etc/di.xml | 48 ------------------- view/frontend/layout/checkout_index_index.xml | 3 -- .../omise-offsite-pointsciti-method.js | 27 ----------- 10 files changed, 154 deletions(-) delete mode 100644 Model/Config/Pointsciti.php delete mode 100644 view/frontend/web/js/view/payment/method-renderer/omise-offsite-pointsciti-method.js diff --git a/Gateway/Request/APMBuilder.php b/Gateway/Request/APMBuilder.php index 6a8d0c2c..55b7744e 100644 --- a/Gateway/Request/APMBuilder.php +++ b/Gateway/Request/APMBuilder.php @@ -23,7 +23,6 @@ use Omise\Payment\Model\Config\Truemoney; use Omise\Payment\Model\Config\Alipayplus; use Omise\Payment\Model\Config\DuitnowOBW; -use Omise\Payment\Model\Config\Pointsciti; use Omise\Payment\Model\Config\Installment; use Omise\Payment\Model\Config\Mobilebanking; use Omise\Payment\Model\Config\Rabbitlinepay; @@ -224,11 +223,6 @@ public function build(array $buildSubject) self::SOURCE_TYPE => 'promptpay' ]; break; - case Pointsciti::CODE: - $paymentInfo[self::SOURCE] = [ - self::SOURCE_TYPE => 'points_citi' - ]; - break; case Fpx::CODE: $paymentInfo[self::SOURCE] = [ self::SOURCE_TYPE => 'fpx', diff --git a/Helper/OmiseHelper.php b/Helper/OmiseHelper.php index 88a3c45e..2fed167a 100644 --- a/Helper/OmiseHelper.php +++ b/Helper/OmiseHelper.php @@ -28,7 +28,6 @@ use Omise\Payment\Model\Config\Truemoney; use Omise\Payment\Model\Config\Alipayplus; use Omise\Payment\Model\Config\DuitnowOBW; -use Omise\Payment\Model\Config\Pointsciti; use Omise\Payment\Model\Config\CcGooglePay; use Omise\Payment\Model\Config\Installment; use Omise\Payment\Model\Config\Mobilebanking; @@ -49,7 +48,6 @@ class OmiseHelper extends AbstractHelper Internetbanking::CODE, Installment::CODE, Truemoney::CODE, - Pointsciti::CODE, Fpx::CODE, Alipayplus::ALIPAY_CODE, Alipayplus::ALIPAYHK_CODE, @@ -119,7 +117,6 @@ class OmiseHelper extends AbstractHelper Alipay::ID => Alipay::CODE, Truemoney::ID => Truemoney::CODE, Truemoney::JUMPAPP_ID => Truemoney::CODE, - Pointsciti::ID => Pointsciti::CODE, Fpx::ID => Fpx::CODE, Alipayplus::ALIPAY_ID => Alipayplus::ALIPAY_CODE, Alipayplus::ALIPAYHK_ID => Alipayplus::ALIPAYHK_CODE, @@ -148,7 +145,6 @@ class OmiseHelper extends AbstractHelper // offsite installment banking payment Installment::BAY_ID => Installment::CODE, Installment::BBL_ID => Installment::CODE, - Installment::CITI_ID => Installment::CODE, Installment::UOB_ID => Installment::CODE, Installment::FIRST_CHOICE_ID => Installment::CODE, Installment::KBANK_ID => Installment::CODE, @@ -186,7 +182,6 @@ class OmiseHelper extends AbstractHelper Internetbanking::CODE => "Internet Banking Payment", Installment::CODE => "Installment Payment", Truemoney::CODE => "TrueMoney Payment", - Pointsciti::CODE => "Citi Pay with Points", Fpx::CODE => "FPX Payment", Alipayplus::ALIPAY_CODE => "Alipay (Alipay+ Partner) Payment", Alipayplus::ALIPAYHK_CODE => "AlipayHK (Alipay+ Partner) Payment", diff --git a/Model/Config/Installment.php b/Model/Config/Installment.php index 79908737..9fc0f494 100644 --- a/Model/Config/Installment.php +++ b/Model/Config/Installment.php @@ -19,8 +19,6 @@ class Installment extends Config const BBL_ID = "installment_bbl"; - const CITI_ID = "installment_citi"; - const FIRST_CHOICE_ID = "installment_first_choice"; const KBANK_ID = "installment_kbank"; diff --git a/Model/Config/Pointsciti.php b/Model/Config/Pointsciti.php deleted file mode 100644 index 836a746c..00000000 --- a/Model/Config/Pointsciti.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - Enable customers to pay using Citi Pay with Points payment method - - - Enable Citi Pay with Points Payment Solution. - Magento\Config\Model\Config\Source\Yesno - payment/omise_offsite_pointsciti/active - - - - This controls the title which the user sees during checkout. - payment/omise_offsite_pointsciti/title - - - - payment/omise_offsite_pointsciti/allowspecific - Magento\Payment\Model\Config\Source\Allspecificcountries - If not set to all, guest customers will not have a billing country and may not be able to check out. - - - - payment/omise_offsite_pointsciti/specificcountry - Magento\Directory\Model\Config\Source\Country - - 1 - - - Enable customers to pay for products in Lotus's Stores. diff --git a/etc/config.xml b/etc/config.xml index a06a71b7..d07b5b41 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -89,20 +89,6 @@ order - - 0 - Citi Pay with Points - OmisePointscitiAdapter - 1 - 1 - 1 - 1 - 1 - 1 - 1 - authorize_capture - - 0 Installment diff --git a/etc/di.xml b/etc/di.xml index 13ceb0d8..353e2e8e 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -576,54 +576,6 @@ - - - - Omise\Payment\Model\Config\Pointsciti::CODE - Magento\Payment\Block\Form - Magento\Payment\Block\Info - OmiseAPMPointscitiValueHandlerPool - OmiseAPMPointscitiValidatorPool - OmiseAPMCommandPool - - - - - - - - OmiseAPMPointscitiConfigValueHandler - - - - - - - - OmiseAPMPointscitiCountryValidator - - - - - - - OmiseAPMPointscitiConfig - - - - - - OmiseAPMPointscitiConfig - - - - - - Omise\Payment\Model\Config\Pointsciti::CODE - - - - diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index cbf0b71c..cbcf1ec2 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -35,9 +35,6 @@ true - - true - true diff --git a/view/frontend/web/js/view/payment/method-renderer/omise-offsite-pointsciti-method.js b/view/frontend/web/js/view/payment/method-renderer/omise-offsite-pointsciti-method.js deleted file mode 100644 index 502cc9fe..00000000 --- a/view/frontend/web/js/view/payment/method-renderer/omise-offsite-pointsciti-method.js +++ /dev/null @@ -1,27 +0,0 @@ -define( - [ - 'ko', - 'Omise_Payment/js/view/payment/omise-offsite-method-renderer', - 'Magento_Checkout/js/view/payment/default', - 'Magento_Checkout/js/model/quote', - ], - function ( - ko, - Base, - Component, - quote - ) { - 'use strict'; - - return Component.extend(Base).extend({ - defaults: { - template: 'Omise_Payment/payment/offsite-pointsciti-form' - }, - - isPlaceOrderActionAllowed: ko.observable(quote.billingAddress() != null), - - code: 'omise_offsite_pointsciti', - restrictedToCurrencies: ['thb'] - }); - } -); From de074d02af16da86203394128f43e0ab3569a261 Mon Sep 17 00:00:00 2001 From: Aashish Date: Tue, 9 Apr 2024 14:40:43 +0700 Subject: [PATCH 5/5] Preparing metadata for v3.7.0 release --- 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 a26c8b5d..ed52a535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## [v3.7.0 _(Apr, 9, 2024)_](https://github.com/omise/omise-magento/releases/tag/v3.7.0) +- Added WeChat Pay (PR: [#475](https://github.com/omise/omise-magento/pull/475)) +- Removed Pay with Points and Citi installment (PR: [#476](https://github.com/omise/omise-magento/pull/476)) + ## [v3.6.1 _(Feb, 12, 2024)_](https://github.com/omise/omise-magento/releases/tag/v3.6.1) - Fixed redirect issue on cancelled card payment. (PR: [#470](https://github.com/omise/omise-magento/pull/470)) diff --git a/composer.json b/composer.json index c73076c5..5c32771e 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "email": "support@omise.co" } ], - "version": "3.6.1", + "version": "3.7.0", "minimum-stability": "stable", "type": "magento2-module", "license": "MIT", diff --git a/etc/module.xml b/etc/module.xml index d6d716d1..f9a121ac 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +