question

vsalidev avatar image
vsalidev asked David Marginian Deactivated commented

IFrame/API setup (returns 500 with requestedRegionContext error)

I am attempting to convert a web app from PayPal's old PayFlow integration to the Hosted IFrame/REST API payment model. My website uses the hosted IFrame to get a "source" token which it passes up with order data to the site's REST API; that API then calls Clover's REST API to create a charge. This will be a very simple implementation for payment processing only; we will not be using order/customer data or any Clover tools for anything like refunds, etc.

In the sandbox I can use the interface provided in the documentation, supplying the source token from the iframe and getting a successful charge object back. However, when attempting the same thing through our server's REST API, Clover sends this:


{"message":"500 Internal Server Error","error":{"code":"processing_error","message":"Invalid data: requestedRegionContext does not equal requestedRegionContext"}}


What am I doing wrong?

REST APIecommerce
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

You are seeing this error when you make the charge request? When did you make this request? Can you provide the merchant id (in a moderator's only comment please)?

11 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vsalidev avatar image vsalidev commented ·

That's correct, yes - it's what's returned when we hit the /v1/charges endpoint with a POST request. Here's a request body sample:

{"currency":"usd","tax_amount":" 0","amount":19900,"source":"clv_XXXXXXXXXXXXXXX"} (removed by me).

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ vsalidev commented ·

When did you make this request? What is the merchant id? I can't help without this information because I don't see any errors in our log that match the message you are seeing.

0 Likes 0 ·
vsalidev avatar image vsalidev David Marginian ♦♦ commented ·
It was in the sandbox earlier today. Is there a way I can send the request headers and other information privately?
0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community