gocodebox / gocodebox/lifterlms

User Can Create Two Active Orders with Same Access Plan with On Hold Orders

Open
#2,212 0 comments 0 reactions 0 assignees View on GitHub
Severity: Normal Type: Bug
Dominant language
PHP
Stars
212
Forks
140
Avg merge
2d 14h
Merged PRs (30d)
19

Description

### Reproduction Steps

+ Create a recurring order
+ Cause the order to fail and go into on hold
+ Go into that course and purchase the same access plan
+ Once that new order is created head into your user dashboard->order history
+ Select the on hold order and update payment method

(Our Notes from the other issue: This would happen regardless of the payment gateway. The idea is that the user should be resuming the existing order from their dashboard not by checking out and "picking up" that order.

should only be if they have a resumable order (LLMS_Order::can_be_resumed()) that matches what they're purchasing. )

### Expected Behavior

+ If an order for that user on a specific course is active, they should not be allowed to pay twice and the new order should block any future payments even with the on hold order, or maybe if there is an on hold order the user can't purchase the course anew? They should be met with an error message to go to their dashboard and update their payment method.

### Actual Behavior

+ You can purchase the access plan for the course, then go in and update the payment method for that same course so you have two active orders with the same access plan running.

### Error Messages / Logs

+ Include any relevant error messages or log files
```

```

### System and Environment Information

System Report

```
Wordpress
-------------------------------------------

Home Url: https://natalie-test-site.myliftersite.com
Site Url: https://natalie-test-site.myliftersite.com
Login Url: https://natalie-test-site.myliftersite.com/wp-login.php
Version: 6.0
Debug Mode: No
Debug Log: No
Debug Display: Yes
Locale: en_US
Multisite: No
Page For Posts: Not Set
Page On Front: Homepage (#1398) [https://natalie-test-site.myliftersite.com/]
Permalink Structure: /%postname%/
Show On Front: page
Wp Cron: Yes

Settings
-------------------------------------------

Version: 7.0.0-alpha.4
Db Version: 7.0.0-alpha.4
Course Catalog: Course Catalog (#35) [https://natalie-test-site.myliftersite.com/courses/]
Membership Catalog: Membership Catalog (#36) [https://natalie-test-site.myliftersite.com/memberships/]
Student Dashboard: Dashboard (#38) [https://natalie-test-site.myliftersite.com/dashboard/]
Checkout Page: Checkout (#715) [https://natalie-test-site.myliftersite.com/checkout/]
Course Catalog Per Page: 9
Course Catalog Sorting: menu_order,ASC
Membership Catalog Per Page: 9
Membership Catalog Sorting: menu_order
Site Membership: Not Set
Courses Endpoint: my-courses
Edit Endpoint: edit-account
Lost Password Endpoint: lost-password
Vouchers Endpoint: redeem-voucher
Autogenerate Username: no
Password Strength Meter: no
Minimum Password Strength:
Terms Required: yes
Terms Page: Activate (#443) [https://natalie-test-site.myliftersite.com/activate/]
Checkout Names:
Checkout Address:
Checkout Phone:
Checkout Email Confirmation: no
Open Registration: yes
Registration Names:
Registration Address:
Registration Phone:
Registration Voucher:
Registration Email Confirmation: no
Account Names:
Account Address:
Account Phone:
Account Email Confirmation: no
Confirmation Endpoint: confirm-payment
Force Ssl Checkout: no
Country: CA
Currency: CAD
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Decimals: 2
Trim Zero Decimals: no
Recurring Payments: yes
Email From Address: team+sandbox@lifterlms.com
Email From Name: A LifterLMS Sandbox
Email Footer Text:
Email Header Image:
Cert Bg Width: 1123
Cert Bg Height: 794
Cert Legacy Compat: no

Constants
-------------------------------------------

LLMS_REMOVE_ALL_DATA: undefined
LLMS_REST_DISABLE: undefined
LLMS_SITE_FEATURE_RECURRING_PAYMENTS: undefined
LLMS_SITE_IS_CLONE: undefined

Gateways
-------------------------------------------

PayPal: Enabled
PayPal Test Mode: Enabled
PayPal Logging: yes
PayPal Order: 1
PayPal (Legacy): Enabled
PayPal (Legacy) Test Mode: Enabled
PayPal (Legacy) Logging: yes
PayPal (Legacy) Order: 1
Manual: Enabled
Manual Logging: no
Manual Order: 1

Server
-------------------------------------------

Mysql Version: 5.7.38
Php Curl: Yes
Php Default Timezone: UTC
Php Fsockopen: Yes
Php Max Input Vars: 5000
Php Max Upload Size: 512 MB
Php Memory Limit: 256M
Php Post Max Size: 1024M
Php Soap: Yes
Php Suhosin: No
Php Time Limt: 30
Php Version: 8.0.21
Software: Apache/2.4.54 (Unix) OpenSSL/1.1.1
Wp Memory Limit: 256M

Browser
-------------------------------------------

HTTP USER AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

Theme
-------------------------------------------

Name: BuddyBoss Theme
Version: 2.0.4
Themeuri: https://www.buddyboss.com/
Authoruri: https://www.buddyboss.com/
Template:
Child Theme: No
Llms Support: No

Plugins
-------------------------------------------

LifterLMS: 7.0.0-alpha.4
LifterLMS PayPal Payment Gateway: 3.0.0-alpha.3
User Switching: 1.6.0
WP Mail Logging: 1.10.4

Integrations
-------------------------------------------

BbPress: No
BuddyPress: No

Template Overrides
-------------------------------------------

content-certificate.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 4.5.0)
achievements/loop.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.14.0)
achievements/template.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.14.6)
certificates/actions.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 6.0.0)
certificates/content-legacy.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 6.0.0)
certificates/content.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 6.0.0)
certificates/loop.php (ver: 3.14.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.14.0)
certificates/preview.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.14.0)
course/author.php (ver: 4.11.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.25.0)
course/lesson-preview.php (ver: 5.7.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 4.4.0)
course/syllabus.php (ver: 4.4.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 4.4.0)
loop/author.php (ver: 3.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.0.0)
loop/content.php (ver: 3.14.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.14.0)
loop/featured-image.php (ver: 3.35.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.35.0)
myaccount/dashboard-section.php (ver: 3.30.1): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.30.1)
myaccount/header.php (ver: 3.14.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.14.0)
myaccount/my-grades-single-table.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.24.0)
myaccount/my-notifications.php (ver: 3.30.3): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.30.3)
myaccount/my-orders.php (ver: 3.17.6): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.17.6)
myaccount/view-order.php (ver: 6.0.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.35.0)
product/access-plan-pricing.php (ver: 3.29.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.29.0)
quiz/results-attempt-questions-list.php (ver: 5.3.0): /srv/users/manager/apps/natalie-test-site/public/wp-content/themes/buddyboss-theme/lifterlms/ (ver: 3.17.8)

```

This issue has be recreated:
+ [x] Locally
+ [x] On a staging site
+ [ ] On a production website
+ [x] With only LifterLMS and a default theme

### Browser, Device, and Operating System Information

+ Browser name and version
+ Operating System name and version
+ Device name and version (if applicable)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.