Jump to content
  • [beta 10] NEXUS_TEST_GATEWAYS constant is being ignored


    Fresh install of v5 beta 10, added the following into the constants.php file.

    image.png.b3e3ec262bfcd777d7b24278e6a53862.png

    The test gateway is not added to the payment methods.

    image.thumb.png.7517d062bd179bc8e77a8c8292b18cd3.png

    Discovered when members complained about duplicated payments being taken.  My test upgrade on localhost interacted with Stripe and inadvertently renewed any due subscriptions for members with stored card details.  Needless to say they were not happy😠

     

     


    User Feedback

    Recommended Comments

    Richard Arch

    Posted

    Just updated that site to beta 11 and bug persists, the test gateway is not added.

    teraßyte

    Posted

    The test gateway is not added automatically. You have to click the + Create New button and add it yourself:

    Tb0ypEE.png

    Richard Arch

    Posted

    @teraßyte Thanks for pointing that out, you are correct I would need to add that payment method in order to be able to select for use when buying a product.

    I should have been clearer, I'm referring to advise given here about using the NEXUS_TEST_GATEWAYS constant, I was lead to believe it would prevent the existing methods (Stripe in my case) from working.

     

    This comment "Sets all payment gateways into test/sandbox mode" in the init.php file does backup what I was told.

                    // Enable test/sandbox mode for Commerce payment gateways?
                    // Sets all payment gateways into test/sandbox mode and makes a generic "Test Gateway"
                    // which just acts as if a payment was successful available. Is used in development
                    // so they can be tested without actually taking any money.

    I have a test v4.7 install online which is running tasks via cron and it as never taken payments.  I do however swap the keys and webhook over to test versions in order to test credit card payments.  Have I just been lucky to have done that over the last 5 years before the renewal task ran... should have done the lottery.

    I guess I am seeking clarity, does the NEXUS_TEST_GATEWAYS do more than just make a "Test Gateway" available as a payment method?

     

     

    Marc

    Posted

    I added this as a bug just to get some clarification for you. Paypal has a test endpoint. So we switch to the test endpoint. Stripe however doesnt. It has test keys. So you would need to switch to using test keys (we wouldnt have them. Only you would if you set them up in your stripe account)

    It is still added as a bug by the way, as we can check the key to see if it appears to be a test key or not. 

    teraßyte

    Posted

    Yeah, Stripe doesn't have a test endpoint. Maybe a warning in ACP to remind admins to switch the live keys with test ones might be the way to go.

     

    The comment in init.php is misleading because it doesn't mention it works only for Paypal. 🤷‍♂️

    Richard Arch

    Posted

    Thanks @Marc and @teraßyte

    Ok, its getting clearer now and I'm understanding.  Yes, with Stripe you need to change the API Keys to their test versions in order to connect to a sandbox.

    It would be great if the software could detect and disable the Stripe payment methods.  My Keys have the word test within them.

    image.png.5ebdaa9d86aede79e1f8a58b42e48140.png

    I'd like a method to disable running all tasks to give me time to change these when building a copy of live as a test environment, a new constant maybe...  Or a constant that disables any stored credit cards.

    It seems I've just been lucky with all the other copied test environments that I built over the years or maybe its gone unnoticed... :sad:


×
×
  • Create New...