Changeset 3453123
- Timestamp:
- 02/03/2026 05:32:45 PM (3 weeks ago)
- Location:
- zafepay
- Files:
-
- 4 edited
- 1 copied
-
tags/1.0.7 (copied) (copied from zafepay/trunk)
-
tags/1.0.7/includes/class-wc-gateway-zafepay.php (modified) (2 diffs)
-
tags/1.0.7/zafepay.php (modified) (1 diff)
-
trunk/includes/class-wc-gateway-zafepay.php (modified) (2 diffs)
-
trunk/zafepay.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
zafepay/tags/1.0.7/includes/class-wc-gateway-zafepay.php
r3168820 r3453123 132 132 $email = $email ? $email : '[email protected]'; 133 133 134 // Discounts: total and coupon codes 135 $discount_total = (int) number_format((float) $order->get_discount_total(), 0, ',', ''); 136 $coupon_codes = $order->get_coupon_codes(); 137 138 // Shipping: total cost and method(s) 139 $shipping_total = (int) number_format((float) $order->get_shipping_total(), 0, ',', ''); 140 $shipping_methods = array(); 141 foreach ($order->get_items('shipping') as $item_id => $shipping_item) { 142 $shipping_methods[] = array( 143 'method_id' => $shipping_item->get_method_id(), 144 'method_title' => $shipping_item->get_method_title(), 145 'total' => (int) number_format((float) $shipping_item->get_total(), 0, ',', ''), 146 ); 147 } 148 $shipping_method_label = $order->get_shipping_method(); 149 134 150 $create_payment = wp_remote_post( 135 151 $this->base_url . '/v1/external/woocommerce/orders', … … 140 156 ], 141 157 'timeout' => 15, 142 'body' => wp_json_encode([ 143 'order_id' => $order_id, 144 'currency' => $currency, 145 'cancel_url' => $cancel_url, 146 'total_amount' => $amount, 147 'products' => $products, 148 'callback_url' => $callback_url, 149 'success_url' => $return_url, 150 'buyer_name' => $first_name . ' ' . $last_name, 151 'buyer_email' => $email, 152 ]) 158 'body' => wp_json_encode(array_merge( 159 [ 160 'order_id' => $order_id, 161 'currency' => $currency, 162 'cancel_url' => $cancel_url, 163 'total_amount' => $amount, 164 'products' => $products, 165 'callback_url' => $callback_url, 166 'success_url' => $return_url, 167 'buyer_name' => $first_name . ' ' . $last_name, 168 'buyer_email' => $email, 169 ], 170 array_filter([ 171 'discount_total' => $discount_total > 0 ? $discount_total : null, 172 'coupon_codes' => !empty($coupon_codes) ? $coupon_codes : null, 173 'shipping_total' => $shipping_total > 0 ? $shipping_total : null, 174 'shipping_method' => $shipping_method_label ? $shipping_method_label : null, 175 'shipping_methods' => !empty($shipping_methods) ? $shipping_methods : null, 176 ], function ($v) { return $v !== null; }) 177 )) 153 178 ] 154 179 ); -
zafepay/tags/1.0.7/zafepay.php
r3312744 r3453123 6 6 * Author: Zafepay 7 7 * Author URI: https://zafepay.com 8 * Version: 1.0. 68 * Version: 1.0.7 9 9 * Requires at least: 5.7 10 10 * Tested up to: 6.8 -
zafepay/trunk/includes/class-wc-gateway-zafepay.php
r3168820 r3453123 132 132 $email = $email ? $email : '[email protected]'; 133 133 134 // Discounts: total and coupon codes 135 $discount_total = (int) number_format((float) $order->get_discount_total(), 0, ',', ''); 136 $coupon_codes = $order->get_coupon_codes(); 137 138 // Shipping: total cost and method(s) 139 $shipping_total = (int) number_format((float) $order->get_shipping_total(), 0, ',', ''); 140 $shipping_methods = array(); 141 foreach ($order->get_items('shipping') as $item_id => $shipping_item) { 142 $shipping_methods[] = array( 143 'method_id' => $shipping_item->get_method_id(), 144 'method_title' => $shipping_item->get_method_title(), 145 'total' => (int) number_format((float) $shipping_item->get_total(), 0, ',', ''), 146 ); 147 } 148 $shipping_method_label = $order->get_shipping_method(); 149 134 150 $create_payment = wp_remote_post( 135 151 $this->base_url . '/v1/external/woocommerce/orders', … … 140 156 ], 141 157 'timeout' => 15, 142 'body' => wp_json_encode([ 143 'order_id' => $order_id, 144 'currency' => $currency, 145 'cancel_url' => $cancel_url, 146 'total_amount' => $amount, 147 'products' => $products, 148 'callback_url' => $callback_url, 149 'success_url' => $return_url, 150 'buyer_name' => $first_name . ' ' . $last_name, 151 'buyer_email' => $email, 152 ]) 158 'body' => wp_json_encode(array_merge( 159 [ 160 'order_id' => $order_id, 161 'currency' => $currency, 162 'cancel_url' => $cancel_url, 163 'total_amount' => $amount, 164 'products' => $products, 165 'callback_url' => $callback_url, 166 'success_url' => $return_url, 167 'buyer_name' => $first_name . ' ' . $last_name, 168 'buyer_email' => $email, 169 ], 170 array_filter([ 171 'discount_total' => $discount_total > 0 ? $discount_total : null, 172 'coupon_codes' => !empty($coupon_codes) ? $coupon_codes : null, 173 'shipping_total' => $shipping_total > 0 ? $shipping_total : null, 174 'shipping_method' => $shipping_method_label ? $shipping_method_label : null, 175 'shipping_methods' => !empty($shipping_methods) ? $shipping_methods : null, 176 ], function ($v) { return $v !== null; }) 177 )) 153 178 ] 154 179 ); -
zafepay/trunk/zafepay.php
r3312744 r3453123 6 6 * Author: Zafepay 7 7 * Author URI: https://zafepay.com 8 * Version: 1.0. 68 * Version: 1.0.7 9 9 * Requires at least: 5.7 10 10 * Tested up to: 6.8
Note: See TracChangeset
for help on using the changeset viewer.