Plugin Directory

Changeset 2504769


Ignore:
Timestamp:
03/28/2021 03:05:46 PM (5 years ago)
Author:
mstonys
Message:

version 1.0.2 is out

Location:
pay-with-mtn-momo-woocommerce
Files:
17 added
4 edited

Legend:

Unmodified
Added
Removed
  • pay-with-mtn-momo-woocommerce/trunk/README.txt

    r2486245 r2504769  
    44Tags: MTN MoMo, MoMo, payment, MTN, payment gateway, mobile money, WooCommerce
    55Tested up to: 5.7
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77Requires at least: 5.0
    88Requires PHP: 7.0
     
    9090This section describes how to install the plugin and get it working.
    9191
    92 1. Unzip `mtn-momo-pay.zip` to the `/wp-content/plugins/` directory, or install from the WordPress Plugins Directory.
     921. Unzip `pay-with-mtn-momo-woocommerce.zip` to the `/wp-content/plugins/` directory, or install from the WordPress Plugins Directory.
    93932. Activate the plugin through the 'Plugins' menu in WordPress
    94943. Configure plugin under WooCommerce->Payments, look for *MTN MoMo*
     
    147147== Changelog ==
    148148
     149= 1.0.2 =
     150* Documentation updated
     151* Fixed REST callback, `permission_callback` added
     152* Deprecation warnings removed
     153
    149154= 1.0.1 =
    150155* Tested with Wordpress 5.7
  • pay-with-mtn-momo-woocommerce/trunk/classes/class_momo_pay_gateway.php

    r2486245 r2504769  
    732732        return array(
    733733            'amount' => (int) $order->order_total,
    734             'note' => 'Order ' . $order->id,
     734            'note' => 'Order ' . $order->get_order_number(),
    735735            'payer' => $this->cleanPhone($order->billing_phone)
    736736        );
  • pay-with-mtn-momo-woocommerce/trunk/classes/class_momo_pay_view.php

    r2470497 r2504769  
    284284        $cartUrl = $cart_page_id ? get_permalink( $cart_page_id ) : '';
    285285
    286         $orderReceivedUrl = $order->get_checkout_order_received_url(); //$siteUrl . '/checkout/order-received';
    287         $cartPaymentWithIdUrl = $siteUrl . '/cart?momo_payment_id=' . $payment_id;
     286        $orderReceivedUrl = $order->get_checkout_order_received_url();
     287        $cartPaymentWithIdUrl = $cartUrl + '?momo_payment_id=' . $payment_id;
    288288
    289289        $html = '<div class="momopay-checkout-box">
     
    291291            <img class="momopay-checkout-logo" src="'. plugin_dir_url(__FILE__) . '../assets/img/mtn-momo-logo.png" alt="MTN MoMoPay payments">
    292292            <div class="mtn-momo-pay_error-box" id="momopay_errorBox"></div>
    293             <input type="hidden" id="currentOrderId" value="'. $order->id .'" />
     293            <input type="hidden" id="currentOrderId" value="'. $order->get_id() .'" />
    294294            <input type="hidden" id="paymentId" value="'. $payment_id .'" />
    295295            <input type="hidden" id="orderCancelUrl" value="'. $orderCancelUrl.'" />
  • pay-with-mtn-momo-woocommerce/trunk/mtn-momo-pay.php

    r2486245 r2504769  
    44* Plugin URI: https://www.clickon.ch
    55* Description: Accept payments over MTN MoMo in WooCommerce
    6 * Version: 1.0.1
     6* Version: 1.0.2
    77* Author: mstonys
    88* Author URI: https://profiles.wordpress.org/mstonys/
    99* Licence: GPL2
    1010* Text Domain: mtn-momo-pay
    11 * Tested up to: 5.4
     11* Tested up to: 5.7
    1212* Stable tag: 5.0
    1313* WC requires at least: 4.2.0
    14 * WC tested up to: 5.0.0
     14* WC tested up to: 5.1.0
    1515*/
    1616
     
    3232};
    3333
    34 function woo_momo_pay_admin_assets() {
    35    wp_enqueue_script('momo_pay_script', plugin_dir_url(__FILE__) . 'assets/js/wc-mtn-momo-pay.js', array('jquery'), time(), true);
    36    wp_enqueue_style( 'momo_pay_style', plugin_dir_url(__FILE__) . 'assets/css/wc-mtn-momo-pay.css', array(), time());
    37 };
     34if(!function_exists('woo_momo_pay_admin_assets')) {
     35    function woo_momo_pay_admin_assets() {
     36        wp_enqueue_script('momo_pay_script', plugin_dir_url(__FILE__) . 'assets/js/wc-mtn-momo-pay.js', array('jquery'), time(), true);
     37        wp_enqueue_style( 'momo_pay_style', plugin_dir_url(__FILE__) . 'assets/css/wc-mtn-momo-pay.css', array(), time());
     38    };
     39}
    3840
    39 
    40 function woo_momo_pay_public_assets() {
    41    wp_enqueue_script('momo_pay_script_public', plugin_dir_url(__FILE__) . 'assets/js/wc-mtn-momo-pay_public.js', array('jquery'), time(), true);
    42    wp_enqueue_style( 'momo_pay_style', plugin_dir_url(__FILE__) . 'assets/css/wc-mtn-momo-pay.css', array(), time());
    43 };
     41if(!function_exists('woo_momo_pay_public_assets')) {
     42    function woo_momo_pay_public_assets() {
     43        wp_enqueue_script('momo_pay_script_public', plugin_dir_url(__FILE__) . 'assets/js/wc-mtn-momo-pay_public.js', array('jquery'), time(), true);
     44        wp_enqueue_style( 'momo_pay_style', plugin_dir_url(__FILE__) . 'assets/css/wc-mtn-momo-pay.css', array(), time());
     45    };
     46}
    4447
    4548
     
    111114        array(
    112115            'methods' => 'POST',
    113             'callback' => 'process_momo_payment'
    114         )
     116            'callback' => 'process_momo_payment',
     117            'permission_callback' => '__return_true'
     118        )
    115119    );
    116120});
Note: See TracChangeset for help on using the changeset viewer.