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
[Backend Receipts] Update store and actions to account for backend receipts #11848
[Backend Receipts] Update store and actions to account for backend receipts #11848
Conversation
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
As always, only one reviewer is needed 🙇 |
@bozidarsevo if you keep having troubles to log into the testing site, an alternative is to create a new site that uses the WooCommerce development branch for the API:
*version might be different, but you'll see something similar in wp-admin |
Closes #11828
#11847 must be merged first.
Description
This PR updates the business logic in order to fetch a receipt from the new API endpoint when the proper action is invoked.
We also update the UI to display a temporary
[Debug] See Backend Receipt
button for all orders for developer builds. The existingSee Receipt
will be displayed as always, this means that if the local-generated receipt exists on the device, then its row will also be shown below (we don't change the legacy logic for locally-generated receipts).This is only for testing purposes and to keep changes small, in following PRs we'll add further validation (feature flag + Woo version) and display only the local receipt or the backend receipt, but not both.
Changes
ReceiptAction
which will either return aReceipt
or anError
from the remote.seeReceipt
row to the tableview datasource, this is feature flagged so will only be shown in dev builds.Receipt
or anError
. At the moment we just log the result to the console.Testing instructions
Success:
[Debug] See Backend Receipt
Failure:
[Debug] See Backend Receipt
Screenshots