Plugin Directory

Changeset 3014084


Ignore:
Timestamp:
12/25/2023 02:08:47 PM (2 years ago)
Author:
allpay
Message:

1.0.4 - MONDAY, 25TH DECEMBER 2023

  • New: Added payment page language support for ENG, HEB and RUS
  • Fix: Payment error for logged in users on some WP versions
  • Improvement: Aligned with new Allpay secure payment page
Location:
allpay-payment-gateway/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • allpay-payment-gateway/trunk/allpay-gateway.php

    r2951701 r3014084  
    22/**
    33 * Plugin Name: Allpay payment gateway
    4  * Plugin URI: https://www.allpay.co.il/integrations/wordpress
    5  * Description: Allpay Payment Gateway for Wordpress WooCommerce.
     4 * Plugin URI: https://www.allpay.co.il/integrations/woocommerce
     5 * Description: Allpay Payment Gateway for WooCommerce.
    66 * Author: Allpay
    77 * Author URI: https://allpay.co.il
    8  * Version: 1.0.3
     8 * Version: 1.0.4
    99 * Text Domain: allpay-payment-gateway
    1010 * Domain Path: /languages
    11  * Tested up to: 6.3
    12  * WC tested up to: 8.0.1
     11 * Tested up to: 6.4
     12 * WC tested up to: 8.4.0
    1313 * WC requires at least: 3.0
    1414 *
  • allpay-payment-gateway/trunk/allpay.php

    r2948164 r3014084  
    3939    public function webhook() { 
    4040        $chunks = [];
    41         $chunks["status"]   = (int)$_REQUEST['status'];
    42         if(isset($_REQUEST['amount'])) {
    43             $chunks["amount"] = sanitize_text_field($_REQUEST['amount']);
    44         }       
    45         if(isset($_REQUEST['order_id'])) {
    46             $chunks["order_id"] = sanitize_text_field($_REQUEST['order_id']);
    47         }
    48         if(isset($_REQUEST['currency'])) {
    49             $chunks["currency"] = sanitize_text_field($_REQUEST['currency']);
    50         }
    51         if(isset($_REQUEST['add_field_1'])) {
    52             $chunks["add_field_1"] = sanitize_text_field($_REQUEST['add_field_1']);
    53         }
    54         if(isset($_REQUEST['add_field_2'])) {
    55             $chunks["add_field_2"] = sanitize_text_field($_REQUEST['add_field_2']);
    56         }
     41        $wh_params = ['amount', 'order_id', 'currency', 'status', 'card_mask', 'card_brand', 'foreign_card', 'add_field_1', 'add_field_2'];
     42        foreach($wh_params as $k) {
     43            if(isset($_POST[$k])) {
     44                $chunks[$k] = sanitize_text_field($_POST[$k]);
     45            }
     46        }
    5747        $sign       = $this->get_signature($chunks);
    5848        $order_id   = (int)$_REQUEST['order_id'];
     
    126116        $customer_order = new WC_Order( $order_id );
    127117
    128         $environment_url = 'https://allpay.to/app/?show=getpayment&mode=api1';
     118        $environment_url = 'https://allpay.to/app/?show=getpayment&mode=api2';
     119
     120        $first_name = $customer_order->get_shipping_first_name();
     121        $last_name = $customer_order->get_shipping_last_name();
     122        if (empty($first_name) || empty($last_name)) {
     123            $first_name = $customer_order->get_billing_first_name();
     124            $last_name = $customer_order->get_billing_last_name();
     125        }
     126        $full_name = trim($first_name . ' ' . $last_name);
    129127
    130128        $request = array(
     
    132130            "amount"                => $customer_order->order_total,
    133131            "currency"              => get_woocommerce_currency(),
     132            "lang"                  => $this->get_lang(),
    134133            "order_id"              => str_replace( "#", "", $customer_order->get_order_number() ),
    135             "client_name"           => $customer_order->billing_first_name . ' ' . $customer_order->billing_last_name,
     134            "client_name"           => $full_name,
    136135            "client_phone"          => $customer_order->billing_phone,
    137136            "client_email"          => $customer_order->billing_email,
    138137            "notifications_url"     => get_home_url() . '/?wc-api=allpay',
    139138            "success_url"           => $customer_order->get_checkout_order_received_url(),
    140             "error_url"             => $customer_order->get_checkout_order_received_url(),
     139            "backlink_url"          => home_url()
    141140        );
    142141
     
    203202    }
    204203
     204    public function get_lang() {
     205        $langs = [
     206            'en' => 'ENG',
     207            'ru' => 'RUS',
     208            'he' => 'HEB'
     209        ];
     210        $lng = 'en';
     211        if ( defined('ICL_LANGUAGE_CODE') ) {
     212            $lng =  ICL_LANGUAGE_CODE;
     213        } elseif ( function_exists('pll_current_language') ) {
     214            $lng = pll_current_language();
     215        } else {
     216            $locale = get_locale();
     217            $locale_parts = explode('_', $locale);
     218            $lng = strtolower($locale_parts[0]);           
     219        }
     220        if(isset($langs[$lng])) {
     221            return $langs[$lng];
     222        }
     223        return 'ENG';
     224    }
     225
    205226}
  • allpay-payment-gateway/trunk/readme.txt

    r2951701 r3014084  
    11=== Allpay Payment Gateway ===
    22Contributors: Allpay
    3 Tags: payment provider, Israel, платежная система, Израиль
     3Tags: payment provider, Israel, платежная система, Израиль, Allpay
    44Requires PHP: 5.6
    55Requires at least: 4.7
    6 Tested up to: 6.3
    7 Stable tag: 1.0.3
     6Tested up to: 6.4
     7Stable tag: 1.0.4
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    1212
    1313== Description ==
    14 The plugin allows you to accept payments online from all over the world (except for the Russian Federation) with crediting to a bank account in Israel. Cards of major brands are supported: Visa, Mastercard, American Express, Diners, and Apple Pay.
     14The plugin allows you to accept payments online from all over the world (except for the Russian Federation) with crediting to a bank account in Israel. Cards of major brands are supported: Visa, Mastercard, American Express, Diners, Discover and JCB.
    1515
    1616It supports installments and digital invoices.
     
    2323
    2424### Security
    25 Payments made via a secure channel and are safe for the client, as well as transparent and legal for your business.
     25Payments made via secure channel and are safe for the client, as well as transparent and legal for your business.
    2626
    2727### Features
    28281. Low commission.
    29292. Support by e-mail, Telegram and WhatsApp in English, Russian and Hebrew.
    30 3. Cards Visa, Mastercard, American Express, Diners, Isracard.
     303. Cards Visa, Mastercard, American Express, Diners, Isracard, JCB.
    31314. Payments from all over the world (except for the Russian Federation).
    32325. Installments.
     
    34347. Automatic currency converter.
    35358. Mobile application for Android and iPhone.
     369. Payments pages languages: English, Hebrew and Russian.
    3637
    3738== Screenshots ==
     
    5657
    5758= How frequent are funds credited to the bank account? =
    58 Every 9th day of month.
     59Every 15th day of month.
    5960
    6061== Changelog ==
     62= 1.0.4 - MONDAY, 25TH DECEMBER 2023 =
     63* New: Added payment page language support for ENG, HEB and RUS
     64* Fix: Payment error for logged in users on some WP versions
     65* Improvement: Aligned with new Allpay payment page
     66
    6167= 1.0.2 - THURSDAY, 10TH AUGUST 2023 =
    6268* Improvement: Tested with Wordpress v6.3
  • allpay-payment-gateway/trunk/uninstall.php

    r2948164 r3014084  
    1515 *
    1616 *
    17  * @since      1.0.2
     17 * @since      1.0.3
    1818 *
    1919 * @package    allpay-payment-gateway
Note: See TracChangeset for help on using the changeset viewer.