Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin does not support multiple OCC sites #12

Open
lokivog opened this issue Dec 13, 2024 · 0 comments
Open

Plugin does not support multiple OCC sites #12

lokivog opened this issue Dec 13, 2024 · 0 comments

Comments

@lokivog
Copy link

lokivog commented Dec 13, 2024

OCC supports running multiple sites. Payment gateways can be configured at the site level so each site has it's own payment gateway settings. When I configured this plugin to run on a site that was not the default OCC site, it was failing in the SSE because the SSE wasn't retrieving the correct gateway settings for that site. Use the APIs on instances running multiple sites

As described in the documentation above, the OCC APIs have a way to query site specific settings or objects through a header property named "x-ccsite". If this header is not specified then it will query against the default OCC site. The APIs used in the SSE for this plugin do not take this into account so this plugin will only work for the default OCC site.

Some of the APIs I have identified that need to take into account the site id are:

/ccadmin/v1/orders/${orderId}
/ccstore/v1/payment/types
/ccadmin/v1/sitesettings/isv-occ-gateway

Although there may be others.

You should be able to retrieve the siteId value from the incoming webhook request. The siteId will also be on the order object.

Example call using using x-ccsite header

GET /ccadmin/v1/sitesettings/isv-occ-gateway  HTTP/1.1
Authorization: Bearer <access_token>
x-ccsite: 100002

{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant