Skip to content

Conversation

@toupper
Copy link
Contributor

@toupper toupper commented Nov 3, 2022

Closes: #8016

Description

With this PR we provide the option to route the WordPress.com API requests to your wp.com sandbox e.g to use the sandbox billing mode instead of production when creation orders after an In-App purchase. That way, we avoid having to set up Charles to map the request, and ensure that all calls to create an order goes to the wp.com sandbox.
Firstly I intended to add a debug setting to switch on or off routing to the wp.com sandbox, but I ended up discarding that given the complexity of configuring all remotes to use the wp.com username. After that, I hardcoded the sandbox URL with the logged in WordPress.com username, but also rejected it because of security reasons.

Testing instructions

Prerequisites

  • Have a wp.com sandbox linked to the same wp.com account you use to authenticate in the app
  • Login in the terminal to that sandbox via ssh so the server can start
  • Enable the wpcom-api-base-url environment variable and add your WordPress.com API base URL.

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@toupper toupper added type: task An internally driven task. feature: in-app purchases Related to In-app purchases and subscriptions labels Nov 3, 2022
@toupper toupper added this to the 11.2 milestone Nov 3, 2022
@toupper toupper requested a review from koke November 3, 2022 20:22
@wpmobilebot
Copy link
Collaborator

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8021-1019697 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Member

@koke koke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, it works great and the implementation doesn't get any simpler 👏🏽

@toupper toupper merged commit 7a2fb0e into trunk Nov 4, 2022
@toupper toupper deleted the issue/8016-iap-wpcom-sandbox-environment-variable branch November 4, 2022 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: in-app purchases Related to In-app purchases and subscriptions type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add debug option to sandbox wpcom public API

4 participants