Changeset 3365680
- Timestamp:
- 09/22/2025 09:50:23 AM (6 months ago)
- Location:
- allpay-payment-gateway/trunk
- Files:
-
- 3 edited
-
allpay-gateway.php (modified) (1 diff)
-
classes/class-allpay.php (modified) (7 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
allpay-payment-gateway/trunk/allpay-gateway.php
r3353274 r3365680 6 6 * Author: Allpay 7 7 * Author URI: https://allpay.co.il 8 * Version: 1.1. 28 * Version: 1.1.3 9 9 * Text Domain: allpay-payment-gateway 10 10 * Domain Path: /languages -
allpay-payment-gateway/trunk/classes/class-allpay.php
r3353274 r3365680 39 39 } 40 40 41 $chunks = []; 42 $wh_params = ['amount', 'order_id', 'currency', 'status', 'card_mask', 'card_brand', 'foreign_card', 'add_field_1', 'add_field_2', 'receipt']; 43 foreach($wh_params as $k) { 44 if(isset($_REQUEST[$k])) { 45 $chunks[$k] = sanitize_text_field($_REQUEST[$k]); 46 } 47 } 48 $sign = $this->get_signature($chunks); 41 $sign = $this->get_signature($_REQUEST); 49 42 $order_id = $_REQUEST['order_id']; 50 43 $status = (int)$_REQUEST['status']; … … 112 105 $customer_order = wc_get_order( $order_id ); 113 106 114 $environment_url = 'https://allpay.to/app/?show=getpayment&mode=api 6';107 $environment_url = 'https://allpay.to/app/?show=getpayment&mode=api8'; 115 108 116 109 $user_id = get_current_user_id(); … … 158 151 } 159 152 153 $tax_included = wc_tax_enabled() && wc_prices_include_tax(); 154 160 155 // Items 161 156 $items = []; … … 168 163 'price' => $price, 169 164 'qty' => $quantity, 165 'vat' => ($tax_included ? 1 : 0) 170 166 ]; 171 167 } … … 174 170 'name' => $fee->get_name(), 175 171 'price' => $fee->get_total(), 176 'qty' => 1 172 'qty' => 1, 173 'vat' => ($tax_included ? 1 : 0) 177 174 ]; 178 175 } … … 181 178 'name' => $customer_order->get_shipping_method(), 182 179 'price' => $shipping_total, 183 'qty' => 1 180 'qty' => 1, 181 'vat' => ($tax_included ? 1 : 0) 184 182 ]; 185 183 } … … 216 214 } 217 215 218 public function get_signature($data) { 219 ksort($ data);216 public function get_signature($params) { 217 ksort($params); 220 218 $chunks = []; 221 foreach($data as $k => $v) { 222 if(is_array($v)) { 223 foreach ($v as $item) { 219 220 foreach ($params as $k => $v) { 221 if (is_array($v)) { 222 ksort($v); 223 224 foreach ($v as $subkey => $item) { 224 225 if (is_array($item)) { 225 226 ksort($item); 226 227 foreach($item as $name => $val) { 227 if ( trim($val)!== '') {228 if ($val !== '') { 228 229 $chunks[] = $val; 229 } 230 } 230 231 } 231 } 232 } elseif ($item !== '') { 233 $chunks[] = $item; 234 } 232 235 } 233 } else { 234 if (trim($v) !== '') { 235 $chunks[] = $v; 236 } 237 } 236 } elseif ($v !== '') { 237 $chunks[] = $v; 238 } 238 239 } 239 $signature = hash('sha256', implode(':', $chunks) . ':' . $this->api_key); 240 return $signature; 241 } 240 241 $signature = implode(':', $chunks) . ':' . $this->api_key; 242 $signature = hash('sha256', $signature); 243 return $signature; 244 } 242 245 243 246 public function get_lang() { -
allpay-payment-gateway/trunk/readme.txt
r3353274 r3365680 4 4 Requires PHP: 5.6 5 5 Requires at least: 4.7 6 Tested up to: 6. 6.27 Stable tag: 1.1. 26 Tested up to: 6.8.2 7 Stable tag: 1.1.3 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 64 64 65 65 == Changelog == 66 = 1.1.2 - 31TH AUGUST 2025 = 67 * Fix: Order status wasn't always changing to paid. 66 = 1.1.3 - 22 SEPTEMBER 2025 = 67 * New: VAT calculation support. 68 69 = 1.1.2 - 31 AUGUST 2025 = 70 * Fix: Order status wasn’t always changing to paid. 68 71 69 72 = 1.1.1 - 20TH FEBRUARY 2025 = … … 83 86 = 1.0.2 - THURSDAY, 10TH AUGUST 2023 = 84 87 * Improvement: Tested with WordPress v6.3. 88 89 = 1.1.3 - THURSDAY, 10TH SEPTEMBER 2025 = 90 * Fix: inclusion of taxes in payment
Note: See TracChangeset
for help on using the changeset viewer.