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

fix(esp-sync): get last payment amount from actual completed order #3726

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Feb 4, 2025

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 be 0 instead of the recurring amount.

Closes 1200550061930446/1209296877142332.

How to test the changes in this Pull Request:

  1. On a site with RAS setup and connected, create a subscription product with a non-zero cost and a free trial period.
  2. On release, purchase a subscription for that product as a new reader.
  3. In the connected ESP or via logging, observe that the NP_Last Payment Amount is set to the cost of the subscription, even though the NP_Total Paid value is correctly 0.
  4. Check out this branch and trigger a resync of this contact via any means.
  5. Confirm that NP_Last Payment Amount is now 0 after the resync.
  6. Trigger a manual early renewal of the subscription to charge the customer, and confirm that NP_Last Payment Amount is now the amount charged in the renewal order.
  7. Smoke test purchasing a subscription product and/or resyncing a contact who has previously purchased a subscription WITHOUT a free trial period and confirm that the NP_Last Payment Amount is still accurate.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo added the [Status] Needs Review The issue or pull request needs to be reviewed label Feb 4, 2025
@dkoo dkoo self-assigned this Feb 4, 2025
@dkoo dkoo requested a review from a team as a code owner February 4, 2025 23:57
Copy link
Member

@naxoc naxoc left a comment

Choose a reason for hiding this comment

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

Yup! I tested and smoke tested and it looks good.

ok

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Feb 6, 2025
@dkoo dkoo merged commit db284c1 into release Feb 6, 2025
10 checks passed
@dkoo dkoo deleted the hotfix/last-payment-amount branch February 6, 2025 16:48
matticbot pushed a commit that referenced this pull request Feb 6, 2025
## [5.13.1](v5.13.0...v5.13.1) (2025-02-06)

### Bug Fixes

* **esp-sync:** get last payment amount from actual completed order ([#3726](#3726)) ([db284c1](db284c1))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.13.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants