I have a problem and cannot solve it for a quite while. I am implementing the PayPal express checkout and cannot remove the shipping since website is selling marketing and don't need shipping options. I have this JSON with the configuration and from the documentation and some other posts I should implement the "no_shipping" attribute to value of 1. But I cannot find where should I place this line. Or maybe this is done differently. Appreciate any kind of help.
$_SESSION['expressCheckoutPaymentData'] = '{
"transactions":[
{
"amount":{
"currency":"USD",
"total":"320",
"details":{
"subtotal":"300"
}
},
"description":"creating a payment",
"item_list":{
"items":[
{
"name":"Camera",
"quantity":"1",
"price":"300",
"sku":"1",
"currency":"USD"
}
]
}
}
],
"payer":{
"payment_method":"paypal"
},
"intent":"sale",
"redirect_urls":{
"cancel_url":"'.$cancelUrl.'",
"return_url":"'.$placeOrderUrl.'"
}
}';
Try this:
$_SESSION['expressCheckoutPaymentData'] = '{
"payment": {
"transactions": [{
"amount": {
"currency": "USD",
"total": "320",
"details": {
"subtotal": "300"
}
},
"description": "creating a payment",
"item_list": {
"items": [{
"name": "Camera",
"quantity": "1",
"price": "300",
"sku": "1",
"currency": "USD"
}]
}
}]
},
"experience": {
"input_fields": {
"no_shipping": 1
}
}
}';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With