Changeset 3186329
- Timestamp:
- 11/12/2024 08:40:56 AM (17 months ago)
- Location:
- omise
- Files:
-
- 32 edited
- 1 copied
-
tags/6.0.1 (copied) (copied from omise/trunk)
-
tags/6.0.1/CHANGELOG.md (modified) (1 diff)
-
tags/6.0.1/assets/javascripts/omise-payment-form-handler.js (modified) (1 diff)
-
tags/6.0.1/includes/blocks/assets/js/build/omise_duitnow_obw.asset.php (modified) (1 diff)
-
tags/6.0.1/includes/blocks/assets/js/build/omise_duitnow_obw.js (modified) (1 diff)
-
tags/6.0.1/includes/blocks/assets/js/build/omise_installment.asset.php (modified) (1 diff)
-
tags/6.0.1/includes/blocks/assets/js/build/omise_installment.js (modified) (1 diff)
-
tags/6.0.1/includes/blocks/assets/js/omise-duitnow-obw.js (modified) (1 diff)
-
tags/6.0.1/includes/blocks/assets/js/omise-installment.js (modified) (4 diffs)
-
tags/6.0.1/includes/blocks/gateways/omise-block-duitnow-obw.php (modified) (1 diff)
-
tags/6.0.1/includes/class-omise-capabilities.php (modified) (1 diff)
-
tags/6.0.1/includes/gateway/class-omise-payment-duitnow-obw.php (modified) (3 diffs)
-
tags/6.0.1/omise-woocommerce.php (modified) (2 diffs)
-
tags/6.0.1/readme.txt (modified) (2 diffs)
-
tags/6.0.1/templates/payment/form-installment.php (modified) (1 diff)
-
tags/6.0.1/tests/unit/includes/blocks/gateways/traits/mock-gateways.php (modified) (1 diff)
-
tags/6.0.1/tests/unit/includes/gateway/class-omise-payment-duitnow-obw-test.php (modified) (3 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/assets/javascripts/omise-payment-form-handler.js (modified) (1 diff)
-
trunk/includes/blocks/assets/js/build/omise_duitnow_obw.asset.php (modified) (1 diff)
-
trunk/includes/blocks/assets/js/build/omise_duitnow_obw.js (modified) (1 diff)
-
trunk/includes/blocks/assets/js/build/omise_installment.asset.php (modified) (1 diff)
-
trunk/includes/blocks/assets/js/build/omise_installment.js (modified) (1 diff)
-
trunk/includes/blocks/assets/js/omise-duitnow-obw.js (modified) (1 diff)
-
trunk/includes/blocks/assets/js/omise-installment.js (modified) (4 diffs)
-
trunk/includes/blocks/gateways/omise-block-duitnow-obw.php (modified) (1 diff)
-
trunk/includes/class-omise-capabilities.php (modified) (1 diff)
-
trunk/includes/gateway/class-omise-payment-duitnow-obw.php (modified) (3 diffs)
-
trunk/omise-woocommerce.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates/payment/form-installment.php (modified) (1 diff)
-
trunk/tests/unit/includes/blocks/gateways/traits/mock-gateways.php (modified) (1 diff)
-
trunk/tests/unit/includes/gateway/class-omise-payment-duitnow-obw-test.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
omise/tags/6.0.1/CHANGELOG.md
r3182037 r3186329 1 1 # CHANGELOG 2 3 ## [v6.0.1 _(Nov 12, 2024)_](https://github.com/omise/omise-woocommerce/releases/tag/v6.0.1) 4 - Resolve issue of payment failing on installment when total amount is updated after selecting payment. (PR: [#485](https://github.com/omise/omise-woocommerce/pull/485)) 5 - Fix Duitnow bank list issue. (PR: [#486](https://github.com/omise/omise-woocommerce/pull/486)) 6 - Resolve the issue where no payment methods are displayed when the browser's back button is clicked from an issuer page. (PR: [#487](https://github.com/omise/omise-woocommerce/pull/487)) 2 7 3 8 ## [v6.0.0 _(Nov 5, 2024)_](https://github.com/omise/omise-woocommerce/releases/tag/v6.0.0) -
omise/tags/6.0.1/assets/javascripts/omise-payment-form-handler.js
r3182037 r3186329 258 258 element: omiseInstallmentElement, 259 259 publicKey: omise_installment_params.key, 260 amount: omise_installment_params.amount,260 amount: OMISE_UPDATED_CART_AMOUNT, 261 261 locale: LOCALE, 262 262 onSuccess: handleCreateOrder, -
omise/tags/6.0.1/includes/blocks/assets/js/build/omise_duitnow_obw.asset.php
r3182037 r3186329 1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' 9895ac689bce188c4a74717ce7c149c5');1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'b1a7ad893b10317f131d580cebf99812'); -
omise/tags/6.0.1/includes/blocks/assets/js/build/omise_duitnow_obw.js
r3182037 r3186329 1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=(window.wp.i18n,window.wp.htmlEntities),a=window.wc.wcBlocksRegistry,s=(0,window.wc.wcSettings.getSetting)("omise_duitnow_obw_data",{}),l=(0,n.decodeEntities)(s.title)||"No title set",o=a=>{const{eventRegistration:l,emitResponse:o}=a,{onPaymentSetup:c}=l,r=(0,n.decodeEntities)(s.description||""),{banks:i}=s.data,[m,p]=(0,t.useState)(null);return(0,t.useEffect)((()=>{const e=c((async()=>{if(!m)return{type:o.responseTypes.ERROR,message:"Select a bank"};try{return{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{bank:m}}}}catch(e){return{type:o.responseTypes.ERROR,message:e.message}}}));return()=>e()}),[o.responseTypes.ERROR,o.responseTypes.SUCCESS,c,m]),(0,e.createElement)(e.Fragment,null,r&&(0,e.createElement)("p",null,r),(0,e.createElement)("fieldset",{id:"omise-form-installment"},(0,e.createElement)("div",{className:"fpx-select-bank"},(0,e.createElement)("label",{htmlFor:"fpx-select-bank"},"Select Bank"),(0,e.createElement)("select",{className:"fpx-bank-logo default",id:"duitnow-obw-select-bank",name:"source[bank]",defaultValue:"",onChange:e=>{p(e.target.value)}},(0,e.createElement)("option",{value:"",disabled:!0},"-- Select your option --"), i.map((t=>(0,e.createElement)("option",{key:t.code,className:t.code,value:t.code},t.name)))))))};(0,a.registerPaymentMethod)({name:s.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:l})}),null),content:(0,e.createElement)(o,null),edit:(0,e.createElement)(o,null),canMakePayment:()=>s.is_active,ariaLabel:l,supports:{features:s.supports}})})();1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=(window.wp.i18n,window.wp.htmlEntities),a=window.wc.wcBlocksRegistry,s=(0,window.wc.wcSettings.getSetting)("omise_duitnow_obw_data",{}),l=(0,n.decodeEntities)(s.title)||"No title set",o=a=>{const{eventRegistration:l,emitResponse:o}=a,{onPaymentSetup:c}=l,r=(0,n.decodeEntities)(s.description||""),{banks:i}=s.data,[m,p]=(0,t.useState)(null);return(0,t.useEffect)((()=>{const e=c((async()=>{if(!m)return{type:o.responseTypes.ERROR,message:"Select a bank"};try{return{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{bank:m}}}}catch(e){return{type:o.responseTypes.ERROR,message:e.message}}}));return()=>e()}),[o.responseTypes.ERROR,o.responseTypes.SUCCESS,c,m]),(0,e.createElement)(e.Fragment,null,r&&(0,e.createElement)("p",null,r),(0,e.createElement)("fieldset",{id:"omise-form-installment"},(0,e.createElement)("div",{className:"fpx-select-bank"},(0,e.createElement)("label",{htmlFor:"fpx-select-bank"},"Select Bank"),(0,e.createElement)("select",{className:"fpx-bank-logo default",id:"duitnow-obw-select-bank",name:"source[bank]",defaultValue:"",onChange:e=>{p(e.target.value)}},(0,e.createElement)("option",{value:"",disabled:!0},"-- Select your option --"),Object.values(i).map((t=>(0,e.createElement)("option",{key:t.code,className:t.code,value:t.code},t.name)))))))};(0,a.registerPaymentMethod)({name:s.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:l})}),null),content:(0,e.createElement)(o,null),edit:(0,e.createElement)(o,null),canMakePayment:()=>s.is_active,ariaLabel:l,supports:{features:s.supports}})})(); -
omise/tags/6.0.1/includes/blocks/assets/js/build/omise_installment.asset.php
r3182037 r3186329 1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' c95a8877d63c5c3bb2fda93273b0a81a');1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'e2436da6ade36f0dc6835eb771337040'); -
omise/tags/6.0.1/includes/blocks/assets/js/build/omise_installment.js
r3182037 r3186329 1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=window.wp.i18n, s=window.wp.htmlEntities,a=window.wc.wcBlocksRegistry,l=(0,window.wc.wcSettings.getSetting)("omise_installment_data",{}),o=(0,s.decodeEntities)(l.title)||"No title set",r=a=>{const{eventRegistration:o,emitResponse:r}=a,{onPaymentSetup:c,onCheckoutValidation:i,onCheckoutFail:m}=o,u=(0,s.decodeEntities)(l.description||""),{installments_enabled:d,total_amount:w,public_key:p}=l.data,E=(0,n.__)("Purchase Amount is lower than the monthly minimum payment amount.","omise"),y=(0,t.useRef)(null),f=(0,t.useRef)(null),h=(0,t.useRef)(null),R=()=>{if(d){let e=l.locale.toLowerCase();e=["en","th","ja"].includes(e)?e:"en",showOmiseInstallmentForm({element:y.current,publicKey:p,amount:w,locale:e,onSuccess:e=>{f.current=e},onError:e=>{h.current=e}})}};return(0,t.useEffect)((()=>{R()}),[d]),(0,t.useEffect)((()=>i((()=>(OmiseCard.requestCardToken(),!0)))),[i]),(0,t.useEffect)((()=>m((()=>(f.current=null,R(),!0)))),[m]),(0,t.useEffect)((()=>{const e=c((async()=>await new Promise(((e,t)=>{const n=setInterval((()=>{if(f.current){clearInterval(n);try{const t={type:r.responseTypes.SUCCESS,meta:{paymentMethodData:{omise_source:f.current.source,omise_token:f.current.token}}};e(t)}catch(e){clearInterval(n);const s={type:r.responseTypes.ERROR,message:e.message};t(s)}}}),1e3)}))));return()=>e()}),[c]),(0,e.createElement)(e.Fragment,null,u&&(0,e.createElement)("p",null,u),d?(0,e.createElement)("div",{ref:y,id:"omise-installment",style:{width:"100%",maxWidth:"400px"}}):(0,e.createElement)("p",null,E))};(0,a.registerPaymentMethod)({name:l.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:o})}),null),content:(0,e.createElement)(r,null),edit:(0,e.createElement)(r,null),canMakePayment:()=>l.is_active,ariaLabel:o,supports:{features:l.supports}})})();1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=window.wp.i18n,a=window.wp.htmlEntities,s=window.wc.wcBlocksRegistry,r=(0,window.wc.wcSettings.getSetting)("omise_installment_data",{}),l=(0,a.decodeEntities)(r.title)||"No title set",{select:o,subscribe:c}=window.wp.data,i=window.wc.wcBlocksData.CART_STORE_KEY,u=s=>{const{eventRegistration:l,emitResponse:u}=s,{onPaymentSetup:m,onCheckoutValidation:w,onCheckoutFail:d}=l,p=(0,a.decodeEntities)(r.description||""),{installments_enabled:E,total_amount:f,public_key:y}=r.data,h=(0,n.__)("Purchase Amount is lower than the monthly minimum payment amount.","omise"),_=(0,t.useRef)(null),R=(0,t.useRef)(null),g=(0,t.useRef)(null),C=(0,t.useRef)(null),k=()=>{if(E){const e=o(i).getCartData();C.current=e.totals.total_price;let t=r.locale.toLowerCase();t=["en","th","ja"].includes(t)?t:"en",_.current.innerHTML="",showOmiseInstallmentForm({element:_.current,publicKey:y,amount:C.current,locale:t,onSuccess:e=>{R.current=e},onError:e=>{g.current=e}})}},b=()=>{const e=o(i).getCartData();C.current=e.totals.total_price,k()};return(0,t.useEffect)((()=>c(b,i)),[i]),(0,t.useEffect)((()=>{k()}),[E]),(0,t.useEffect)((()=>w((()=>(OmiseCard.requestCardToken(),!0)))),[w]),(0,t.useEffect)((()=>d((()=>(R.current=null,k(),!0)))),[d]),(0,t.useEffect)((()=>{const e=m((async()=>await new Promise(((e,t)=>{const n=setInterval((()=>{if(R.current){clearInterval(n);try{const t={type:u.responseTypes.SUCCESS,meta:{paymentMethodData:{omise_source:R.current.source,omise_token:R.current.token}}};e(t)}catch(e){clearInterval(n);const a={type:u.responseTypes.ERROR,message:e.message};t(a)}}}),1e3)}))));return()=>e()}),[m]),(0,e.createElement)(e.Fragment,null,p&&(0,e.createElement)("p",null,p),E?(0,e.createElement)("div",{ref:_,id:"omise-installment",style:{width:"100%",maxWidth:"400px"}}):(0,e.createElement)("p",null,h))};(0,s.registerPaymentMethod)({name:r.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:l})}),null),content:(0,e.createElement)(u,null),edit:(0,e.createElement)(u,null),canMakePayment:()=>r.is_active,ariaLabel:l,supports:{features:r.supports}})})(); -
omise/tags/6.0.1/includes/blocks/assets/js/omise-duitnow-obw.js
r3182037 r3186329 64 64 <option value="" disabled={true}>-- Select your option --</option> 65 65 { 66 banks.map((bank) => (66 Object.values(banks).map((bank) => ( 67 67 <option 68 68 key={bank['code']} -
omise/tags/6.0.1/includes/blocks/assets/js/omise-installment.js
r3182037 r3186329 1 import {useEffect, useRef } from '@wordpress/element';1 import {useEffect, useRef, useState} from '@wordpress/element'; 2 2 import { __ } from '@wordpress/i18n'; 3 3 import { decodeEntities } from '@wordpress/html-entities'; … … 12 12 } 13 13 14 const {select, subscribe} = window.wp.data; 15 const cartStoreKey = window.wc.wcBlocksData.CART_STORE_KEY; 16 14 17 const InstallmentPaymentMethod = (props) => { 15 18 const {eventRegistration, emitResponse} = props; … … 21 24 const wlbInstallmentRef = useRef(null); 22 25 const cardFormErrors = useRef(null); 26 const totalAmount = useRef(null); 23 27 24 28 const loadInstallmentForm = () => { 25 29 if (installments_enabled) { 30 // Getting the new total price that might be updated when shipping method 31 // was updated while other payment method was selected 32 const cart = select( cartStoreKey ).getCartData(); 33 totalAmount.current = cart.totals.total_price 34 26 35 let locale = settings.locale.toLowerCase(); 27 36 let supportedLocales = ['en', 'th', 'ja']; 28 37 locale = supportedLocales.includes(locale) ? locale : 'en'; 29 38 39 // removing previous iframe if there is any 40 el.current.innerHTML = ""; 41 30 42 showOmiseInstallmentForm({ 31 43 element: el.current, 32 44 publicKey: public_key, 33 amount: total _amount,45 amount: totalAmount.current, 34 46 locale, 35 47 onSuccess: (payload) => { … … 42 54 } 43 55 } 56 57 // Update total amount on cart update. We need this to send the update amount to the source API 58 const onCartChange = () => { 59 const cart = select( cartStoreKey ).getCartData(); 60 totalAmount.current = cart.totals.total_price; 61 loadInstallmentForm() 62 } 63 64 useEffect(() => { 65 const unsubscribe = subscribe( onCartChange, cartStoreKey ); 66 return unsubscribe; 67 }, [cartStoreKey]) 44 68 45 69 useEffect(() => { -
omise/tags/6.0.1/includes/blocks/gateways/omise-block-duitnow-obw.php
r3182037 r3186329 10 10 11 11 public function set_additional_data() { 12 if (!$this->gateway->backend) { 13 $this->gateway->init_payment_config(); 14 } 15 16 $this->additional_data = [ 'banks' => $this->gateway->backend->banks ]; 12 $this->additional_data = [ 'banks' => $this->gateway->get_bank_list() ]; 17 13 } 18 14 } -
omise/tags/6.0.1/includes/class-omise-capabilities.php
r3182037 r3186329 99 99 } 100 100 101 $endpoints = ['checkout', 'batch' ];101 $endpoints = ['checkout', 'batch', 'cart', 'cart/select-shipping-rate']; 102 102 103 103 foreach($endpoints as $endpoint) { -
omise/tags/6.0.1/includes/gateway/class-omise-payment-duitnow-obw.php
r3182037 r3186329 21 21 $this->restricted_countries = array('MY'); 22 22 $this->source_type = 'duitnow_obw'; 23 24 $this->init_payment_config();25 23 26 24 add_action('woocommerce_api_' . $this->id . '_callback', 'Omise_Callback::execute'); … … 59 57 } 60 58 61 public function init_payment_config() { 62 $capabilities = Omise_Capabilities::retrieve(); 63 $this->backend = $capabilities 64 ? $capabilities->getBackendByType($this->source_type) 65 : null; 59 public function get_bank_list() 60 { 61 return [ 62 'affin' => [ 63 'code' => 'affin', 64 'name' => 'Affin Bank' 65 ], 66 'alliance' => [ 67 'code' => 'alliance', 68 'name' => 'Alliance Bank' 69 ], 70 'agro' => [ 71 'code' => 'agro', 72 'name' => 'Agrobank' 73 ], 74 'ambank' => [ 75 'code' => 'ambank', 76 'name' => 'AmBank' 77 ], 78 'cimb' => [ 79 'code' => 'cimb', 80 'name' => 'CIMB Bank' 81 ], 82 'islam' => [ 83 'code' => 'islam', 84 'name' => 'Bank Islam' 85 ], 86 'rakyat' => [ 87 'code' => 'rakyat', 88 'name' => 'Bank Rakyat' 89 ], 90 'muamalat' => [ 91 'code' => 'muamalat', 92 'name' => 'Bank Muamalat' 93 ], 94 'bsn' => [ 95 'code' => 'bsn', 96 'name' => 'Bank Simpanan Nasional' 97 ], 98 'hongleong' => [ 99 'code' => 'hongleong', 100 'name' => 'Hong Leong' 101 ], 102 'hsbc' => [ 103 'code' => 'hsbc', 104 'name' => 'HSBC Bank' 105 ], 106 'kfh' => [ 107 'code' => 'kfh', 108 'name' => 'Kuwait Finance House' 109 ], 110 'maybank2u' => [ 111 'code' => 'maybank2u', 112 'name' => 'Maybank' 113 ], 114 'ocbc' => [ 115 'code' => 'ocbc', 116 'name' => 'OCBC' 117 ], 118 'public' => [ 119 'code' => 'public', 120 'name' => 'Public Bank' 121 ], 122 'rhb' => [ 123 'code' => 'rhb', 124 'name' => 'RHB Bank' 125 ], 126 'sc' => [ 127 'code' => 'sc', 128 'name' => 'Standard Chartered' 129 ], 130 'uob' => [ 131 'code' => 'uob', 132 'name' => 'United Overseas Bank' 133 ], 134 ]; 66 135 } 67 136 … … 74 143 Omise_Util::render_view( 75 144 'templates/payment/form-duitnow-obw.php', 76 [ 'duitnow_obw_banklist' => !$this->backend ? $this->backend->banks : []]145 [ 'duitnow_obw_banklist' => $this->get_bank_list() ] 77 146 ); 78 147 } -
omise/tags/6.0.1/omise-woocommerce.php
r3182037 r3186329 5 5 * Plugin URI: https://www.omise.co/woocommerce 6 6 * Description: Opn Payments is a WordPress plugin designed specifically for WooCommerce. The plugin adds support for Opn Payments Payment Gateway's payment methods to WooCommerce. 7 * Version: 6.0. 07 * Version: 6.0.1 8 8 * Author: Opn Payments and contributors 9 9 * Author URI: https://github.com/omise/omise-woocommerce/graphs/contributors … … 24 24 * @var string 25 25 */ 26 public $version = '6.0. 0';26 public $version = '6.0.1'; 27 27 28 28 /** -
omise/tags/6.0.1/readme.txt
r3182037 r3186329 4 4 Requires at least: 4.3.1 5 5 Tested up to: 6.6.2 6 Stable tag: 6.0. 06 Stable tag: 6.0.1 7 7 License: MIT 8 8 License URI: https://opensource.org/licenses/MIT … … 34 34 35 35 == Changelog == 36 37 = 6.0.1 = 38 39 - Resolve issue of payment failing on installment when total amount is updated after selecting payment. (PR: [#485](https://github.com/omise/omise-woocommerce/pull/485)) 40 - Fix Duitnow bank list issue. (PR: [#486](https://github.com/omise/omise-woocommerce/pull/486)) 41 - Resolve the issue where no payment methods are displayed when the browser's back button is clicked from an issuer page. (PR: [#487](https://github.com/omise/omise-woocommerce/pull/487)) 36 42 37 43 = 6.0.0 = -
omise/tags/6.0.1/templates/payment/form-installment.php
r3182037 r3186329 4 4 <div id="omise-installment" style="width:100%; max-width: 400px;"></div> 5 5 <script> 6 window.OMISE_UPDATED_CART_AMOUNT= `<?php echo $viewData['total_amount']; ?>`; 6 7 window.LOCALE = `<?php echo get_locale(); ?>`; 7 8 window.OMISE_CUSTOM_FONT_OTHER = 'Other'; -
omise/tags/6.0.1/tests/unit/includes/blocks/gateways/traits/mock-gateways.php
r3182037 r3186329 51 51 ]; 52 52 } 53 54 public function get_bank_list() { 55 return [ 56 'bank1', 57 'bank2', 58 ]; 59 } 53 60 }; 54 61 -
omise/tags/6.0.1/tests/unit/includes/gateway/class-omise-payment-duitnow-obw-test.php
r3182037 r3186329 7 7 class Omise_Payment_DuitNow_OBW_Test extends Omise_Offsite_Test 8 8 { 9 private $omise_capability_mock;10 11 9 public function setUp(): void 12 10 { … … 14 12 parent::setUp(); 15 13 Monkey\Functions\expect('add_action'); 16 $this->omise_capability_mock = Mockery::mock('alias:Omise_Capabilities');17 14 require_once __DIR__ . '/../../../../includes/gateway/class-omise-payment-duitnow-obw.php'; 18 15 } … … 26 23 } 27 24 28 $this->omise_capability_mock->shouldReceive('retrieve')->once();29 25 $_POST['source'] = ['bank' => 'SCB']; 30 26 $obj = new Omise_Payment_DuitNow_OBW(); 31 27 $this->getChargeTest($obj); 32 28 } 29 30 public function testGetBankList() 31 { 32 $expected = [ 33 'affin' => [ 34 'code' => 'affin', 35 'name' => 'Affin Bank' 36 ], 37 'alliance' => [ 38 'code' => 'alliance', 39 'name' => 'Alliance Bank' 40 ], 41 'agro' => [ 42 'code' => 'agro', 43 'name' => 'Agrobank' 44 ], 45 'ambank' => [ 46 'code' => 'ambank', 47 'name' => 'AmBank' 48 ], 49 'cimb' => [ 50 'code' => 'cimb', 51 'name' => 'CIMB Bank' 52 ], 53 'islam' => [ 54 'code' => 'islam', 55 'name' => 'Bank Islam' 56 ], 57 'rakyat' => [ 58 'code' => 'rakyat', 59 'name' => 'Bank Rakyat' 60 ], 61 'muamalat' => [ 62 'code' => 'muamalat', 63 'name' => 'Bank Muamalat' 64 ], 65 'bsn' => [ 66 'code' => 'bsn', 67 'name' => 'Bank Simpanan Nasional' 68 ], 69 'hongleong' => [ 70 'code' => 'hongleong', 71 'name' => 'Hong Leong' 72 ], 73 'hsbc' => [ 74 'code' => 'hsbc', 75 'name' => 'HSBC Bank' 76 ], 77 'kfh' => [ 78 'code' => 'kfh', 79 'name' => 'Kuwait Finance House' 80 ], 81 'maybank2u' => [ 82 'code' => 'maybank2u', 83 'name' => 'Maybank' 84 ], 85 'ocbc' => [ 86 'code' => 'ocbc', 87 'name' => 'OCBC' 88 ], 89 'public' => [ 90 'code' => 'public', 91 'name' => 'Public Bank' 92 ], 93 'rhb' => [ 94 'code' => 'rhb', 95 'name' => 'RHB Bank' 96 ], 97 'sc' => [ 98 'code' => 'sc', 99 'name' => 'Standard Chartered' 100 ], 101 'uob' => [ 102 'code' => 'uob', 103 'name' => 'United Overseas Bank' 104 ], 105 ]; 106 $obj = new Omise_Payment_DuitNow_OBW(); 107 $bankList = $obj->get_bank_list(); 108 $this->assertEquals($expected, $bankList); 109 } 33 110 } -
omise/trunk/CHANGELOG.md
r3182037 r3186329 1 1 # CHANGELOG 2 3 ## [v6.0.1 _(Nov 12, 2024)_](https://github.com/omise/omise-woocommerce/releases/tag/v6.0.1) 4 - Resolve issue of payment failing on installment when total amount is updated after selecting payment. (PR: [#485](https://github.com/omise/omise-woocommerce/pull/485)) 5 - Fix Duitnow bank list issue. (PR: [#486](https://github.com/omise/omise-woocommerce/pull/486)) 6 - Resolve the issue where no payment methods are displayed when the browser's back button is clicked from an issuer page. (PR: [#487](https://github.com/omise/omise-woocommerce/pull/487)) 2 7 3 8 ## [v6.0.0 _(Nov 5, 2024)_](https://github.com/omise/omise-woocommerce/releases/tag/v6.0.0) -
omise/trunk/assets/javascripts/omise-payment-form-handler.js
r3182037 r3186329 258 258 element: omiseInstallmentElement, 259 259 publicKey: omise_installment_params.key, 260 amount: omise_installment_params.amount,260 amount: OMISE_UPDATED_CART_AMOUNT, 261 261 locale: LOCALE, 262 262 onSuccess: handleCreateOrder, -
omise/trunk/includes/blocks/assets/js/build/omise_duitnow_obw.asset.php
r3182037 r3186329 1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' 9895ac689bce188c4a74717ce7c149c5');1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'b1a7ad893b10317f131d580cebf99812'); -
omise/trunk/includes/blocks/assets/js/build/omise_duitnow_obw.js
r3182037 r3186329 1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=(window.wp.i18n,window.wp.htmlEntities),a=window.wc.wcBlocksRegistry,s=(0,window.wc.wcSettings.getSetting)("omise_duitnow_obw_data",{}),l=(0,n.decodeEntities)(s.title)||"No title set",o=a=>{const{eventRegistration:l,emitResponse:o}=a,{onPaymentSetup:c}=l,r=(0,n.decodeEntities)(s.description||""),{banks:i}=s.data,[m,p]=(0,t.useState)(null);return(0,t.useEffect)((()=>{const e=c((async()=>{if(!m)return{type:o.responseTypes.ERROR,message:"Select a bank"};try{return{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{bank:m}}}}catch(e){return{type:o.responseTypes.ERROR,message:e.message}}}));return()=>e()}),[o.responseTypes.ERROR,o.responseTypes.SUCCESS,c,m]),(0,e.createElement)(e.Fragment,null,r&&(0,e.createElement)("p",null,r),(0,e.createElement)("fieldset",{id:"omise-form-installment"},(0,e.createElement)("div",{className:"fpx-select-bank"},(0,e.createElement)("label",{htmlFor:"fpx-select-bank"},"Select Bank"),(0,e.createElement)("select",{className:"fpx-bank-logo default",id:"duitnow-obw-select-bank",name:"source[bank]",defaultValue:"",onChange:e=>{p(e.target.value)}},(0,e.createElement)("option",{value:"",disabled:!0},"-- Select your option --"), i.map((t=>(0,e.createElement)("option",{key:t.code,className:t.code,value:t.code},t.name)))))))};(0,a.registerPaymentMethod)({name:s.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:l})}),null),content:(0,e.createElement)(o,null),edit:(0,e.createElement)(o,null),canMakePayment:()=>s.is_active,ariaLabel:l,supports:{features:s.supports}})})();1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=(window.wp.i18n,window.wp.htmlEntities),a=window.wc.wcBlocksRegistry,s=(0,window.wc.wcSettings.getSetting)("omise_duitnow_obw_data",{}),l=(0,n.decodeEntities)(s.title)||"No title set",o=a=>{const{eventRegistration:l,emitResponse:o}=a,{onPaymentSetup:c}=l,r=(0,n.decodeEntities)(s.description||""),{banks:i}=s.data,[m,p]=(0,t.useState)(null);return(0,t.useEffect)((()=>{const e=c((async()=>{if(!m)return{type:o.responseTypes.ERROR,message:"Select a bank"};try{return{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{bank:m}}}}catch(e){return{type:o.responseTypes.ERROR,message:e.message}}}));return()=>e()}),[o.responseTypes.ERROR,o.responseTypes.SUCCESS,c,m]),(0,e.createElement)(e.Fragment,null,r&&(0,e.createElement)("p",null,r),(0,e.createElement)("fieldset",{id:"omise-form-installment"},(0,e.createElement)("div",{className:"fpx-select-bank"},(0,e.createElement)("label",{htmlFor:"fpx-select-bank"},"Select Bank"),(0,e.createElement)("select",{className:"fpx-bank-logo default",id:"duitnow-obw-select-bank",name:"source[bank]",defaultValue:"",onChange:e=>{p(e.target.value)}},(0,e.createElement)("option",{value:"",disabled:!0},"-- Select your option --"),Object.values(i).map((t=>(0,e.createElement)("option",{key:t.code,className:t.code,value:t.code},t.name)))))))};(0,a.registerPaymentMethod)({name:s.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:l})}),null),content:(0,e.createElement)(o,null),edit:(0,e.createElement)(o,null),canMakePayment:()=>s.is_active,ariaLabel:l,supports:{features:s.supports}})})(); -
omise/trunk/includes/blocks/assets/js/build/omise_installment.asset.php
r3182037 r3186329 1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' c95a8877d63c5c3bb2fda93273b0a81a');1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'e2436da6ade36f0dc6835eb771337040'); -
omise/trunk/includes/blocks/assets/js/build/omise_installment.js
r3182037 r3186329 1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=window.wp.i18n, s=window.wp.htmlEntities,a=window.wc.wcBlocksRegistry,l=(0,window.wc.wcSettings.getSetting)("omise_installment_data",{}),o=(0,s.decodeEntities)(l.title)||"No title set",r=a=>{const{eventRegistration:o,emitResponse:r}=a,{onPaymentSetup:c,onCheckoutValidation:i,onCheckoutFail:m}=o,u=(0,s.decodeEntities)(l.description||""),{installments_enabled:d,total_amount:w,public_key:p}=l.data,E=(0,n.__)("Purchase Amount is lower than the monthly minimum payment amount.","omise"),y=(0,t.useRef)(null),f=(0,t.useRef)(null),h=(0,t.useRef)(null),R=()=>{if(d){let e=l.locale.toLowerCase();e=["en","th","ja"].includes(e)?e:"en",showOmiseInstallmentForm({element:y.current,publicKey:p,amount:w,locale:e,onSuccess:e=>{f.current=e},onError:e=>{h.current=e}})}};return(0,t.useEffect)((()=>{R()}),[d]),(0,t.useEffect)((()=>i((()=>(OmiseCard.requestCardToken(),!0)))),[i]),(0,t.useEffect)((()=>m((()=>(f.current=null,R(),!0)))),[m]),(0,t.useEffect)((()=>{const e=c((async()=>await new Promise(((e,t)=>{const n=setInterval((()=>{if(f.current){clearInterval(n);try{const t={type:r.responseTypes.SUCCESS,meta:{paymentMethodData:{omise_source:f.current.source,omise_token:f.current.token}}};e(t)}catch(e){clearInterval(n);const s={type:r.responseTypes.ERROR,message:e.message};t(s)}}}),1e3)}))));return()=>e()}),[c]),(0,e.createElement)(e.Fragment,null,u&&(0,e.createElement)("p",null,u),d?(0,e.createElement)("div",{ref:y,id:"omise-installment",style:{width:"100%",maxWidth:"400px"}}):(0,e.createElement)("p",null,E))};(0,a.registerPaymentMethod)({name:l.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:o})}),null),content:(0,e.createElement)(r,null),edit:(0,e.createElement)(r,null),canMakePayment:()=>l.is_active,ariaLabel:o,supports:{features:l.supports}})})();1 (()=>{"use strict";const e=window.React,t=window.wp.element,n=window.wp.i18n,a=window.wp.htmlEntities,s=window.wc.wcBlocksRegistry,r=(0,window.wc.wcSettings.getSetting)("omise_installment_data",{}),l=(0,a.decodeEntities)(r.title)||"No title set",{select:o,subscribe:c}=window.wp.data,i=window.wc.wcBlocksData.CART_STORE_KEY,u=s=>{const{eventRegistration:l,emitResponse:u}=s,{onPaymentSetup:m,onCheckoutValidation:w,onCheckoutFail:d}=l,p=(0,a.decodeEntities)(r.description||""),{installments_enabled:E,total_amount:f,public_key:y}=r.data,h=(0,n.__)("Purchase Amount is lower than the monthly minimum payment amount.","omise"),_=(0,t.useRef)(null),R=(0,t.useRef)(null),g=(0,t.useRef)(null),C=(0,t.useRef)(null),k=()=>{if(E){const e=o(i).getCartData();C.current=e.totals.total_price;let t=r.locale.toLowerCase();t=["en","th","ja"].includes(t)?t:"en",_.current.innerHTML="",showOmiseInstallmentForm({element:_.current,publicKey:y,amount:C.current,locale:t,onSuccess:e=>{R.current=e},onError:e=>{g.current=e}})}},b=()=>{const e=o(i).getCartData();C.current=e.totals.total_price,k()};return(0,t.useEffect)((()=>c(b,i)),[i]),(0,t.useEffect)((()=>{k()}),[E]),(0,t.useEffect)((()=>w((()=>(OmiseCard.requestCardToken(),!0)))),[w]),(0,t.useEffect)((()=>d((()=>(R.current=null,k(),!0)))),[d]),(0,t.useEffect)((()=>{const e=m((async()=>await new Promise(((e,t)=>{const n=setInterval((()=>{if(R.current){clearInterval(n);try{const t={type:u.responseTypes.SUCCESS,meta:{paymentMethodData:{omise_source:R.current.source,omise_token:R.current.token}}};e(t)}catch(e){clearInterval(n);const a={type:u.responseTypes.ERROR,message:e.message};t(a)}}}),1e3)}))));return()=>e()}),[m]),(0,e.createElement)(e.Fragment,null,p&&(0,e.createElement)("p",null,p),E?(0,e.createElement)("div",{ref:_,id:"omise-installment",style:{width:"100%",maxWidth:"400px"}}):(0,e.createElement)("p",null,h))};(0,s.registerPaymentMethod)({name:r.name||"",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:n}=t.components;return(0,e.createElement)(n,{text:l})}),null),content:(0,e.createElement)(u,null),edit:(0,e.createElement)(u,null),canMakePayment:()=>r.is_active,ariaLabel:l,supports:{features:r.supports}})})(); -
omise/trunk/includes/blocks/assets/js/omise-duitnow-obw.js
r3182037 r3186329 64 64 <option value="" disabled={true}>-- Select your option --</option> 65 65 { 66 banks.map((bank) => (66 Object.values(banks).map((bank) => ( 67 67 <option 68 68 key={bank['code']} -
omise/trunk/includes/blocks/assets/js/omise-installment.js
r3182037 r3186329 1 import {useEffect, useRef } from '@wordpress/element';1 import {useEffect, useRef, useState} from '@wordpress/element'; 2 2 import { __ } from '@wordpress/i18n'; 3 3 import { decodeEntities } from '@wordpress/html-entities'; … … 12 12 } 13 13 14 const {select, subscribe} = window.wp.data; 15 const cartStoreKey = window.wc.wcBlocksData.CART_STORE_KEY; 16 14 17 const InstallmentPaymentMethod = (props) => { 15 18 const {eventRegistration, emitResponse} = props; … … 21 24 const wlbInstallmentRef = useRef(null); 22 25 const cardFormErrors = useRef(null); 26 const totalAmount = useRef(null); 23 27 24 28 const loadInstallmentForm = () => { 25 29 if (installments_enabled) { 30 // Getting the new total price that might be updated when shipping method 31 // was updated while other payment method was selected 32 const cart = select( cartStoreKey ).getCartData(); 33 totalAmount.current = cart.totals.total_price 34 26 35 let locale = settings.locale.toLowerCase(); 27 36 let supportedLocales = ['en', 'th', 'ja']; 28 37 locale = supportedLocales.includes(locale) ? locale : 'en'; 29 38 39 // removing previous iframe if there is any 40 el.current.innerHTML = ""; 41 30 42 showOmiseInstallmentForm({ 31 43 element: el.current, 32 44 publicKey: public_key, 33 amount: total _amount,45 amount: totalAmount.current, 34 46 locale, 35 47 onSuccess: (payload) => { … … 42 54 } 43 55 } 56 57 // Update total amount on cart update. We need this to send the update amount to the source API 58 const onCartChange = () => { 59 const cart = select( cartStoreKey ).getCartData(); 60 totalAmount.current = cart.totals.total_price; 61 loadInstallmentForm() 62 } 63 64 useEffect(() => { 65 const unsubscribe = subscribe( onCartChange, cartStoreKey ); 66 return unsubscribe; 67 }, [cartStoreKey]) 44 68 45 69 useEffect(() => { -
omise/trunk/includes/blocks/gateways/omise-block-duitnow-obw.php
r3182037 r3186329 10 10 11 11 public function set_additional_data() { 12 if (!$this->gateway->backend) { 13 $this->gateway->init_payment_config(); 14 } 15 16 $this->additional_data = [ 'banks' => $this->gateway->backend->banks ]; 12 $this->additional_data = [ 'banks' => $this->gateway->get_bank_list() ]; 17 13 } 18 14 } -
omise/trunk/includes/class-omise-capabilities.php
r3182037 r3186329 99 99 } 100 100 101 $endpoints = ['checkout', 'batch' ];101 $endpoints = ['checkout', 'batch', 'cart', 'cart/select-shipping-rate']; 102 102 103 103 foreach($endpoints as $endpoint) { -
omise/trunk/includes/gateway/class-omise-payment-duitnow-obw.php
r3182037 r3186329 21 21 $this->restricted_countries = array('MY'); 22 22 $this->source_type = 'duitnow_obw'; 23 24 $this->init_payment_config();25 23 26 24 add_action('woocommerce_api_' . $this->id . '_callback', 'Omise_Callback::execute'); … … 59 57 } 60 58 61 public function init_payment_config() { 62 $capabilities = Omise_Capabilities::retrieve(); 63 $this->backend = $capabilities 64 ? $capabilities->getBackendByType($this->source_type) 65 : null; 59 public function get_bank_list() 60 { 61 return [ 62 'affin' => [ 63 'code' => 'affin', 64 'name' => 'Affin Bank' 65 ], 66 'alliance' => [ 67 'code' => 'alliance', 68 'name' => 'Alliance Bank' 69 ], 70 'agro' => [ 71 'code' => 'agro', 72 'name' => 'Agrobank' 73 ], 74 'ambank' => [ 75 'code' => 'ambank', 76 'name' => 'AmBank' 77 ], 78 'cimb' => [ 79 'code' => 'cimb', 80 'name' => 'CIMB Bank' 81 ], 82 'islam' => [ 83 'code' => 'islam', 84 'name' => 'Bank Islam' 85 ], 86 'rakyat' => [ 87 'code' => 'rakyat', 88 'name' => 'Bank Rakyat' 89 ], 90 'muamalat' => [ 91 'code' => 'muamalat', 92 'name' => 'Bank Muamalat' 93 ], 94 'bsn' => [ 95 'code' => 'bsn', 96 'name' => 'Bank Simpanan Nasional' 97 ], 98 'hongleong' => [ 99 'code' => 'hongleong', 100 'name' => 'Hong Leong' 101 ], 102 'hsbc' => [ 103 'code' => 'hsbc', 104 'name' => 'HSBC Bank' 105 ], 106 'kfh' => [ 107 'code' => 'kfh', 108 'name' => 'Kuwait Finance House' 109 ], 110 'maybank2u' => [ 111 'code' => 'maybank2u', 112 'name' => 'Maybank' 113 ], 114 'ocbc' => [ 115 'code' => 'ocbc', 116 'name' => 'OCBC' 117 ], 118 'public' => [ 119 'code' => 'public', 120 'name' => 'Public Bank' 121 ], 122 'rhb' => [ 123 'code' => 'rhb', 124 'name' => 'RHB Bank' 125 ], 126 'sc' => [ 127 'code' => 'sc', 128 'name' => 'Standard Chartered' 129 ], 130 'uob' => [ 131 'code' => 'uob', 132 'name' => 'United Overseas Bank' 133 ], 134 ]; 66 135 } 67 136 … … 74 143 Omise_Util::render_view( 75 144 'templates/payment/form-duitnow-obw.php', 76 [ 'duitnow_obw_banklist' => !$this->backend ? $this->backend->banks : []]145 [ 'duitnow_obw_banklist' => $this->get_bank_list() ] 77 146 ); 78 147 } -
omise/trunk/omise-woocommerce.php
r3182037 r3186329 5 5 * Plugin URI: https://www.omise.co/woocommerce 6 6 * Description: Opn Payments is a WordPress plugin designed specifically for WooCommerce. The plugin adds support for Opn Payments Payment Gateway's payment methods to WooCommerce. 7 * Version: 6.0. 07 * Version: 6.0.1 8 8 * Author: Opn Payments and contributors 9 9 * Author URI: https://github.com/omise/omise-woocommerce/graphs/contributors … … 24 24 * @var string 25 25 */ 26 public $version = '6.0. 0';26 public $version = '6.0.1'; 27 27 28 28 /** -
omise/trunk/readme.txt
r3182037 r3186329 4 4 Requires at least: 4.3.1 5 5 Tested up to: 6.6.2 6 Stable tag: 6.0. 06 Stable tag: 6.0.1 7 7 License: MIT 8 8 License URI: https://opensource.org/licenses/MIT … … 34 34 35 35 == Changelog == 36 37 = 6.0.1 = 38 39 - Resolve issue of payment failing on installment when total amount is updated after selecting payment. (PR: [#485](https://github.com/omise/omise-woocommerce/pull/485)) 40 - Fix Duitnow bank list issue. (PR: [#486](https://github.com/omise/omise-woocommerce/pull/486)) 41 - Resolve the issue where no payment methods are displayed when the browser's back button is clicked from an issuer page. (PR: [#487](https://github.com/omise/omise-woocommerce/pull/487)) 36 42 37 43 = 6.0.0 = -
omise/trunk/templates/payment/form-installment.php
r3182037 r3186329 4 4 <div id="omise-installment" style="width:100%; max-width: 400px;"></div> 5 5 <script> 6 window.OMISE_UPDATED_CART_AMOUNT= `<?php echo $viewData['total_amount']; ?>`; 6 7 window.LOCALE = `<?php echo get_locale(); ?>`; 7 8 window.OMISE_CUSTOM_FONT_OTHER = 'Other'; -
omise/trunk/tests/unit/includes/blocks/gateways/traits/mock-gateways.php
r3182037 r3186329 51 51 ]; 52 52 } 53 54 public function get_bank_list() { 55 return [ 56 'bank1', 57 'bank2', 58 ]; 59 } 53 60 }; 54 61 -
omise/trunk/tests/unit/includes/gateway/class-omise-payment-duitnow-obw-test.php
r3182037 r3186329 7 7 class Omise_Payment_DuitNow_OBW_Test extends Omise_Offsite_Test 8 8 { 9 private $omise_capability_mock;10 11 9 public function setUp(): void 12 10 { … … 14 12 parent::setUp(); 15 13 Monkey\Functions\expect('add_action'); 16 $this->omise_capability_mock = Mockery::mock('alias:Omise_Capabilities');17 14 require_once __DIR__ . '/../../../../includes/gateway/class-omise-payment-duitnow-obw.php'; 18 15 } … … 26 23 } 27 24 28 $this->omise_capability_mock->shouldReceive('retrieve')->once();29 25 $_POST['source'] = ['bank' => 'SCB']; 30 26 $obj = new Omise_Payment_DuitNow_OBW(); 31 27 $this->getChargeTest($obj); 32 28 } 29 30 public function testGetBankList() 31 { 32 $expected = [ 33 'affin' => [ 34 'code' => 'affin', 35 'name' => 'Affin Bank' 36 ], 37 'alliance' => [ 38 'code' => 'alliance', 39 'name' => 'Alliance Bank' 40 ], 41 'agro' => [ 42 'code' => 'agro', 43 'name' => 'Agrobank' 44 ], 45 'ambank' => [ 46 'code' => 'ambank', 47 'name' => 'AmBank' 48 ], 49 'cimb' => [ 50 'code' => 'cimb', 51 'name' => 'CIMB Bank' 52 ], 53 'islam' => [ 54 'code' => 'islam', 55 'name' => 'Bank Islam' 56 ], 57 'rakyat' => [ 58 'code' => 'rakyat', 59 'name' => 'Bank Rakyat' 60 ], 61 'muamalat' => [ 62 'code' => 'muamalat', 63 'name' => 'Bank Muamalat' 64 ], 65 'bsn' => [ 66 'code' => 'bsn', 67 'name' => 'Bank Simpanan Nasional' 68 ], 69 'hongleong' => [ 70 'code' => 'hongleong', 71 'name' => 'Hong Leong' 72 ], 73 'hsbc' => [ 74 'code' => 'hsbc', 75 'name' => 'HSBC Bank' 76 ], 77 'kfh' => [ 78 'code' => 'kfh', 79 'name' => 'Kuwait Finance House' 80 ], 81 'maybank2u' => [ 82 'code' => 'maybank2u', 83 'name' => 'Maybank' 84 ], 85 'ocbc' => [ 86 'code' => 'ocbc', 87 'name' => 'OCBC' 88 ], 89 'public' => [ 90 'code' => 'public', 91 'name' => 'Public Bank' 92 ], 93 'rhb' => [ 94 'code' => 'rhb', 95 'name' => 'RHB Bank' 96 ], 97 'sc' => [ 98 'code' => 'sc', 99 'name' => 'Standard Chartered' 100 ], 101 'uob' => [ 102 'code' => 'uob', 103 'name' => 'United Overseas Bank' 104 ], 105 ]; 106 $obj = new Omise_Payment_DuitNow_OBW(); 107 $bankList = $obj->get_bank_list(); 108 $this->assertEquals($expected, $bankList); 109 } 33 110 }
Note: See TracChangeset
for help on using the changeset viewer.