Skip to content
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

Demo app returns always 500 internal server error #183

Open
lukaszkalnik opened this issue Aug 29, 2023 · 1 comment
Open

Demo app returns always 500 internal server error #183

lukaszkalnik opened this issue Aug 29, 2023 · 1 comment

Comments

@lukaszkalnik
Copy link

PayPal Android SDK Version

0.0.13

Environment

Sandbox

Android Version & Device

Android 13, Google Pixel 7

PayPal dependencies

Demo app "as is"

Describe the bug

I have checked out the SDK and wanted to try out the Demo app. However, doesn't matter what option I choose, it always ends up showing the "500 Internal server error" when trying to execute a call.

To reproduce

  1. Start Demo app
  2. Open "Paypal native"
  3. Click "Create order and continue"
  4. In PaypalNativeFragment, click "Get client ID"
  5. Client ID fetched is shown, along with shipping options
  6. Select "No shipping"
  7. Click "Start checkout"
  8. A "500 internal server error" is logged as follows:
2023-08-29 17:07:57.985 --> POST https://sdk-sample-merchant-server.herokuapp.com/orders
2023-08-29 17:07:57.985 Content-Type: application/json; charset=UTF-8
2023-08-29 17:07:57.985 Content-Length: 1376
2023-08-29 17:07:57.986 {"application_context":{"brand_name":"EXAMPLE INC","cancel_url":"https://example.com/cancel","landing_page":"BILLING","locale":"de-DE","return_url":"https://example.com/return","shipping_preference":"NO_SHIPPING","user_action":"CONTINUE"},"intent":"AUTHORIZE","purchase_units":[{"amount":{"breakdown":{"discount":{"currency_code":"USD","value":"00.00"},"handling":{"currency_code":"USD","value":"00.00"},"item_total":{"currency_code":"USD","value":"5.0"},"shipping":{"currency_code":"USD","value":"0,00"},"shipping_discount":{"currency_code":"USD","value":"00.00"},"tax_total":{"currency_code":"USD","value":"00.00"}},"currency_code":"USD","value":"5,00"},"custom_id":"CUST-HighFashions","description":"Sporting Goods","items":[{"category":"PHYSICAL_GOODS","description":"Green XL","name":"T-Shirt","quantity":"1","sku":"sku01","tax":{"currency_code":"USD","value":"00.00"},"unit_amount":{"currency_code":"USD","value":"00.00"}},{"category":"PHYSICAL_GOODS","description":"Running, Size 10.5","name":"Shoes","quantity":"2","sku":"sku02","tax":{"currency_code":"USD","value":"00.00"},"unit_amount":{"currency_code":"USD","value":"00.00"}}],"reference_id":"PUHF","shipping":{"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_1":"CA","admin_area_2":"San Francisco","country_code":"US","postal_code":"94107"}},"soft_descriptor":"HighFashions"}]}
2023-08-29 17:07:57.986 --> END POST (1376-byte body)
2023-08-29 17:07:59.494 <-- 500 Internal Server Error https://sdk-sample-merchant-server.herokuapp.com/orders (1507ms)
2023-08-29 17:07:59.495 Server: Cowboy
2023-08-29 17:07:59.495 Connection: keep-alive
2023-08-29 17:07:59.495 X-Powered-By: Express
2023-08-29 17:07:59.495 Access-Control-Allow-Origin: *
2023-08-29 17:07:59.495 Access-Control-Allow-Credentials: true
2023-08-29 17:07:59.496 Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS,PATCH
2023-08-29 17:07:59.496 Access-Control-Allow-Headers: Origin,X-Requested-With,Content-Type,Accept,content-type,application/json
2023-08-29 17:07:59.496 Content-Type: application/json; charset=utf-8
2023-08-29 17:07:59.496 Content-Length: 2410
2023-08-29 17:07:59.496 Etag: W/"96a-OWJsOoDFE0lYpnRYifqbiFKkq+0"
2023-08-29 17:07:59.496 Date: Tue, 29 Aug 2023 15:07:57 GMT
2023-08-29 17:07:59.496 Via: 1.1 vegur
2023-08-29 17:07:59.498 {"internal":{"message":"Request failed with status code 400","name":"AxiosError","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","Authorization":"Bearer A21AAIH6wxcodgajxCCV_CTuRFc2nmpy773TWnApf9lIhlzWt3mLV1wTPu8PKmfTURi-_BiqMhRZhg_StPO4dAK2o42pSixVw","paypal-request-id":"1693321677297","User-Agent":"axios/0.27.2","Content-Length":1376},"baseURL":"https://api.sandbox.paypal.com","method":"post","url":"/v2/checkout/orders","data":"{\"application_context\":{\"brand_name\":\"EXAMPLE INC\",\"cancel_url\":\"https://example.com/cancel\",\"landing_page\":\"BILLING\",\"locale\":\"de-DE\",\"return_url\":\"https://example.com/return\",\"shipping_preference\":\"NO_SHIPPING\",\"user_action\":\"CONTINUE\"},\"intent\":\"AUTHORIZE\",\"purchase_units\":[{\"amount\":{\"breakdown\":{\"discount\":{\"currency_code\":\"USD\",\"value\":\"00.00\"},\"handling\":{\"currency_code\":\"USD\",\"value\":\"00.00\"},\"item_total\":{\"currency_code\":\"USD\",\"value\":\"5.0\"},\"shipping\":{\"currency_code\":\"USD\",\"value\":\"0,00\"},\"shipping_discount\":{\"currency_code\":\"USD\",\"value\":\"00.00\"},\"tax_total\":{\"currency_code\":\"USD\",\"value\":\"00.00\"}},\"currency_code\":\"USD\",\"value\":\"5,00\"},\"custom_id\":\"CUST-HighFashions\",\"description\":\"Sporting Goods\",\"items\":[{\"category\":\"PHYSICAL_GOODS\",\"description\":\"Green XL\",\"name\":\"T-Shirt\",\"quantity\":\"1\",\"sku\":\"sku01\",\"tax\":{\"currency_code\":\"USD\",\"value\":\"00.00\"},\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"00.00\"}},{\"category\":\"PHYSICAL_GOODS\",\"description\":\"Running, Size 10.5\",\"name\":\"Shoes\",\"quantity\":\"2\",\"sku\":\"sku02\",\"tax\":{\"currency_code\":\"USD\",\"value\":\"00.00\"},\"unit_amount\":{\"currency_code\":\"USD\",\"value\":\"00.00\"}}],\"reference_id\":\"PUHF\",\"shipping\":{\"address\":{\"address_line_1\":\"123 Townsend St\",\"address_line_2\":\"Floor 6\",\"admin_area_1\":\"CA\",\"admin_area_2\":\"San Francisco\",\"country_code\":\"US\",\"postal_code\":\"94107\"}},\"soft_descriptor\":\"HighFashions\"}]}"},"code":"ERR_BAD_REQUEST","status":400}}
2023-08-29 17:07:59.498 <-- END HTTP (2410-byte body)

Expected behavior

The Demo app works out of the box or some guidance is provided, how to set it up.

Screenshots

No response

@scannillo
Copy link
Collaborator

👋 Hi @lukaszkalnik - thanks for using the PayPal Android SDK and for opening an issue with us.

On the latest main branch (running on a Samsung Galaxy S22 device) I am able to use the Demo app just fine. Maybe you have some sort of firewall blocking our herokuapp.com sample server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants