Can a payment gateway get the original shop name

Highlighted
New Member
5 0 0

Hello,

I'm developing a payment gateway for Shopify. When my gateway receives a payment order, I would like to be able to know the shop name for the shop that is making the order. As per the request values documention, this can be obtained through the x_shop_name parameter. However, I've noticed that if I rename the shop, the name in x_shop_name gets updated as well with the new name. As my end goal would be to call the Admin API with this shop name, this is problematic, because the Admin API requires the unique original shop name (the one that appears in {shopname}.myshopify.com).

Is it possible for the gateway to obtain this original shop name ?

 

0 Likes
Highlighted
Shopify Partner
88 14 28

Hi,

By what I understand, you are creating a payment gateway app for Shopify. I would suggest whenever a store admin install your app on his shop and he has correctly installed, you can make a request at this endpoint: 

/admin/shop.json

That endpoint gets basic details about the shop, then you can save myshopify_domain and the domain somewhere in your database for future reference.

0 Likes
New Member
5 0 0

Jayvin,

Thank you for your answer ! In fact, I'm already doing the solution you describe (and the call to /admin/shop.json is optional, because the Shopify domain is already exchanged during the OAuth 2 flow). As you can imagine, I'm storing the shopify domain in my database alongside some internal merchant ID of my system.

My problem specifically relates to the ability of a single merchant of my system to have multiple Shopify shops. For example, imagine that I have a merchant 123 who has two shops A and B. When my gateway receives a payment, I'm able to identify the merchant the payment is for through the x_account_id parameter. However, I don't know if the payment comes from shop A or shop B (because the shop name, which could have been renamed, could possibly not exist in my database, or worst, it could be conflated with another shop), and so, I can't use the Admin API to obtain more information about the order.

0 Likes