fix(esp-sync): get last payment amount from actual completed order #3726
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Fixes a bug where the
NP_Last Payment Amount
value isn't always accurate. Currently we assume that if the subscription is active, the last payment must match its renewal price, but that's not always the case—for example, for new subscriptions that include a free trial period. In this scenario, the subscription in free trial mode will be active and have a successful completed parent order, but that parent order's amount will be0
instead of the recurring amount.Closes
1200550061930446/1209296877142332
.How to test the changes in this Pull Request:
release
, purchase a subscription for that product as a new reader.NP_Last Payment Amount
is set to the cost of the subscription, even though theNP_Total Paid
value is correctly0
.NP_Last Payment Amount
is now0
after the resync.NP_Last Payment Amount
is now the amount charged in the renewal order.NP_Last Payment Amount
is still accurate.Other information: