Plugin Directory

Changeset 3132635


Ignore:
Timestamp:
08/08/2024 10:33:11 AM (18 months ago)
Author:
hsuvant
Message:

Version 1.1.4

Location:
visma-pay-embedded-card-payment-gateway/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • visma-pay-embedded-card-payment-gateway/trunk/includes/lib/Visma/VismaPay.php

    r3010037 r3132635  
    1717    const API_URL = 'https://www.vismapay.com/pbwapi';
    1818
    19     public function __construct($api_key, $private_key, $version = 'w3.1', VismaPayConnector $connector = null)
     19    public function __construct($api_key, $private_key, $version = 'w3.2', VismaPayConnector $connector = null)
    2020    {
    2121        $this->api_key = $api_key;
     
    7171            $payment_data['plugin_info'] .= '0';
    7272
    73         $payment_data['plugin_info'] .= '|1.1.3';
     73        $payment_data['plugin_info'] .= '|1.1.4';
    7474
    7575        return $this->makeRequest($url, $payment_data);
  • visma-pay-embedded-card-payment-gateway/trunk/readme.txt

    r3010037 r3132635  
    44Tags: payment gateway, visma, pay, verkkomaksut, korttimaksut, vismapay
    55Requires at least: 3.3
    6 Tested up to: 6.4.1
     6Tested up to: 6.6.1
    77Stable tag: trunk
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010WC requires at least: 3.0.0
    11 WC tested up to: 8.3.0
     11WC tested up to: 9.1.4
    1212
    1313Visma Pay plugin for Woocommerce.
     
    4141
    4242== Changelog ==
     43
     44= 1.1.4 =
     45* Changed Visma Pay API version to w3.2 which supports decimals in tax percent
     46* Updated 'tested up to' versions.
    4347
    4448= 1.1.3 =
  • visma-pay-embedded-card-payment-gateway/trunk/visma-pay-embedded-card-payment-gateway.php

    r3010037 r3132635  
    44 * Plugin URI: https://www.vismapay.com/docs
    55 * Description: Visma Pay Payment Gateway Embedded Card Integration for Woocommerce
    6  * Version: 1.1.3
     6 * Version: 1.1.4
    77 * Author: Visma
    88 * Author URI: https://www.visma.fi/vismapay/
     
    1010 * Domain Path: /languages
    1111 * WC requires at least: 3.0.0
    12  * WC tested up to: 8.3.0
     12 * WC tested up to: 9.1.4
    1313 */
    1414
     
    343343            $lang = $this->get_lang();
    344344
    345             $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.1', new Visma\VismaPayWPConnector());
     345            $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.2', new Visma\VismaPayWPConnector());
    346346
    347347            if($this->send_receipt == 'yes')
     
    395395            {
    396396                $available = false;
    397                 $payment_methods = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.1', new Visma\VismaPayWPConnector());
     397                $payment_methods = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.2', new Visma\VismaPayWPConnector());
    398398                try
    399399                {
     
    565565                        $pbw_extra_info = '';
    566566
    567                         $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.1', new Visma\VismaPayWPConnector());
     567                        $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.2', new Visma\VismaPayWPConnector());
    568568                        try
    569569                        {
     
    804804            $successful = false;
    805805            require_once(plugin_dir_path( __FILE__ ).'includes/lib/visma_pay_loader.php');
    806             $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.1', new Visma\VismaPayWPConnector());
     806            $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.2', new Visma\VismaPayWPConnector());
    807807            try
    808808            {
     
    851851            $card_token = $subscription->get_meta('visma_pay_embedded_card_token', true, 'edit');
    852852
    853             $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.1', new Visma\VismaPayWPConnector());
     853            $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.2', new Visma\VismaPayWPConnector());
    854854
    855855            $order_number = (strlen($this->ordernumber_prefix)  > 0) ?  $this->ordernumber_prefix . '_' . $order->get_id() : $order->get_id();
     
    969969            $card_token = $subscription->get_meta($key, true, 'edit');
    970970
    971             $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.1', new Visma\VismaPayWPConnector());
     971            $payment = new Visma\VismaPay($this->api_key, $this->private_key, 'w3.2', new Visma\VismaPayWPConnector());
    972972
    973973            try
     
    10041004                {
    10051005                    $tax_rate = reset($tax_rates);
    1006                     $line_tax = (int)round($tax_rate['rate']);
     1006                    $line_tax = number_format($tax_rate['rate'], 2, '.', '');
    10071007                }
    10081008                else
    10091009                {
    1010                     $line_tax = ($order->get_item_total($item, false, false) > 0) ? round($order->get_item_tax($item, false)/$order->get_item_total($item, false, false)*100,0) : 0;
     1010                    $i_total = $order->get_item_total($item, false, false);
     1011                    $i_tax = $order->get_item_tax($item, false);
     1012                    $line_tax = ($i_total > 0) ? number_format($i_tax / $i_total * 100, 2, '.', '') : 0;
    10111013                }
    10121014               
     
    10821084            $wc_s_postcode = $order->get_shipping_postcode();
    10831085            $wc_s_country = $order->get_shipping_country();
     1086            $wc_b_phone = $order->get_billing_phone();
    10841087
    10851088            $payment->addCustomer(
     
    10971100                    'shipping_address_city' => htmlspecialchars($wc_s_city),
    10981101                    'shipping_address_zip' => htmlspecialchars($wc_s_postcode),
    1099                     'shipping_address_country' => htmlspecialchars($wc_s_country)
     1102                    'shipping_address_country' => htmlspecialchars($wc_s_country),
     1103                    'phone' => preg_replace('/[^0-9+ ]/', '', $wc_b_phone)
    11001104                )
    11011105            );
Note: See TracChangeset for help on using the changeset viewer.