Payment currency in EU

Likewise, updated to 3.11.0 and nothing seems to have been fixed, all previously reported problems still exist.

@giacomosilli @uksitebuilder could you confirm if migrations for 3.11.0 have run and make sure that the admin-client has been refreshed after the update?
Also would be useful to see the values you have in the databases for following query:

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

:warning: Before posting them please make sure to redact secret_token and public_token values. Thanks!

@naz

  Name        β”‚ Location       β”‚ Version β”‚ Status               β”‚ URL                 β”‚ Port β”‚ Process Manager β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ******-it β”‚ /var/www/ghost β”‚ 3.11.0  β”‚ running (production) β”‚ https://******-.it β”‚ 2368 β”‚ systemd      


{
  "allowSelfSignup": true,
  "fromAddress": "noreply",
  "isPaid": false,
  "paymentProcessors": [
    {
      "adapter": "stripe",
      "config": {
        "currency": "eur",
        "plans": [
          {
            "amount": 500,
            "currency": "eur",
            "interval": "month",
            "name": "Monthly"
          },
          {
            "amount": 5000,
            "currency": "eur",
            "interval": "year",
            "name": "Yearly"
          },
          {
            "currency": "eur"
          },
          {
            "currency": "eur"
          },
          {
            "currency": "eur"
          }
        ],
        "product": {
          "name": "******-"
        },
        "public_token": "pk_test_******-",
        "secret_token": "sk_test_*******"
      }
    }
  ]
}

Regarding the refresh of the Admin panel, I would say yes, I work on it, I have refreshed it countless times.

If you want more information, don’t hesitate to ask

Any updates? :slight_smile:

Gentle bump on this - Any news ?

Hey @uksitebuilder. I am working on detailed β€œmanual” way to fix this issue.

We decided to not introduce any more automatic migrations for the problem, as it has been overly complicating different edge cases. Will try to give a more comprehensive instructions in coming days.

4 Likes

We are going to be releasing Ghost 3.12 today, but it will not include any β€œautomatic” way to fix currencies problem (doesn’t mean you shouldn’t try it). Will explain the β€œWhy?” in the end of this message.

To the original problem. At the core of it lies the way Ghost is restarted after migrations are run within Ghost CLI and the state not being bubbled up all the way to internal setting nor the members service. This created a state where the data is fixed in the database but then immediately overwritten by the old bad state. We will be improving how these β€œsoft” restarts work in the future, but that’s out of scope for now.

The manual fix is fairly straight forward, but would need an extra restart after the update. So, given you are on a version which broke the currencies feature - 3.10.0, run following:

  1. ghost update 3.11.0 - normal update
  2. ghost stop - stops the instance completely, this allows internal cache to get cleared
  3. ghost start - starts the instance again which will populate internal cache with the value in the db

For extra check after step 2, you can run select form Payment currency in EU , and check if plans object doesn’t contain entries with only the currency property.

If you are on a 3.11.0, where the fix didn’t have any effect, you’d need to add an extra step before the above ones:

  1. ghost update --rollback - puts the instance to 3.10.0 so that the 3.11.0 migration script could run again
  2. follow the steps 1,2,3 from above - makes sure the changes are properly caught

After the update is done make sure to hard refresh the admin client. Using already opened window might leave you with a broken state again.

When all above is done you can go and change currencies again to whichever was desired. For example if you wanted to have GBP active:

  1. Select USD as a currencye (do not save)
  2. Select GBP currency and press save.

Do not modify the plan prices just yet. Please upgrade to 3.12 first as it contains another bugfix regarding plan pricing.

Feel free to ping if you have any question before running the above or encounter any problems.


Why automatic fix was not provided?

We encountered multiple bugs that were related to this kind of migration and to solve them some bigger modifications within Ghost core would have to be done. The hacky solutions that could work would become technical debt that wasn’t worth dealing with given a low impact of the current bug.

2 Likes

Thanks Naz,

