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

Unable to re-purchase a rate plan that I have just canceled #265

Closed
mxr576 opened this issue Apr 15, 2021 · 2 comments · Fixed by #285
Closed

Unable to re-purchase a rate plan that I have just canceled #265

mxr576 opened this issue Apr 15, 2021 · 2 comments · Fixed by #285
Assignees
Labels
bug Something isn't working

Comments

@mxr576
Copy link
Contributor

mxr576 commented Apr 15, 2021

Description

Unable to re-purchase a rate plan with this module that I have just canceled with end date: now. Although this is possible via API calls. (The Apigee Monetization API backend supports it.)

My gut says the root cause of the issue is here because this method does an incorrect calculation based on dates.

Steps to Reproduce

  1. Go to Prices & Plans and subscribe to a rate plan with start date: today
  2. On your Purchased plans page, cancel the subscription with end date: now (or subscribe to an overlapping rate plan which has the same side effect)

Actual Behavior

  1. The cancalled rate plan is visible under "Active and Future Purchased Plans" on "Purchased plans"
  2. You cannot subscribe to the rate plan again because the module does not allows it, it says "You have already purchased...".

Expected Behavior

  1. The cancalled rate plan is visible under "Cancelled and Expired Purchased Plans" on "Purchased plans"
  2. You can subscribe to the rate plan again, immediatelly - since you have cancelled your subscription with end date: immediatelly.

Screenshots

Notes

Version Info

1.8.0

@shishir-intelli
Copy link
Collaborator

shishir-intelli commented May 14, 2021

@mxr576 thanks for reporting this issue.
PR #285

Here it was only returning today's date and not proper datetime.
Example: Datetime Object 2021-05-14 00:00:00.000000"

In PR, implemented DateTimeImmutable and now getting "DateTimeImmutable Object ( [date] => 2021-05-14 07:25:29.652616 [timezone_type] => 3 [timezone] => UTC )" with proper datetime which resolves the further If-else logic.

Note: In the existing code it allows user to be subscribed for the cancelled date and next day the subscription actually gets cancelled and user can re purchase the cancelled plan next day.
In this PR the user can immediately cancel his subscription and also can re-purchase it again.

@cnovak here I am not sure why the cancelled "end date" is "start date" if user selects "NOW" for cancelling the subscription (4G), any reason for doing this?

@cnovak
Copy link
Collaborator

cnovak commented May 14, 2021

@giteshk @raakesh-blokhra I do not know the answer to @shishir-intelli's question in #265 (comment), do either of you have info?

@raakesh-blokhra raakesh-blokhra removed this from the 8.x-1.11 milestone Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants