LMS Development Company – Expert Moodle Developers Forums Moodle Stripe Payment Pro Switching between Live and Test API Keys breaks plugin?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23889
    Raymond Frangie
    Participant

    Hi Team,

    Using live keys, when changing the API keys back to Test Keys, we get the following error on the course enrolment pages.

    Exception - No such price: 'price_1ReLBxBtIkY7o0rb1dRHUpPq'; a similar object exists in live mode, but a test mode key was used to make this request.

    Can we improve the plugin to have both the Live and Test keys, with a toggle switch to change from Live to Test Mode and back to Live without breaking the plugin?

    Thanks in advance

    Cheers,
    Ray

    #23894
    dualcube
    Keymaster

    Ray. Thanks for bringing this to our attention.

    The error occurs because Stripe separates Test and Live data—so a Live Mode price ID won’t work in Test Mode. We agree that having a toggle to switch between both API keys would improve usability. We’re exploring this feature but will need to confirm if Stripe allows such a setup without causing conflicts.

    For now, please create the same products and pricing plans in your Stripe Test account (just like you did in Live mode), and then update the plugin settings with the corresponding Test Mode price IDs.

    We’ll keep you posted on any updates. Let us know if you need help configuring this.

    #23900
    Raymond Frangie
    Participant

    Hi,

    Yes, the only way around this was to delete the enrolment method and then recreate it.

    Luckily, I’m only just building the platform from scratch now but I could imagine this being quite significant and problematic if we had hundreds of courses and we needed to switch or do some maintenance at some time.

    The only way I could see this working is that you have both the Live and Test API Keys defined in the plugin and that when you create an enrolment method, it creates products in both environments, linking to both. Then the toggle that you would have in your plugin will determine which pathway to use during enrolment or payment processing.

    Appreciate your investigation and resolution.

    Cheers,
    Ray

    #23916
    dualcube
    Keymaster

    Hi Ray,

    Thanks for the follow-up.
    We’re reviewing its feasibility and how best to implement a toggle without breaking enrolments.

    Appreciate your input, we’ll keep you posted on the progress.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.