I can confirm this now works.

I was already upgraded to 3.11.0

So I did the following with ghost-cli

ghost update --rollback
ghost ls -> confirmed now at 3.10.0
ghost update
Screenshot 2020-03-23 at 12.12.14
ghost stop
ghost start

Visited ghost admin using a different browser than I normally use to make sure no cookies etc were set

In Settings -> Labs -> Members -> Subscription Pricing: Changed Currency dropdown to USD and then changed to GBP
Hit Save button

In Manage -> Members section, edited a member and enabled Complimentary Premium Plan
Hit Save button

Error message did not appear, instead, Stripe membership details etc were displayed as expected.

Bravo!

2 Likes

I was concerned when I saw the β€œVersion already installed” message during the update, but it seems to have fixed the problem.

On my test server (with private access) I was already at version 3.11.0, I followed the steps described and it seems to work correctly, the euro symbol and the price are displayed without problems.

However, I have a problem when I try to subscribe to the plan, I encounter the error 504 Gateway Time-out, after a long wait in β€œpending” after clicking on the β€œChoose this plan” button

Below is a screen to better understand:

Anyone having the same problem?

On the reproduction of my site locally, I am already at version 3.12, unfortunately I had not yet read this post. What are the steps in this case?

I did not have the problem with the sign up buttons on the front-end after applying the fix above.

Have just upgraded to 3.12.0 now also and everything is still working as expected.

Hopefully a dev will reply to your problem on how to revert from 3.12.0 down to 3.10.0

1 Like

I understand what the problem is.

The error is related to previously existing users who signed up with another currency, if I deactivate the subscription and try to make a new one with a different currency, I encounter this error.

If I try with a new user, just created, the problem does not exist.

I hope this information will help you solve the problem more easily.

I look forward to resolving the problem having already updated to version 3.12 locally.

Thank you

@giacomosilli the bug with not being able to subscribe is a known issue. It stems out of a limitation imposed by the Stripe:

Customers are single-currency, meaning once you’ve assigned a currency, invoiced the customer, or set a customer balance, the currency cannot be changed. This locked state is visible on the Dashboard via a disabled Currency dropdown.

ref. https://stripe.com/docs/billing/customer#currency (edited)

This is definitely an edge case, we don’t expect publishers to be changing their currencies after initial setup much. But once someone signs up they have to stay within the same currency, at least for now.

@naz Thanks for the clarification regarding the currency for already subscribed users.

What about the other problem?
On my local replica I updated to 3.12 before reading your step-by-step post.

What is the correct procedure to solve the problem?

Hey @giacomosilli I believe you can execute rollback multiple times until you get to 3.10.0 to be able to follow the update steps.

Hi @naz
I gave the ghost update --rollback command, and I’m at version 3.11.0,
if I try to give the same command again I find the error:

An error occurred.
Message: 'No previous version found'


Debug Information:
    OS: Microsoft Windows 10 Pro, v10.0.18362
    Node Version: v10.16.1
    Ghost Version: 3.11.0
    Ghost-CLI Version: 1.13.1
    Environment: production
    Command: 'ghost update --rollback'

but looking at the folders I have the old versions up to 3.8.0
I also tried to stop the server, start it and try again, but it doesn’t work.

But this is the local server, it is not a priority, I could reinstall it. If you are interested in going further to help other users with the same problem, I am available to give you more information and solve the problem together.

If I don’t ask too much, I also have another case, the most important.
My production server is at version 3.9.0.
Do I have to use the ghost update command, or ghost update 3.10.0, and do I follow the steps described above?

Thank you

Please use ghost update. That will jump you straight to the latest version and will skip any possibility of having the bug in the first place

i f I try to give the same command again I find the error:

Was this instance of Ghost set up from 3.9.0 or what was it’s β€œfirst” version?

Thank you, i’ll try it asap.

Locally, i installed version 3.8.0 on the day it was published, and subsequently I have always updated with the release of subsequent versions.