Capture API call issue- Undefined property admin_area_1

sangio90
Contributor
Contributor

Hi,

Every now and then, when I call the

/v2/checkout/orders/{order_id}/capture?

API (POST METHOD)

I receive this Exception:

Capture API call issue: Undefined property: stdClass::$admin_area_1

I think it's something related to the user's address data. But this throws an Exception in my App and, even though the payment was successfully completed, I catch the exception and my App does not confirm the order.

Is there anything I can do about it?
Thanks

Login to Me Too
2 REPLIES 2

MTS_Chiranjeevi
Moderator
Moderator

Good day @sangio90,

 

Thank you for posting to the PayPal community.

 

I would suggest to please cross check your Order Capture API request call and also pass valid address details Create Order API call.

 

https://developer.paypal.com/docs/api/orders/v2/#orders_create 

https://developer.paypal.com/docs/api/orders/v2/#orders_capture 

https://developer.paypal.com/docs/api/orders/v2/#definition-shipping_detail.address_portable 

 

Merchants should refer the success response returned from Order Capture API call and confirm the order in your App.

 

If your still facing any issues, please create a MTS ticket via - https://www.paypal-support.com/s/?language=en_US  with the detail information and error details.

 

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

sangio90
Contributor
Contributor

Hi @MTS_Chiranjeevi 

My payload is this (and 90/95% of the times it works flawlessly)

 

[
"intent" => "CAPTURE",
"purchase_units" => [
[
"reference_id" => "text",
"description" => "text",
"amount" => [
"currency_code" => "EUR",
"value" => $amount,
]
]
],
];

 

I read on the Docs that I could use another block like this

 

"payment_source"=> [
"paypal"=> [
"experience_context"=> [
"payment_method_preference"=> "IMMEDIATE_PAYMENT_REQUIRED",
"payment_method_selected"=> "PAYPAL",
"brand_name"=> "Dibotek Spa",
"locale"=> "it-IT",
"landing_page"=> "LOGIN",
"shipping_preference"=> "SET_PROVIDED_ADDRESS",
"user_action"=> "PAY_NOW",
"return_url"=> "https://example.com/returnUrl",
"cancel_url"=> "https://example.com/returnUrl"
]
],
],

Do I need to pass it? I thought that Paypal was able to use the user's provided address. If I'm forced to pass these options, do I need to pass the entire block or I can just pass "shipping_preference"?

 

Thanks

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.