Changeset 3149814
- Timestamp:
- 09/11/2024 07:07:01 AM (19 months ago)
- Location:
- mobipaid/trunk
- Files:
-
- 3 added
- 4 edited
-
assets/js (added)
-
assets/js/mobipaid-block.js (added)
-
changelog.txt (modified) (1 diff)
-
includes/class-mobipaid-blocks-support.php (added)
-
includes/class-mobipaid.php (modified) (7 diffs)
-
mobipaid.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mobipaid/trunk/changelog.txt
r2964082 r3149814 37 37 = 1.0.9 - 2023-09-02 = 38 38 * support compatibility wordpress 6.3.1 and woocommerce 8.0.3. 39 40 = 1.1.0 - 2024-09-08 = 41 * support HPOS 42 * support woocommerce checkout block 43 * support compatibility wordpress 6.6.2 and woocommerce 9.2.3 -
mobipaid/trunk/includes/class-mobipaid.php
r2964082 r3149814 427 427 428 428 // * save transaction_id and secret_key first before call get_payment_url function. 429 update_post_meta($order->get_id(), '_mobipaid_transaction_id', $transaction_id);430 update_post_meta($order->get_id(), '_mobipaid_secret_key', $secret_key);429 $order->update_meta_data( '_mobipaid_transaction_id', $transaction_id ); 430 $order->update_meta_data( '_mobipaid_secret_key', $secret_key ); 431 431 432 432 $payment_url = $this->get_payment_url($order_id, $transaction_id); … … 453 453 $order = wc_get_order($order_id); 454 454 if ($order && 'mobipaid' === $order->get_payment_method()) { 455 $payment_id = get_post_meta($order->get_id(), '_mobipaid_payment_id', true);455 $payment_id = $order->get_meta( '_mobipaid_payment_id', true ); 456 456 $body = array( 457 457 'email' => $order->get_billing_email(), … … 487 487 if (('processing' === $status_from || 'completed' === $status_from) && 'refunded' === $status_to) { 488 488 $amount = (float) $this->get_order_prop($order, 'order_total'); 489 $payment_id = get_post_meta($order->get_id(), '_mobipaid_payment_id', true);489 $payment_id = $order->get_meta( '_mobipaid_payment_id', true ); 490 490 $body = array( 491 491 'email' => $order->get_billing_email(), … … 524 524 if (('processing' === $status_from || 'completed' === $status_from) && 'refunded' === $status_to) { 525 525 $order_amount = (float) $this->get_order_prop($order, 'order_total'); 526 $payment_id = get_post_meta($order->get_id(), '_mobipaid_payment_id', true);526 $payment_id = $order->get_meta( '_mobipaid_payment_id', true ); 527 527 $results = Mobipaid_API::get_payment($payment_id); 528 528 $this->log('add_full_refund_notes - get_payment results: ' . wp_json_encode($results)); … … 564 564 protected function generate_token($order_id, $currency) 565 565 { 566 $transaction_id = get_post_meta($order_id, '_mobipaid_transaction_id', true); 567 $secret_key = get_post_meta($order_id, '_mobipaid_secret_key', true); 566 $order = wc_get_order($order_id); 567 $transaction_id = $order->get_meta( '_mobipaid_transaction_id', true ); 568 $secret_key = $order->get_meta( '_mobipaid_secret_key', true ); 568 569 569 570 return md5((string) $order_id . $currency . $transaction_id . $secret_key); … … 645 646 646 647 $order_notes = 'Mobipaid payment successfull:'; 647 update_post_meta($order->get_id(), '_mobipaid_payment_id', $payment_id);648 update_post_meta($order->get_id(), '_mobipaid_payment_result', 'succes');648 $order->update_meta_data( '_mobipaid_payment_id', $payment_id ); 649 $order->update_meta_data( '_mobipaid_payment_result', 'succes' ); 649 650 $order->update_status($order_status, $order_notes); 650 651 } else { … … 652 653 $order_status = 'failed'; 653 654 $order_notes = 'Mobipaid payment failed:'; 654 update_post_meta($order->get_id(), '_mobipaid_payment_result', 'failed');655 $order->update_meta_data( '_mobipaid_payment_result', 'failed' ); 655 656 $order->update_status($order_status, $order_notes); 656 657 } -
mobipaid/trunk/mobipaid.php
r2964088 r3149814 4 4 * Plugin URI: https://github.com/MobipaidLLC/mobipaid-woocommerce 5 5 * Description: Receive payments using Mobipaid. 6 * Version: 1. 0.96 * Version: 1.1.0 7 7 * Requires at least: 5.0 8 * Tested up to: 6. 3.18 * Tested up to: 6.6.2 9 9 * WC requires at least: 3.9.0 10 * WC tested up to: 6.5.110 * WC tested up to: 9.2.3 11 11 * Requires PHP: 7.0 12 12 * Author: Mobipaid … … 24 24 } 25 25 26 define( 'MOBIPAID_PLUGIN_VERSION', '1. 0.9' );26 define( 'MOBIPAID_PLUGIN_VERSION', '1.1.0' ); 27 27 28 28 register_activation_hook( __FILE__, 'mobipaid_activate_plugin' ); 29 29 register_uninstall_hook( __FILE__, 'mobipaid_uninstall_plugin' ); 30 31 // Declare compatibility with custom_order_tables and cart_checkout_blocks for WooCommerce. 32 add_action( 33 'before_woocommerce_init', 34 function () { 35 if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) { 36 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 37 'custom_order_tables', 38 __FILE__, 39 true 40 ); 41 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 42 'cart_checkout_blocks', 43 __FILE__, 44 true 45 ); 46 } 47 } 48 ); 30 49 31 50 /** … … 127 146 return $mobipaid->response_page(); 128 147 } 148 149 add_action( 'woocommerce_blocks_loaded', 'mobipaid_gateway_block_support' ); 150 function mobipaid_gateway_block_support() { 151 152 if( ! class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { 153 return; 154 } 155 156 // here we're including our "gateway block support class" 157 require_once __DIR__ . '/includes/class-mobipaid-blocks-support.php'; 158 159 // registering the PHP class we have just included 160 add_action( 161 'woocommerce_blocks_payment_method_type_registration', 162 function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { 163 $payment_method_registry->register( new Mobipaid_Blocks_Support ); 164 } 165 ); 166 167 } -
mobipaid/trunk/readme.txt
r2964088 r3149814 4 4 Tags: credit card, mobipaid, google pay, apple pay, nedbank, payment method, payment gateway 5 5 Requires at least: 5.0 6 Tested up to: 6. 3.16 Tested up to: 6.6.2 7 7 Requires PHP: 7.0 8 Stable tag: 1. 0.98 Stable tag: 1.1.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 134 134 = 1.0.9 - 2023-09-02 = 135 135 * support compatibility wordpress 6.3.1 and woocommerce 8.0.3. 136 137 = 1.1.0 - 2024-09-08 = 138 * support HPOS 139 * support woocommerce checkout block 140 * support compatibility wordpress 6.6.2 and woocommerce 9.2.3
Note: See TracChangeset
for help on using the changeset viewer.