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

3.10.0 Can no longer create plans with Stripe after changing currency #11649

Closed
uksitebuilder opened this issue Mar 9, 2020 · 9 comments
Closed
Assignees
Labels
bug [triage] something behaving unexpectedly

Comments

@uksitebuilder
Copy link

uksitebuilder commented Mar 9, 2020

Issue Summary

Changed price symbol to GBP for membership pricing plans

Edited template to add variable for pricing symbol

Symbol does not show

Subscribe button no longer redirects to stripe.

Technical details:

Ghost Version: 3.10.0
Node Version: 10.19.0
Browser/OS: Chrome (latest) macos
Database: mySQL 5.7.29 on Ubuntu 18.04

@uksitebuilder uksitebuilder changed the title 3.0.10 Can no longer create plans with Striped after changing currency 3.10.0 Can no longer create plans with Striped after changing currency Mar 9, 2020
@uksitebuilder uksitebuilder changed the title 3.10.0 Can no longer create plans with Striped after changing currency 3.10.0 Can no longer create plans with Stripe after changing currency Mar 9, 2020
@naz naz added admin-api bug [triage] something behaving unexpectedly labels Mar 10, 2020
@uksitebuilder
Copy link
Author

Reopen please as updating to 3.11.0 did not solve the issue

@naz
Copy link
Contributor

naz commented Mar 10, 2020

@uksitebuilder can you please confirm if the migrations to 3.11.0 have run? Also could you provide the values from following query on your mysql instance:

SELECT `value` 
FROM `settings` 
WHERE `key` = 'members_subscription_settings' \G

Please make sure to redact Stripe keys to avoid exposing them.

@uksitebuilder
Copy link
Author

I am assuming the migrations have run

Running ghost migrate in ghost-cli returns no migrations needed.

SQL output is as follows:

mysql> SELECT `value` -> FROM `settings` -> WHERE `key` = 'members_subscription_settings' \G; *************************** 1. row *************************** value: {"isPaid":false,"fromAddress":"noreply","allowSelfSignup":true,"paymentProcessors":[{"adapter":"stripe","config":{"secret_token":"sk_live_redacted","public_token":"pk_live_redacted","product":{"name":"My Services"},"plans":[{"name":"Monthly","currency":"gbp","interval":"month","amount":500},{"name":"Yearly","currency":"gbp","interval":"year","amount":5000},{"currency":"gbp"},{"currency":"gbp"},{"currency":"gbp"},{"currency":"gbp"},{"currency":"gbp"}],"currency":"gbp"}}]}

@naz
Copy link
Contributor

naz commented Mar 10, 2020

To confirm if migration has been run, could you try a following query:

select * from migrations where version = '3.11'

The result should be something like:

mysql> select * from migrations where version = '3.11';
+----+--------------------------------------------------------------+---------+----------------+
| id | name                                                         | version | currentVersion |
+----+--------------------------------------------------------------+---------+----------------+
| 98 | 01-remove-broken-complimentary-plan-from-members-settings.js | 3.11    | 3.10           |
+----+--------------------------------------------------------------+---------+----------------+

@uksitebuilder
Copy link
Author

Version and Current Version = 3.11 when running that query

@naz
Copy link
Contributor

naz commented Mar 10, 2020

3.11 is a correct value, the one I posted was from my dev instance 👍

This is puzzling. The root cause of the bug are those {"currency":"gbp"} values you can see in config.plans[] in members_subscription_settings JSON. The migration should have removed them df05641#diff-699adf57adedebcd9ff7223af7a5a515R45-R47 and the Ghost-Admin fix is making sure these values don't get into the data at any point.

@naz
Copy link
Contributor

naz commented Mar 10, 2020

@uksitebuilder can you confirm if you have refreshed the "admin" page after running upgrade on the Ghost instance? The only scenario I can think of right now is that the migrations have run but the 3.10.0 version of admin made a request editing the currency 🤔

@naz naz reopened this Mar 10, 2020
@uksitebuilder
Copy link
Author

Admin was refreshed, caches cleared, even tried running in Incognito mode.

@naz naz self-assigned this Mar 11, 2020
naz added a commit to naz/Ghost-Admin that referenced this issue Mar 11, 2020
closes TryGhost/Ghost#11649

- This is a temporary solution which complimenta migration from 3.10.0 to 3.11.0 where Admin Client was still getting settings broken settings from 3.10.0
- This fix makes sure that after changing plan on the client side, plans without interval are removed from the member's plans data
naz added a commit to naz/Ghost that referenced this issue Mar 11, 2020
refs TryGhost#11649

- After migrations are run through Ghost-CLI the instance needs to catch up with pottential changes that were done in settings table. Otherwise it ends up in obsolete state after version update
naz added a commit to TryGhost/Admin that referenced this issue Mar 13, 2020
…hanged

refs TryGhost/Ghost#11649

- The bug was changing all complimentary plan prices to the value of yearly.
- This is another point to putting in place validation of plan setting object on the server side so we don't accidentally allow values like this to slip through
@naz
Copy link
Contributor

naz commented Mar 30, 2020

The exact steps to fix the issue were given on the community forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

3 participants