Changeset 3263293
- Timestamp:
- 03/28/2025 07:56:09 AM (12 months ago)
- Location:
- pay-via-barion-for-woocommerce/trunk
- Files:
-
- 4 edited
-
includes/class-wc-gateway-barion-ipn-handler.php (modified) (5 diffs)
-
includes/class-wc-gateway-barion-pixel.php (modified) (1 diff)
-
index.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pay-via-barion-for-woocommerce/trunk/includes/class-wc-gateway-barion-ipn-handler.php
r3250059 r3263293 24 24 exit; 25 25 26 27 26 $payment_details = $this->barion_client->GetPaymentState($_GET['paymentId']); 28 27 29 28 if(!empty($payment_details->Errors)) { 30 WC_Gateway_Barion::log('GetPaymentState returned errors. Payment details: ' . json_encode($payment_details));29 $this->gateway::log('GetPaymentState returned errors. Payment details: ' . json_encode($payment_details)); 31 30 32 31 exit; … … 51 50 $order = new WC_Order($payment_details->PaymentRequestId); 52 51 } 53 54 52 $this->gateway::log("IPN called, orderid: ".$order->get_id()); 53 54 if ($_GET['paymentId'] !=$this->gateway->get_barion_payment_id($order)) { 55 $this->gateway::log("IPN blocked, Barion id is not match."); 56 exit; 57 } 58 55 59 if(empty($order)) { 56 WC_Gateway_Barion::log('Invalid PaymentRequestId: ' . $_GET['paymentId'] . '. Payment details: ' . json_encode($payment_details)); 57 60 $this->gateway::log('Invalid PaymentRequestId: ' . $_GET['paymentId'] . '. Payment details: ' . json_encode($payment_details)); 58 61 exit; 59 62 } 60 61 63 $order->add_order_note(__('Barion callback received.', 'pay-via-barion-for-woocommerce') . ' paymentId: "' . $_GET['paymentId'] . '"'); 62 64 if ($order->meta_exists('_barion_payment_close')) { 63 65 $order->add_order_note(__('Barion callback ignored, the payment closed.', 'pay-via-barion-for-woocommerce')); 64 exit; 66 $this->gateway::log("IPN ignored, order closed"); 67 exit; 65 68 } 66 69 if(apply_filters('woocommerce_barion_custom_callback_handler', false, $order, $payment_details)) { … … 90 93 91 94 $order->add_order_note(__('Payment succeeded via Barion.', 'pay-via-barion-for-woocommerce')); 92 $this->gateway->payment_complete($order, $this->find_transaction_id($payment_details, $order)); 93 if ($order->meta_exists('_barion_payment_close')) { 95 if ($order->meta_exists('_barion_payment_close')) { 94 96 $order->update_meta_data("_barion_payment_close", 1); 95 97 } else { … … 97 99 } 98 100 $order->save(); 101 102 $this->gateway->payment_complete($order, $this->find_transaction_id($payment_details, $order)); 99 103 exit; 100 104 } … … 122 126 123 127 $order->update_status('failed', __('Payment failed via Barion.', 'pay-via-barion-for-woocommerce')); 124 WC_Gateway_Barion::log('Payment failed. Payment details: ' . json_encode($payment_details));128 $this->gateway::log('Payment failed. Payment details: ' . json_encode($payment_details)); 125 129 exit; 126 130 } -
pay-via-barion-for-woocommerce/trunk/includes/class-wc-gateway-barion-pixel.php
r2812812 r3263293 8 8 * @param $barion_pixel_id string 9 9 */ 10 public function __construct($barion_pixel_id) { 11 $this->barion_pixel_id = $barion_pixel_id; 10 public function __construct() { 11 $settings = get_option('woocommerce_barion_settings'); 12 $this->barion_pixel_id = $settings["barion_pixel_id"]; 12 13 13 14 add_action('wp_head', [$this, 'add_barion_pixel'], 999999); -
pay-via-barion-for-woocommerce/trunk/index.php
r3251799 r3263293 4 4 Plugin URI: http://github.com/szelpe/woocommerce-barion 5 5 Description: Adds the ability to WooCommerce to pay via Barion 6 Version: 3.8. 46 Version: 3.8.5 7 7 Author: Aron Ocsvari <ugyfelszolgalat@bitron.hu> 8 8 Author URI: https://bitron.hu … … 54 54 require_once 'includes/class-wc-gateway-barion-pixel.php'; 55 55 56 $this->barion_pixel = new WC_Gateway_Barion_Pixel(); 56 57 57 58 add_filter('woocommerce_payment_gateways', [$this, 'woocommerce_add_gateway_barion_gateway']); … … 121 122 $this->profile_monitor = new WC_Gateway_Barion_Profile_Monitor(); 122 123 $this->wc_gateway_barion = new WC_Gateway_Barion($this->profile_monitor); 123 $this->barion_pixel = new WC_Gateway_Barion_Pixel($this->wc_gateway_barion->get_barion_pixel_id());124 124 $methods[] = $this->wc_gateway_barion; 125 125 return $methods; -
pay-via-barion-for-woocommerce/trunk/readme.txt
r3250177 r3263293 89 89 90 90 == Changelog == 91 = 3.8.5 = 92 * Fix: Barion pixel load issue 93 * Fix: Prevent order status changes from expired payments when successful payment exists 91 94 = 3.8.2 = 92 95 * Fix: HPOS compatibility issue
Note: See TracChangeset
for help on using the changeset viewer.