Skip to content

Commit

Permalink
Support Arabic products
Browse files Browse the repository at this point in the history
  • Loading branch information
malnafei committed May 3, 2021
1 parent 6988702 commit 6b2a0ed
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ For detailed information and signup please visit: [Thawani Pay](https://thawani.
- [x] Support PRODUCTION api
- [x] Create new payment
- [x] Success and Cancel callbacks
- [ ] Webhook
- [ ] Payment card tokenization - Saved cards
- [ ] Refund - intgrate Thawani refund API with woocomerce refund feature
- [ ] Transaction details - View payment transaction details on order edit.
- [ ] Woocommerce tax
- [ ] Webhook

## Screenshots
<img width="1664" alt="Screen Shot 2021-03-10 at 11 18 05 AM" src="https://user-images.githubusercontent.com/15148391/110591421-7c90ba00-8192-11eb-8d9e-6da8c3358738.png">
Expand Down Expand Up @@ -65,6 +66,9 @@ You can use the test cards provided by Thawani Team:

## Changelog

# 1.2.0 #
* Arabic products supported now.

# 1.1.0 #
* fix product name must be a string with a maximum length of 40 issue.
* Add billing phone to request metadata.
Expand Down
9 changes: 8 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,11 @@ Please go to https://developer.thawani.om/ for more information
== Changelog ==

= 1.0.0 =
* first public version
* first public version

= 1.1.0 =
* fix product name must be a string with a maximum length of 40 issue.
* Add billing phone to request metadata.

= 1.2.0 =
* Arabic products supported now.
9 changes: 4 additions & 5 deletions thawani-pay-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Thawani Pay v2
Description: Thawani V2 Payment Gateway for WooCommerce
Version: 1.0.0
Version: 1.2.0
Author: Mahmoud Alnafei
Author URI: https://twitter.com/magic_coding
Tags: payment, online payment, woocommerce, thawani pay, oman payment gateway
Expand All @@ -17,9 +17,8 @@
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
defined('ABSPATH') or wp_die( 'No script kiddies please!' );


add_filter( 'woocommerce_payment_gateways', 'thawani_add_gateway_class' );
function thawani_add_gateway_class( $gateways ) {
Expand Down Expand Up @@ -203,7 +202,7 @@ public function process_payment( $order_id ) {
$quantity = $item->get_quantity();
$subtotal = $item->get_subtotal();
$total_price = $item->get_total();
array_push($products_list, array('name'=> preg_replace("/[^a-zA-Z0-9 ]/", "", substr($product_name, 0, 40)), 'unit_amount' => $total_price * 1000, 'quantity' => $quantity));
array_push($products_list, array('name'=> substr($product_name, 0, 40), 'unit_amount' => $total_price * 1000, 'quantity' => $quantity));

}

Expand Down

0 comments on commit 6b2a0ed

Please sign in to comment.