Skip to content

Commit

Permalink
Merge pull request #12 from Chapa-Et/main
Browse files Browse the repository at this point in the history
Update version to 1.0.3
  • Loading branch information
isrugeek authored Jan 5, 2025
2 parents 5b56ad7 + 82ff05b commit 7b0b110
Show file tree
Hide file tree
Showing 6 changed files with 1,088 additions and 1,183 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

**Requires at least:** 4.5

**Tested up to:** 6.6.1
**Tested up to:** 6.7.1

**Stable tag:** 1.0.2
**Stable tag:** 1.0.3

**License:** GPLv2 or later

Expand Down Expand Up @@ -112,3 +112,7 @@ To configure the plugin, go to __WooCommerce > Settings__ from the left hand men

* Support latest version of Woocommerce
* Update plugin to support WooCommerce payment gateway using Gutenberg blocks

= 1.0.3 =

* Update payment gateway logic to handle currency discrepancies
4 changes: 2 additions & 2 deletions includes/class-waf-wc-chapa-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ public function process_success()
$reference_id = $chapa_order->data->reference;
$order_currency = $wc_order->get_currency();
$currency_symbol = get_woocommerce_currency_symbol($order_currency);
if ($amount_paid < $order_total) {
if (($amount_paid < $order_total) || ($order_currency !== $chapa_order->data->currency)) {
// Mark as on-hold
$wc_order->update_status('on-hold', '');
update_post_meta($order_id, '_transaction_id', $reference_id);
$notice = 'Thank you for shopping with us.<br />Your payment was successful, but the amount paid is not the same as the total order amount.<br />Your order is currently on-hold.<br />Kindly contact us for more information regarding your order and payment status.';
$notice = 'Thank you for shopping with us.<br />Your payment was successful, but the amount paid or currency is not the same as the total order amount.<br />Your order is currently on-hold.<br />Kindly contact us for more information regarding your order and payment status.';
$notice_type = 'notice';
// Add Customer Order Note
$wc_order->add_order_note($notice, 1);
Expand Down
Loading

0 comments on commit 7b0b110

Please sign in to comment.