I'm working with the PayPal Partner Referral API to onboard merchants for different products. However, I’m encountering an error when trying to request multiple products together in a single
<script src="https://www.paypal.com/sdk/js?client-id=<?php echo PAYPAL_SANDBOX ? PAYPAL_SANDBOX_CLIENT_ID : PAYPAL_PROD_CLIENT_ID; ?>&disable-funding=credit¤cy=<?php echo CURRENCY; ?>&merchant-id=<?=$paypal_merchant_id;?>"></script><script> document .getElementById("checkoutForm") .addEventListener("submit", function(event) { event.preventDefault(); var form = document.getElementById("checkoutForm"); var totalamount = $('#totalamount').val(); var trans_charges = $('#trans_charges').val(); console.log("Total Amount", totalamount, "Trans charges", trans_charges, "loggedin", loggedin); // render button paypal.Buttons({ createOrder: function(data, actions) { // Create an order on the client side with the cart details return actions.order.create({ purchase_units: [{ amount: { currency_code: 'USD', value: totalamount // Replace with the actual cart total }, payee: { email_address: '<?=$paypal_partner_merchant_id;?>' // an email }, payment_instruction: { disbursement_mode: 'INSTANT', platform_fees: [{ amount: { currency_code: 'USD', value: '<?=$site_settin["trans_charges"];?>' // Platform fee }, payee: { merchant_id: '<?=$paypal_merchant_id;?>' // an alpha-numeric key from paypal } }] } }] }); }, onApprove: function(data, actions) { console.log("Data", data); // Capture the funds from the transaction return actions.order.capture().then(function(details) { console.log("Details", details); }); }, onError: function(err) { console.error('PayPal Button Error:', err); } }).render('#checkoutForm'); });</script>
this opens up a paypal popup goes through the complete process
and when I complete the payment it gives me error; .can any one help me thanks