-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
broken content-length header upon captureOrder PHP #30
Comments
I could do captureOrder without using this package via rest API cURL. |
Hey @jarielbalberona Can you also share the code snippet you used to execute the I also wanted to reproduce this issue on my end and I am interested in the requests you are trying to send using this PHP SDK. I want to see why the API returns the status |
I integrated PayPal checkout on my laravel application using paypal/paypal-server-sdk. each time I make a payment, the payment capture phase works well in my localhost but not on live server. Below is the log I get during the failed capture process:
Kindly note that on both local and live server I am using the sandbox API. Below is the controller class handling the payment: `<?php namespace App\Http\Controllers; use App\Events\OrderCreated; class PaypalController extends Controller
} |
Everything works fine on my local setup with the sandbox environment.
I deployed the changes to my server and used a live environment, the Paypal buttons works fine but the Paypal card fields does not upon captureOrder.
createOrder response ~ PHP
{ "data": { "id": "6Jxxxxxx1U", "status": "CREATED", "links": [ { "href": "https://api.paypal.com/v2/checkout/orders/6Jxxxxxx1U", "rel": "self", "method": "GET" }, { "href": "https://www.paypal.com/checkoutnow?token=6Jxxxxxx1U", "rel": "approve", "method": "GET" }, { "href": "https://api.paypal.com/v2/checkout/orders/6Jxxxxxx1U", "rel": "update", "method": "PATCH" }, { "href": "https://api.paypal.com/v2/checkout/orders/6Jxxxxxx1U/capture", "rel": "capture", "method": "POST" } ] }, "status_code": 201, "message": "Success" }
Confirm payment source ~ React Paypal package API call response
{ "id": "6Jxxxxxx1U", "intent": "CAPTURE", "status": "APPROVED", "payment_source": { "card": { "name": "Jaxxxxna", "last_digits": "XXXX", "expiry": "XXX-03", "brand": "MASTERCARD", "available_networks": [ "MASTERCARD" ], "type": "CREDIT", "bin_details": { "bin": "54xxxx89", "issuing_bank": "XXX", "bin_country_code": "XX", "products": [ "PLATINUM" ] } } }, "purchase_units": [ { "reference_id": "XXXXXX", "amount": { "currency_code": "USD", "value": "1.00", "breakdown": { "item_total": { "currency_code": "USD", "value": "1.00" } } }, "payee": { "email_address": "[email protected]", "merchant_id": "xxxxxx" }, "description": "XXXXXX", "custom_id": "xxxxxx", "soft_descriptor": "" } ], "links": [ { "href": "https://api.paypal.com/v2/checkout/orders/6Jxxxxxx1U", "rel": "self", "method": "GET" }, { "href": "https://api.paypal.com/v2/checkout/orders/6Jxxxxxx1U/capture", "rel": "capture", "method": "POST" } ] }
captureOrder response PH
{ "data": null, "status_code": 400, "message": "broken content-length header" }
Again, the setup works on my local with sandbox mode.
The text was updated successfully, but these errors were encountered: