• Hi there,

    I am using the Stripe Gateway Plugin for payments. I cannot whitelist the JSON API calls for the plugin. Is there a possibility to add them?

    Or does maybe Stripe need to add the function?

    Thanks in advance.

    Best regards

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Dave McHale

    (@dmchale)

    Hi @aprycotmedia

    Without looking at their source code, my first guess here (and I’ve only seen this once before) is that they are ONLY registering their endpoints when the website is displaying frontend pages. Since our plugin asks WordPress “what endpoints are registered?” when displaying a page in the admin area, we cannot display any endpoints that WordPress doesn’t know about at the time.

    In my opinion there’s really no REASON to not register endpoints in the admin area, so it’s possible you could reach out to the developers of that plugin and ask them to see if they’d be willing to investigate whether this is indeed what’s happening & potentially to change it if they’re willing?

    Updating this plugin to handle arbitrary / user-defined endpoints is something that we’ve tossed around as an idea in the past but is quite a lot of work for a very small edge case. But hopefully in the future something like this may be possible.

    Thanks for using the plugin, and let me know if you hear any feedback from them!

    Dave

    Thread Starter aprycotmedia

    (@aprycotmedia)

    Hi Dave,
    thank you very much for the fast reply. Will reach out to the Plugin developer. I will update the thread as soon as I got a reply.

    Have a nice weekend and keep up the good support. Really appreciated.

    Thank you.
    Best regards

    Thread Starter aprycotmedia

    (@aprycotmedia)

    UPDATE:

    Seems like you are right. It was done due to plugin speed purposes.

    Hi @aprycotmedia,

    The Stripe plugin registers the REST API endpoints when the rest_api_init action is triggered and the plugin recognizes that the request is for the Stripe plugin. This is done for performance reasons to prevent endpoint loads when it’s a regular page load compared to a REST request.

    This makes the plugin faster.

    Newer versions of the plugin rely on a WC ajax request that wraps an internal rest request. Here is a link to that code:

    https://docs.paymentplugins.com/wc-stripe/api/source-class-WC_Stripe_Rest_API.html#149

    Kind Regards,

    So I need to evaluate how I proceed.

    Best regards

    Plugin Author Dave McHale

    (@dmchale)

    @aprycotmedia thanks for the update. Yeah, that’s a tricky one. We can’t display endpoints in the admin panel if WordPress itself doesn’t know they exist.

    Are you running v3.2.7 or above of their plugin? If you have a development/staging copy of the site, you could try upgrading their plugin to the latest version and you could see if their new methodology of wrapping their REST calls fixes the issue for you.

    I’ll continue to think about this issue on my end. I may have an idea or three, but will need to test them out. I’m also not sure how the logic will interact with how they’re wrapping it with the WC_Ajax functionality so I’ll try to keep that in mind as well.

    Thread Starter aprycotmedia

    (@aprycotmedia)

    Actually I am on the latest version, but it does not fix the issue. So I also need to dig a bit deeper into the topic. Thank you for your support.

    All the best

    Same problem here…
    Any solutions by now?

    BTW thanks for the plugin ??

    Plugin Author Dave McHale

    (@dmchale)

    @gerold1968 sorry no, nothing yet for this. Will have to do some extensive testing on this front since this kind of tool is probably going to end up being a “give the admin enough rope to hang themselves with” situation. I also have a fairly large feature update coming for the plugin already and want to that that pushed out before adding this, which HOPEFULLY itself will be out by week’s end.

    Thank you anyway. All the best!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Plugin Stripe for Woocommerce’ is closed to new replies.