Skip to content

Commit

Permalink
Merge pull request #491 from omise/release-v6.0.2
Browse files Browse the repository at this point in the history
Release v6.0.2
  • Loading branch information
aashishgurung authored Nov 20, 2024
2 parents b653a46 + 340d38c commit b07f1e5
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 32 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## [v6.0.2 _(Nov 20, 2024)_](https://github.com/omise/omise-woocommerce/releases/tag/v6.0.2)
- Resolved installment issue when card is saved in shortcode setup. (PR: [#490](https://github.com/omise/omise-woocommerce/pull/490))

## [v6.0.1 _(Nov 12, 2024)_](https://github.com/omise/omise-woocommerce/releases/tag/v6.0.1)
- 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))
- Fix Duitnow bank list issue. (PR: [#486](https://github.com/omise/omise-woocommerce/pull/486))
Expand Down
38 changes: 13 additions & 25 deletions assets/javascripts/omise-payment-form-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,15 @@
}

function omiseInstallmentFormHandler() {
function getSelectedCardId() {
const $selected_card_id = $("input[name='card_id']:checked");
if ($selected_card_id.length > 0) {
return $selected_card_id.val();
}

return "";
if (!$('#payment_method_omise_installment').is(':checked')) {
return true;
}

if ($('#payment_method_omise_installment').is(':checked')) {
if (getSelectedCardId() !== "") {
//submit the form right away if the card_id is not blank
return true;
}

if (0 === $('input.omise_token').length && 0 === $('input.omise_source').length) {
requestCardToken();
return false;
}
return true;
if (0 === $('input.omise_token').length && 0 === $('input.omise_source').length) {
requestCardToken();
return false;
}

return true;
}

Expand Down Expand Up @@ -272,13 +260,13 @@

function setupOmiseForm() {
var selectedPaymentMethod = $('input[name="payment_method"]:checked').val();
if (selectedPaymentMethod === 'omise') {
initializeSecureCardForm();
} else if (selectedPaymentMethod === 'omise_installment') {
initializeInstallmentForm();
} else {
OmiseCard.destroy();
}
if (selectedPaymentMethod === 'omise') {
initializeSecureCardForm();
} else if (selectedPaymentMethod === 'omise_installment') {
initializeInstallmentForm();
} else {
OmiseCard.destroy();
}
}

$(function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'e2436da6ade36f0dc6835eb771337040');
<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '34ae2a7f9367048bb27a58ad9955227b');
2 changes: 1 addition & 1 deletion includes/blocks/assets/js/build/omise_installment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/blocks/assets/js/omise-installment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Label = ( props ) => {
}

const {select, subscribe} = window.wp.data;
const cartStoreKey = window.wc.wcBlocksData.CART_STORE_KEY;
const cartStoreKey = window.wc.wcBlocksData ? window.wc.wcBlocksData.CART_STORE_KEY : '';

const InstallmentPaymentMethod = (props) => {
const {eventRegistration, emitResponse} = props;
Expand Down
1 change: 0 additions & 1 deletion includes/gateway/class-omise-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ protected function payment_failed( $reason ) {
$this->order()->update_status( 'failed' );
}

wc_add_notice( sprintf( wp_kses( $message, array( 'br' => array() ) ), __( $reason, 'omise' ) ), 'error' );
throw new \Exception(sprintf( wp_kses( $message, array( 'br' => array() ) ), __( $reason, 'omise' ) ));
}

Expand Down
4 changes: 2 additions & 2 deletions omise-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Opn Payments
* Plugin URI: https://www.omise.co/woocommerce
* 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.
* Version: 6.0.1
* Version: 6.0.2
* Author: Opn Payments and contributors
* Author URI: https://github.com/omise/omise-woocommerce/graphs/contributors
* Text Domain: omise
Expand All @@ -23,7 +23,7 @@ class Omise
*
* @var string
*/
public $version = '6.0.1';
public $version = '6.0.2';

/**
* The Omise Instance.
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: Opn Payments
Tags: opn payments, payment, payment gateway, woocommerce plugin, omise, opn, installment, internet banking, alipay, paynow, truemoney, woocommerce payment
Requires at least: 4.3.1
Tested up to: 6.6.2
Stable tag: 6.0.1
Stable tag: 6.0.2
License: MIT
License URI: https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -34,6 +34,10 @@ From there:

== Changelog ==

= 6.0.2 =

- Resolved installment issue when card is saved in shortcode setup. (PR: [#490](https://github.com/omise/omise-woocommerce/pull/490))

= 6.0.1 =

- 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))
Expand Down

0 comments on commit b07f1e5

Please sign in to comment.