question

leemorgan avatar image
leemorgan asked g58211702 answered

How can I test OAuth on more than one test merchant?

I am currently working on OAuth and it seems to be working just fine. However, I want to test on a few test merchant accounts just to be sure. However, it is only letting me use one of my two test merchants. One works, the other always gives me a "Not Found" error. Is there any way to test on more than one?

OAuth
14 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.

greg avatar image greg commented ·

Are you using 2 merchants that are linked to your single developer account? If both have the app "installed" (i.e. opted to use the Web App) it should work

0 Likes 0 ·
leemorgan avatar image leemorgan greg commented ·

So, I have a second one that is listed under my developer account, however, it was not created by me. I think maybe I was given access to it or something, but I didn't create it. That one does not work.


That brings me to another problem. I have tried to create another test merchant, however, it won't let me. When the form comes up to fill in the information, it only appears for one or two seconds before it just goes blank. Do you know anything about this?

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

Can you submit a video of this problem so I can get the details to the team that works on the dashboard?

0 Likes 0 ·
Show more comments
Show more comments
David Marginian avatar image
David Marginian Deactivated answered leemorgan commented

No, in order to successfully test the OAuth flow your application needs to be published. In sandbox your application is "published" for test merchants associated with your developer account but not accessible to merchants that are not associated with your developer account (hence the not found).

1 comment
10 |2000

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

leemorgan avatar image leemorgan commented ·

Ok, thanks for the clarification. Would be nice to have that ability...

0 Likes 0 ·
lewis3728 avatar image
lewis3728 answered lewis3728 edited

It sounds like there might be a configuration issue with the second test merchant. Ensure that all OAuth settings are correct for both accounts, much like how actors with high IQ often double-check their scripts for accuracy.

If the problem persists, consult the API documentation or support for further assistance.

10 |2000

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

g58211702 avatar image
g58211702 answered
  • Configure OAuth Settings:

    • Redirect URIs: Ensure that each test merchant’s redirect URI is correctly configured in the OAuth settings. This is the endpoint where the authorization code will be sent after successful authentication.
    • Scopes: Determine the necessary OAuth scopes for each merchant account based on the permissions you need for testing.
  • Implement OAuth Flow:

    • Authorization Request: For each test merchant, initiate the OAuth authorization request using their respective Client ID and redirect URI.
    • Handle Redirects: After authorization, handle the redirect in your application to capture the authorization code.
  • Exchange Code for Tokens:

    • Token Request: Use the authorization code to request access tokens from each test merchant’s token endpoint. Make sure to use the correct Client Secret for each merchant.
    • Store Tokens: Store the access and refresh tokens securely for each merchant account.
  • Perform API Calls:

    • Test Functionality: Use the access tokens to make API calls on behalf of each merchant. Verify that you can perform the necessary operations, such as creating transactions, retrieving data, etc.
    • Test Edge Cases: Test various scenarios such as expired tokens, invalid tokens, and permission errors to ensure your implementation handles them gracefully.
  • Logging and Monitoring:

    • Log Responses: Implement logging for API responses and errors to facilitate troubleshooting and ensure that each test case is validated.
    • Monitor Performance: Keep an eye on the performance and response times for each test merchant to identify any inconsistencies.
  • Review Documentation:

    • Payment Processor Documentation: Refer to the documentation of the payment processor or API for specific guidelines and best practices related to OAuth testing.
  • Testing Tools:

    • Use Postman or Similar Tools: You can use tools like Postman to simulate OAuth flows for multiple merchants without needing to write extensive code.

Regards:

Thepackageslist

10 |2000

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

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