ActiveResource::ServerError (Failed. Response code = 502. Response message = Bad Gateway.)

New Member
3 0 1

Hello!

I have a problem with the

ShopifyAPI::RecurrngCharge

response sometimes.

 

My code receives new created recurrent charge every 10 seconds while it has the 'pending' status and until it becomes 'declined' or 'active'. Sometimes I receive a 502 error from Shopify. I can't find any related information on the Shopify Response Status Codes page.

 

I don't use any proxies. It's just a request from ruby gem 'shopify-api' to the shopify API instance.

 

 

0 Likes
Shopify Staff
Shopify Staff
618 45 84

 

Hi @lazynick,

 

Can you provide some more information around what you're doing? Why are you creating a new charge every 10 seconds? It sounds like your issue may be resolved by following our billing guide here: https://help.shopify.com/en/api/guides/charging-for-your-app/guides/implement-billing-model#implemen....

 

You should only create the one charge, then handle the scenario where the merchant either accepts or declines it. Once you're doing that, let me know if the error persists.

 

Cheers,

0 Likes
New Member
3 0 1

I meant that I just get the status of the current payment. I do not create payments every 10 seconds

0 Likes
Highlighted
Shopify Staff
Shopify Staff
618 45 84

 

Ahh, I see that now. I must have misread your initial post. Can you include the request id of one of the failing requests? You can find it in the response headers for the request that is failing.

 

Cheers,

0 Likes