| @@ -738,9 +738,9 @@ | ||
| 738 | 738 | return $res; |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | 741 | |
| 742 | - // This is Vipps Checkout IOK 2021-06-19 | |
| 742 | + // This is Checkout IOK 2021-06-19 | |
| 743 | 743 | // Updated for V3 2023-01-09 |
| 744 | 744 | public function initiate_checkout($customerinfo,$order,$returnurl,$authtoken,$idempotency_key=null) { |
| 745 | 745 | $command = 'checkout/v3/session'; |
| 746 | 746 | $static_shipping = $order->get_meta('_vipps_static_shipping'); |
| @@ -814,9 +814,9 @@ | ||
| 814 | 814 | $transaction['paymentDescription'] = substr($transaction['paymentDescription'],0,90); // Add some slack if this happens. IOK 2019-10-17 |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | |
| 818 | - ## Vipps Checkout Shipping | |
| 818 | + ## Checkout Shipping | |
| 819 | 819 | $shippingcallback = $this->gateway->shipping_details_callback_url($authtoken, $orderid); |
| 820 | 820 | $shippingcallback .= "/v3/checkout/" . $vippsorderid . "/shippingDetails"; # because this is how eCom v2 does it. |
| 821 | 821 | $gw = $this->gateway; |
| 822 | 822 | if ($needs_shipping) { |
| @@ -927,11 +927,12 @@ | ||
| 927 | 927 | // Should return a map from other_method => ['gw'=>'gateway key or any or empty string] |
| 928 | 928 | $other_payment_methods = apply_filters('woo_vipps_checkout_external_payment_methods', VippsCheckout::instance()->external_payment_methods(), $order); |
| 929 | 929 | if (!empty($other_payment_methods)) { |
| 930 | 930 | $others = []; |
| 931 | + $cb = wp_create_nonce('vipps_gw_' . $orderid); | |
| 931 | 932 | foreach ($other_payment_methods as $methodkey => $methoddata) { |
| 932 | 933 | $chooseanother = ['action'=>'vipps_gw', 'o'=>$orderid]; |
| 933 | - $chooseanother['cb'] = wp_create_nonce('vipps_gw'); | |
| 934 | + $chooseanother['cb'] = $cb; | |
| 934 | 935 | $chooseanother['gw'] = ($methoddata['gw'] ?? ""); |
| 935 | 936 | $others[] = ['paymentMethod' => $methodkey, 'redirectUrl'=> add_query_arg($chooseanother,admin_url("admin-post.php")) ]; |
| 936 | 937 | } |
| 937 | 938 | if (!empty($others)) { |
| @@ -1271,9 +1272,9 @@ | ||
| 1271 | 1272 | return $this->call_qr_merchant_redirect($action, $id, $url); |
| 1272 | 1273 | } |
| 1273 | 1274 | public function delete_merchant_redirect_qr ($id) { |
| 1274 | 1275 | $action = "DELETE"; |
| 1275 | - return $this->call_qr_merchant_redirect($action, $id, $url); | |
| 1276 | + return $this->call_qr_merchant_redirect($action, $id); | |
| 1276 | 1277 | } |
| 1277 | 1278 | private function call_qr_merchant_redirect($action, $id, $url=null, $accept='image/svg+xml') { |
| 1278 | 1279 | $command = 'qr/v1/merchant-redirect/'; |
| 1279 | 1280 | if ($action != "POST") $command .= $id; |