Plugin Directory

Changeset 2480483


Ignore:
Timestamp:
02/24/2021 09:26:12 AM (5 years ago)
Author:
askbux
Message:

update

Location:
bux-woocommerce/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bux-woocommerce/trunk/bux-plugin.php

    r2399893 r2480483  
    44 * Plugin URI: https://bux.ph/static/bux-plugin-wp.zip
    55 * Description: Bux plugin for Woocommerce, you need to have Woocommerce installed
    6  * Version: 1.0.4
     6 * Version: 1.1.0
    77 * Author: UBX Philippines
    88 * Author URI: https://bux.ph
     
    119119  register_setting( 'bux-options', 'bux_redirect_disable' , $args);
    120120
     121  $args = array(
     122            'default' => false,
     123            );
     124  register_setting( 'bux-options', 'bux_test_mode' , $args);
     125
    121126}
    122127
     
    152157        <th scope="row">Default Expiry (hrs)</th>
    153158        <td><input type="number" name="bux_payment_default_expiry" style="width: 360px" value="<?php echo esc_attr( get_option('bux_payment_default_expiry') ); ?>" min="2" max="168" required/></td>
     159        </tr>
     160
     161        <tr valign="top">
     162        <th scope="row">Test Mode</th>
     163        <td><input type="checkbox" id="bux_test_mode" name="bux_test_mode" value="1"<?php checked( 1 == get_option('bux_test_mode')) ?> /></td>
    154164        </tr>
    155165
     
    318328            $this->has_fields         = false;
    319329            $this->method_title       = __( 'Bux', 'bux-gateway' );
    320             $this->method_description = __( 'Pay through 7-eleven, Cebuana, Palawan, Mlhuiller, LBC, SM, Bayad Center, Robinsons, etc. (Max 30,000PHP)' );
     330            $this->method_description = __( 'Pay through GCash, Online Banking (UnionBank, BPI, RCBC), Over the counter (7-Eleven, Cebuana, Palawan, etc)' );
    321331         
    322332            // Load the settings.
     
    328338            $this->description  = $this->get_option( 'description' );
    329339            $this->instructions = $this->get_option( 'instructions', $this->description );
     340
     341
     342            $this->API_BASE_URL = 'https://api.bux.ph/v1';
     343            $this->BUX_BASE_URL = 'https://bux.ph';
    330344            // Actions
    331345            add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
     
    384398
    385399            $basicauth = get_option('bux_payment_api_key');
    386             $url = 'https://api.bux.ph/v1/api/check_code/';
     400            $url = $this->API_BASE_URL . '/api/check_code/';
     401
     402            if(get_option('bux_test_mode')){
     403
     404                $url = $this->API_BASE_URL . '/api/sandbox/check_code/';
     405            }
     406
    387407            $blog_name = get_bloginfo('name');
    388408            $data = array(
     
    453473            $basicauth = get_option('bux_payment_api_key');
    454474
    455             $url = 'https://api.bux.ph/v1/api/woocommerce/checkout/';
     475            $url = $this->API_BASE_URL . '/api/woocommerce/checkout/';
     476
     477            if(get_option('bux_test_mode')){
     478
     479                $url = $this->API_BASE_URL . '/api/sandbox/woocommerce/checkout/';
     480            }
     481
    456482            $blog_name = get_bloginfo('name');
    457483            $data = array(
     
    486512
    487513            $order_data = json_decode( $body );
     514            $checkout_base = $this->BUX_BASE_URL . '/checkout/';
     515
     516            if(get_option('bux_test_mode')){
     517
     518                $checkout_base = $this->BUX_BASE_URL . '/test/checkout/';
     519            }
    488520
    489521            if($order_data->status == "success"){
     
    500532                    return array(
    501533                        'result'    => 'success',
    502                         'redirect'  => 'https://bux.ph/checkout/' . $order_data->uid
     534                        'redirect'  => $checkout_base . $order_data->uid
    503535                    ); 
    504536                }else{
    505537                    return array(
    506538                        'result'    => 'success',
    507                         'redirect'  => 'https://bux.ph/checkout/' . $order_data->uid . '/?redirect_url=' . $return_url
     539                        'redirect'  => $checkout_base . $order_data->uid . '/?redirect_url=' . $return_url
    508540                    ); 
    509541                }
  • bux-woocommerce/trunk/readme.txt

    r2399893 r2480483  
    99Tested up to: 5.3.2
    1010Requires PHP: 5.2.4
    11 Stable tag: 1.0.4
    12 Version: 1.0.4
     11Stable tag: 1.1.0
     12Version: 1.1.0
    1313Donate link: https://bux.ph/
    1414
     
    2020
    2121Bux allows your website to accept payments from Over-the-counter channels (7-Eleven, Cebuana Pawnshop, LBC, Palawan, SM Dept Stores, Bayad Center, etc).
    22 Bux also allows you to accept payments from GCash and Online Banking channels such as UnionBank, BPI and RCBC. (Grabpay and Card Payments soon)
     22Bux also allows you to accept payments from GCash and Online Banking channels such as UnionBank, BPI and RCBC.
    2323
    2424This Plugin integrates your online store to Bux Payment Platform.
     
    5555* Update descriptions
    5656
     57
     58= 1.1.0 =
     59* Include Test Mode
     60
    5761== Upgrade Notice ==
    5862
     
    6973Update descriptions
    7074
     75= 1.1.0 =
     76Include Test mode
     77
    7178
    7279== Screenshots ==
Note: See TracChangeset for help on using the changeset viewer.