Changeset 3113263
- Timestamp:
- 07/05/2024 06:50:57 PM (20 months ago)
- Location:
- lipad-checkout
- Files:
-
- 14 added
- 3 edited
-
tags/1.0.5 (added)
-
tags/1.0.5/assets (added)
-
tags/1.0.5/assets/banner-772x250.png (added)
-
tags/1.0.5/assets/icon.svg (added)
-
tags/1.0.5/assets/lipad-checkout-logo.svg (added)
-
tags/1.0.5/assets/screenshot-1.png (added)
-
tags/1.0.5/assets/screenshot-2.png (added)
-
tags/1.0.5/assets/screenshot-3.png (added)
-
tags/1.0.5/assets/screenshot-4.png (added)
-
tags/1.0.5/includes (added)
-
tags/1.0.5/includes/LipadPaymentGatewayConstants.php (added)
-
tags/1.0.5/includes/LipadPaymentGatewayUtils.php (added)
-
tags/1.0.5/lipad-payment-gateway.php (added)
-
tags/1.0.5/readme.txt (added)
-
trunk/includes/LipadPaymentGatewayConstants.php (modified) (1 diff)
-
trunk/lipad-payment-gateway.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lipad-checkout/trunk/includes/LipadPaymentGatewayConstants.php
r3112745 r3113263 95 95 ], 96 96 ]; 97 const AIRTEL_REGEX = '/^(254)(([7]([38]{1}([0-9]{7})|(([5][0]|[5][1]|[5][2]|[5][3]|[5][4]|[5][5]|[5][6]|[6][0]|[6][2]){1})([0-9]{6}))|((100)|(101)|(102)|(103)|(104)|(105)|(106))([0-9]{6})))$/'; 98 const MPESA_REGEX = '/^(254)((([7])([0|1|2|9])([0-9]{7}))|(74)([0123456]{1})([0-9]{6})|(75)([789]{1})([0-9]{6})|(76)([89]{1})([0-9]{6})|((110)|(111)|(112)|(113)|(114)|(115))([0-9]{6}))$/'; 97 99 } 100 // Regular expressions 101 -
lipad-checkout/trunk/lipad-payment-gateway.php
r3112745 r3113263 7 7 * Plugin URI: https://wordpress.org/plugins/lipad-checkout 8 8 * Description: Collect payments from your customers with an express self-checkout interface. 9 * Version: 1.0. 49 * Version: 1.0.5 10 10 * Author: Lipad 11 11 * Author URI: https://lipad.io … … 55 55 public $access_key; 56 56 public $secret_key; 57 public $service_code;58 57 public $payment_period; 59 58 public $client_code; … … 92 91 $this->access_key = $this->test_mode ? $this->get_option('test_access_key') : $this->get_option('access_key'); 93 92 $this->checkout_url = $this->test_mode ? LipadWordPressConstants::CHECKOUT_REDIRECT_LINKS['uat'] : LipadWordPressConstants::CHECKOUT_REDIRECT_LINKS['live']; 94 $this->service_code = $this->test_mode ? $this->get_option('test_service_code') : $this->get_option('service_code');95 93 $this->payment_period = $this->test_mode ? $this->get_option('test_payment_period') : $this->get_option('payment_period'); 94 // $this->service_code = $this->test_mode ? $this->get_option('test_service_code') : $this->get_option('service_code'); 96 95 $this->client_code = $this->test_mode ? $this->get_option('test_client_code') : $this->get_option('client_code'); 97 96 $this->client_secret = $this->test_mode ? $this->get_option('test_client_secret') : $this->get_option('client_secret'); … … 162 161 ), 163 162 'test_secret_key' => array( 164 'title' => 'Test Secret Key',163 'title' => 'Test Airtel Money Secret Key', 165 164 'type' => 'text' 166 165 ), … … 258 257 $order = wc_get_order($order_id); 259 258 259 // Get the billing phone number 260 $msisdn = preg_replace('/^(?:\+?0?(?:254)?)?/', '254', $order->get_billing_phone()); 261 if (preg_match(LipadWordPressConstants::AIRTEL_REGEX, $msisdn)) { 262 $operator = 'airtelmoney'; 263 $service_code = $this->test_mode ? $this->get_option('test_service_code') : $this->get_option('service_code'); 264 } elseif (preg_match(LipadWordPressConstants::MPESA_REGEX, $msisdn)) { 265 $operator = 'mpesa'; 266 $service_code = $this->test_mode ? $this->get_option('test_service_code') : $this->get_option('service_code'); 267 } else { 268 wc_add_notice('The phone number is not valid for the supported operators!', 'error'); 269 return array( 270 'result' => 'failure' 271 ); 272 } 260 273 // checkout transaction description 261 274 $order_excerpt = array_reduce($order->get_items(), function ($carry, $item) { … … 273 286 // array with parameters for API interaction 274 287 $payload = array( 275 "msisdn" => $ order->get_billing_phone(),276 "account_number"=> $ order->get_billing_phone(),288 "msisdn" => $msisdn, 289 "account_number"=> $msisdn, 277 290 "country_code" => !empty($country_code) ? $country_code : 'KEN', 278 291 "currency_code" => !empty($currency_code) ? $currency_code : 'KES', … … 287 300 "success_redirect_url" => $order->get_checkout_order_received_url(), 288 301 "fail_redirect_url" => get_permalink(get_page_by_path('shop')), 289 "service_code" => $ this->service_code,302 "service_code" => $service_code, 290 303 "client_code" => $this->client_code, 291 304 "language_code" => 'en' -
lipad-checkout/trunk/readme.txt
r3112745 r3113263 5 5 Tested up to: 6.5.5 6 6 Requires PHP: 5.2.4 7 Stable tag: 1.0. 47 Stable tag: 1.0.5 8 8 WC tested up to: 9.0.2 9 9 License: GPL2 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Lipad Checkout simplifies the payment collection process for your WooCommerce store by seamlessly integrating with the Lipad payment gateway. 13 With Lipad Checkout, you can provide your customers with a frictionless payment experience. Whether you're selling products or services, this plugin enables you to effortlessly receive payments via Lipad's own intuitive checkout interface. 12 Lipad Checkout integrates seamlessly with WooCommerce, offering a frictionless payment experience via Lipad's intuitive checkout interface. 14 13 15 14 == Description == 16 15 17 Lipad Checkout i s a plugin that integrates the Lipad payment gateway with WooCommerce, allowing you to collect payments from your customers through an express self-checkout interface. The plugin provides seamless integration between your WooCommerce store and the Lipad payment platform.16 Lipad Checkout integrates the Lipad payment gateway with WooCommerce, enabling quick payments via an express self-checkout interface. 18 17 19 18 == Installation == … … 43 42 == Changelog == 44 43 44 = 1.0.5 = 45 46 -**Fix**: Dynamically check the payer phone number for Airtel and Safaricom. 47 45 48 = 1.0.4 = 46 49 … … 64 67 65 68 = Upgrade Notice = 69 70 = 1.0.5 = 71 72 - This update adds the functionality to dynamically check phone number operators. 66 73 67 74 = 1.0.4 =
Note: See TracChangeset
for help on using the changeset viewer.