Plugin Directory

Changeset 2196872


Ignore:
Timestamp:
11/19/2019 10:11:50 PM (6 years ago)
Author:
empatogen
Message:

Release v1.1.3

Location:
woo-xrp/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • woo-xrp/trunk/includes/class-wcxrp-gateway.php

    r2062352 r2196872  
    77 * @class       WC_Gateway_XRP
    88 * @extends     WC_Payment_Gateway
    9  * @version     1.1.2
     9 * @version     1.1.3
    1010 * @package     WooCommerce/Classes/Payment
    1111 * @author      Jesper Wallin
     
    4949        /* supported currencies */
    5050        $this->currencies = [
    51             'USD','JPY','BGN','CZK','DKK','GBP','HUF','PLN','RON','SEK','CHF',
    52             'ISK','NOK','HRK','RUB','TRY','AUD','BRL','CAD','CNY','HKD','IDR',
    53             'ILS','INR','KRW','MXN','MYR','NZD','PHP','SGD','THB','ZAR','EUR'
     51            'USD','JPY','BGN','CZK','DKK','GBP','HUF','PLN','RON','SEK',
     52            'CHF','ISK','NOK','HRK','RUB','TRY','AUD','BRL','CAD','CNY',
     53            'HKD','IDR','ILS','INR','KRW','MXN','MYR','NZD','PHP','SGD',
     54            'THB','ZAR','EUR','XRP'
    5455        ];
    5556
  • woo-xrp/trunk/includes/class-wcxrp-rates.php

    r2062352 r2196872  
    145145    public function get_rate($exchange, array $exchanges)
    146146    {
     147        /* don't bother if we're using XRP as base currency */
     148        if ($this->base_currency === 'XRP') {
     149            return 1;
     150        }
     151
    147152        /* call the rate dynamically if it's in the exchanges list */
    148153        if (isset($exchanges[$exchange]) &&
  • woo-xrp/trunk/js/checkout.js

    r2059248 r2196872  
    1 jQuery(document).ready(function($) {
     1jQuery(document).ready(function($)
     2{
     3    var use_x_account = 0;
    24
    3     function wc_gateway_xrp_qrcode(account, tag, amount) {
     5    function wc_gateway_xrp_qrcode(account, tag, amount)
     6    {
    47        $('#wc_xrp_qrcode').empty();
     8        if (account.substring(0,1) == 'r') {
     9            var qrdata = account + "?dt=" + tag + "&amount=" + amount;
     10        } else {
     11            var qrdata = account + "?amount=" + amount;
     12        }
    513        var qrcode = new QRCode(document.getElementById("wc_xrp_qrcode"), {
    6             text: "https://ripple.com/send?to=" + account + "&dt=" + tag + "&amount=" + amount,
     14            text: qrdata,
    715            width: 256,
    816            height: 256,
     
    1321    }
    1422
    15     var pollTimer = setInterval(function(){
     23    function update_balance()
     24    {
    1625        jQuery.ajax({
    1726            "url": ajax_object.ajax_url,
    18             "data": { "action": "xrp_checkout", "order_id": ajax_object.order_id },
     27            "data": {
     28                "action": "xrp_checkout",
     29                "order_id": ajax_object.order_id
     30            },
    1931            "method": "POST",
    2032            "dataType": "json",
    2133            "success": function(data) {
    2234                var regenqr=false;
     35                if (use_x_account) {
     36                    data.xrp_account = data.xrp_x_account;
     37                }
    2338                if ($('#xrp_account').text() != data.xrp_account) {
    2439                    $('#xrp_account').text(data.xrp_account);
     
    4661                    $('#wc_xrp_qrcode').empty();
    4762                } else if (regenqr) {
    48                     wc_gateway_xrp_qrcode(data.xrp_account, data.tag, data.xrp_remaining);
     63                    wc_gateway_xrp_qrcode(
     64                        data.xrp_account,
     65                        data.tag,
     66                        data.xrp_remaining
     67                    );
    4968                }
    5069            }
    5170        });
    52     }, 4000);
     71    }
     72
     73    $('#wc_xrp_qrcode, #xrp_account').on('click', function()
     74    {
     75        if (use_x_account) {
     76            use_x_account = 0;
     77        } else {
     78            use_x_account = 1;
     79        }
     80
     81        update_balance();
     82    });
     83
     84    var pollTimer = setInterval(update_balance, 4000);
    5385
    5486    wc_gateway_xrp_qrcode(
  • woo-xrp/trunk/languages/woocommerce-xrp.pot

    r2059248 r2196872  
    2020
    2121#. Plugin URI of the plugin
    22 msgid "http://github.com/empatogen/woocommerce-xrp"
     22msgid "http://github.com/zelest/woocommerce-xrp"
    2323msgstr ""
    2424
  • woo-xrp/trunk/readme.txt

    r2195016 r2196872  
    44Tags: woo, woocommerce, xrp, gateway, cryptocurrency
    55Requires at least: 5.1
    6 Tested up to: 5.3
     6Tested up to: 5.1.1
    77Requires PHP: 7.0
    88Stable tag: trunk
     
    5252== Changelog ==
    5353
     54= 1.1.3 =
     55* Add support for the new [X-addresses](https://xrpaddress.info/).
     56* Change the XRP-address in the QR-code to support more wallets.
     57
    5458= 1.1.2 =
    5559* Add the decentralized exchange. (DEX)
     
    8993== Upgrade notice ==
    9094
    91 = 1.1.2 =
    92 This version prevents certain themes from breaking the XRP address on the checkout page. It also adds the decentralized exchange that lives on the XRP Ledger.
     95= 1.1.3 =
     96* Add support for the new [X-addresses](https://xrpaddress.info/).
     97* Change the XRP-address in the QR-code to support more wallets.
    9398
    9499== Acknowledgments ==
  • woo-xrp/trunk/woocommerce-xrp.php

    r2062352 r2196872  
    22/**
    33 * Plugin Name: WooCommerce XRP
    4  * Plugin URI: http://github.com/empatogen/woocommerce-xrp
     4 * Plugin URI: http://github.com/zelest/woocommerce-xrp
    55 * Description: A payment gateway for WooCommerce to accept <a href="https://ripple.com/xrp">XRP</a> payments.
    6  * Version: 1.1.2
     6 * Version: 1.1.3
    77 * Author: Jesper Wallin
    88 * Author URI: https://ifconfig.se/
     
    3030
    3131/* define constants */
    32 define('WCXRP_VERSION', '1.1.2');
     32define('WCXRP_VERSION', '1.1.3');
    3333define('WCXRP_TEXTDOMAIN', 'wc-gateway-xrp');
    3434define('WCXRP_NAME', 'Woocommerce XRP');
     
    140140    }
    141141
     142    $account = $x_account = trim(
     143        get_option('woocommerce_xrp_settings')['xrp_account']
     144    );
     145
     146    $url = sprintf(
     147        'https://xrpaddress.info/api/encode/%s/%d',
     148        $account,
     149        (int)$order->get_meta('destination_tag', true)
     150    );
     151
     152    if (($x_account = get_transient($url)) === false) {
     153        $res = wp_remote_get($url);
     154        if (!is_wp_error($res) && $res['response']['code'] === 200 &&
     155        (($json = json_decode($res['body'])) !== null) &&
     156        isset($json->address)) {
     157            $x_account = $json->address;
     158            set_transient($url, $x_account, 3600);
     159        }
     160    }
     161
    142162    $tag          = $order->get_meta('destination_tag', true);
    143163    $xrp_total    = round($order->get_meta('total_amount', true), 6);
     
    147167
    148168    $result = [
    149         'xrp_account'   => get_option('woocommerce_xrp_settings')['xrp_account'],
     169        'xrp_account'   => $account,
     170        'xrp_x_account' => $x_account,
    150171        'tag'           => $tag,
    151172        'xrp_total'     => $xrp_total,
Note: See TracChangeset for help on using the changeset viewer.