Orders Not Persisting / RESOURCE_NOT_FOUND

michaelmyconreg
New Community Member

Good Morning,

I am having an issue where several of my users, all within the past few days, have been getting errors trying to submit payment. Specifically, the Order ID returned from PayPal shows as RESOURCE_NOT_FOUND when trying to capture the payment.

One example, I have the following request (I am using the Ruby SDK..I have replace at-signs in the code below with __ due to forum limitations):

 

#<PayPalCheckoutSdk::Orders::OrdersCreateRequest:0x000055b3c5f18320 __headers={"Content-Type"=>"application/json"}, __body={"intent"=>"CAPTURE", "purchase_units"=>[{"reference_id"=>999, "amount"=>{"currency_code"=>"USD", "value"=>"139.0", "breakdown"=>{"item_total"=>{"currency_code"=>"USD", "value"=>"139.0"}}}, "payee"=>{"email_address"=>"destination__example.com"}, "description"=>"MyConReg.com - Purchase for Event", "soft_descriptor"=>"MyConReg.com - Event", "items"=>[{"name"=>"MyConReg.com - Event - Ticket", "unit_amount"=>{"currency_code"=>"USD", "value"=>"139.0"}, "quantity"=>1, "description"=>"MyConReg.com - Event - Ticket - weekend", "sku"=>"mcr-event-ticket-weekend", "category"=>"DIGITAL_GOODS"}]}], "application_context"=>{"brand_name"=>"MyConReg.com for Event", "shipping_preference"=>"NO_SHIPPING", "user_action"=>"PAY_NOW"}}, __verb="POST", __path="/v2/checkout/orders?">

 

This returned the following data:

 

#<OpenStruct id="7BF69704EK7167053", links=[#<OpenStruct href="<a href="https://api.paypal.com/v2/checkout/orders/7BF69704EK7167053" target="_blank">https://api.paypal.com/v2/checkout/orders/7BF69704EK7167053</a>", rel="self", method="GET">, #<OpenStruct href="<a href="https://www.paypal.com/checkoutnow?token=7BF69704EK7167053" target="_blank">https://www.paypal.com/checkoutnow?token=7BF69704EK7167053</a>", rel="approve", method="GET">, #<OpenStruct href="<a href="https://api.paypal.com/v2/checkout/orders/7BF69704EK7167053" target="_blank">https://api.paypal.com/v2/checkout/orders/7BF69704EK7167053</a>", rel="update", method="PATCH">, #<OpenStruct href="<a href="https://api.paypal.com/v2/checkout/orders/7BF69704EK7167053/capture" target="_blank">https://api.paypal.com/v2/checkout/orders/7BF69704EK7167053/capture</a>", rel="capture", method="POST">], status="CREATED">

 

I do not get the debug ID in that response, but I believe I was able to match it up to this entry in my API calls: d7a76af462d1a

However, when I attempt to capture the payment with the following request:

 

#<PayPalCheckoutSdk::Orders::OrdersCaptureRequest:0x00007fee0cbdb9e0 __headers={"Content-Type"=>"application/json"}, __body=nil, __verb="POST", __path="/v2/checkout/orders/7BF69704EK7167053/capture?">

 

And this client:

 

#<PayPal::PayPalHttpClient:0x00007fee0c91f6e8 __environment=#<PayPal::LiveEnvironment:0x00007fee0c91f710 __base_url="<a href="https://api.paypal.com" target="_blank">https://api.paypal.com</a>", __client_id="<prod client id>", __client_secret="<prod secret>", __web_url="<a href="https://paypal.com" target="_blank">https://paypal.com</a>">, __injectors=[#<Proc:0x00007fee0c91f3f0 (lambda)>, #<Proc:0x00007fee0c91f238 (lambda)>], __encoder=#<BraintreeHttp::Encoder:0x00007fee0c91f620 __encoders=[#<BraintreeHttp::Json:0x00007fee0c91f5f8>, #<BraintreeHttp::Text:0x00007fee0c91f5d0>, #<BraintreeHttp::Multipart:0x00007fee0c91f558>, #<BraintreeHttp::FormEncoded:0x00007fee0c91f4e0>]>, __refresh_token=nil, __access_token=#<PayPal::AccessToken:0x00007fee0da3ec80 __access_token="<prod access token>", __token_type="Bearer", __expires_in=32069000, __date_create[Removed. Phone #s not permitted]28:09 -0600>>

 

I receive the following response:

 

#<OpenStruct name="RESOURCE_NOT_FOUND", details=[#<OpenStruct field="order_id", value="7BF69704EK7167053", location="path", issue="INVALID_RESOURCE_ID", description="Specified resource ID does not exist. Please check the resource ID and try again.">], message="The specified resource does not exist.", debug_id="ea08787a81e50", links=[#<OpenStruct href="<a href="https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_RESOURCE_ID" target="_blank">https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_RESOURCE_ID</a>", rel="information_link", method="GET">]>

 

By the response from the original create, I am properly creating the order in the Live environment, but I cannot actually capture the order. If I create and then capture the order from a console, I get the appropriate UNPROCESSABLE_ENTITY since the order has not yet been approved.

This only recently started happening in the past few days, and I have not changed any of the relevant code in almost a month.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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