Changeset 3132635
- Timestamp:
- 08/08/2024 10:33:11 AM (18 months ago)
- Location:
- visma-pay-embedded-card-payment-gateway/trunk
- Files:
-
- 3 edited
-
includes/lib/Visma/VismaPay.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
visma-pay-embedded-card-payment-gateway.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
visma-pay-embedded-card-payment-gateway/trunk/includes/lib/Visma/VismaPay.php
r3010037 r3132635 17 17 const API_URL = 'https://www.vismapay.com/pbwapi'; 18 18 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) 20 20 { 21 21 $this->api_key = $api_key; … … 71 71 $payment_data['plugin_info'] .= '0'; 72 72 73 $payment_data['plugin_info'] .= '|1.1. 3';73 $payment_data['plugin_info'] .= '|1.1.4'; 74 74 75 75 return $this->makeRequest($url, $payment_data); -
visma-pay-embedded-card-payment-gateway/trunk/readme.txt
r3010037 r3132635 4 4 Tags: payment gateway, visma, pay, verkkomaksut, korttimaksut, vismapay 5 5 Requires at least: 3.3 6 Tested up to: 6. 4.16 Tested up to: 6.6.1 7 7 Stable tag: trunk 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 WC requires at least: 3.0.0 11 WC tested up to: 8.3.011 WC tested up to: 9.1.4 12 12 13 13 Visma Pay plugin for Woocommerce. … … 41 41 42 42 == 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. 43 47 44 48 = 1.1.3 = -
visma-pay-embedded-card-payment-gateway/trunk/visma-pay-embedded-card-payment-gateway.php
r3010037 r3132635 4 4 * Plugin URI: https://www.vismapay.com/docs 5 5 * Description: Visma Pay Payment Gateway Embedded Card Integration for Woocommerce 6 * Version: 1.1. 36 * Version: 1.1.4 7 7 * Author: Visma 8 8 * Author URI: https://www.visma.fi/vismapay/ … … 10 10 * Domain Path: /languages 11 11 * WC requires at least: 3.0.0 12 * WC tested up to: 8.3.012 * WC tested up to: 9.1.4 13 13 */ 14 14 … … 343 343 $lang = $this->get_lang(); 344 344 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()); 346 346 347 347 if($this->send_receipt == 'yes') … … 395 395 { 396 396 $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()); 398 398 try 399 399 { … … 565 565 $pbw_extra_info = ''; 566 566 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()); 568 568 try 569 569 { … … 804 804 $successful = false; 805 805 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()); 807 807 try 808 808 { … … 851 851 $card_token = $subscription->get_meta('visma_pay_embedded_card_token', true, 'edit'); 852 852 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()); 854 854 855 855 $order_number = (strlen($this->ordernumber_prefix) > 0) ? $this->ordernumber_prefix . '_' . $order->get_id() : $order->get_id(); … … 969 969 $card_token = $subscription->get_meta($key, true, 'edit'); 970 970 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()); 972 972 973 973 try … … 1004 1004 { 1005 1005 $tax_rate = reset($tax_rates); 1006 $line_tax = (int)round($tax_rate['rate']);1006 $line_tax = number_format($tax_rate['rate'], 2, '.', ''); 1007 1007 } 1008 1008 else 1009 1009 { 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; 1011 1013 } 1012 1014 … … 1082 1084 $wc_s_postcode = $order->get_shipping_postcode(); 1083 1085 $wc_s_country = $order->get_shipping_country(); 1086 $wc_b_phone = $order->get_billing_phone(); 1084 1087 1085 1088 $payment->addCustomer( … … 1097 1100 'shipping_address_city' => htmlspecialchars($wc_s_city), 1098 1101 '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) 1100 1104 ) 1101 1105 );
Note: See TracChangeset
for help on using the changeset viewer.