">
" alt="Merchant Logo" class="merchant-logo">
Failed to get access token
location.href="'.pp_get_paymentlink($payment_id).'";'; } }else{ ?>
Transaction ID already exits
Payment not completed.
"CAPTURE", "purchase_units" => [[ "amount" => [ "currency_code" => "USD", "value" => $amount ] ]], "application_context" => [ "return_url" => getCurrentUrl(), "cancel_url" => getCurrentUrl() ] ]; $ch = curl_init("$base_url/v2/checkout/orders"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($order_data)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/json", "Authorization: Bearer $access_token" ]); $response = curl_exec($ch); curl_close($ch); $order = json_decode($response, true); $order_id = $order['id'] ?? null; $approval_url = $order['links'][1]['href'] ?? null; // link[1] usually is approve link if (!$order_id || !$approval_url) { ?>
Failed to create PayPal order
location.href="' . $approval_url . '"'; } } } ?>