Support » Plugin: GiveWP - Donation Plugin and Fundraising Platform » Stripe account depending on Form ID

  • Resolved huzaifahj

    (@huzaifahj)


    Hey,

    I’m aware there is a solution for Paypal email addresses, and I have scoured the github code to see if I can do this myself, but I really need help as it’s beyond me.

    Is there a way to set the Stripe account depending on the Form ID? I would imagine it’s as simple as setting the secret key and publishable key depending on the form payment is being taken from, and setting the correct webhook on each stripe account.

    Is this possible?

    Kind regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Ben Meredith

    (@benmeredithgmailcom)

    Hi there,

    It’s not currently possible to apply the Stripe keys on a per-form basis, as those are saved globally. It may be possible with custom code, but I’ve not attempted it and don’t recommend it. In general, you want values like that to stay out of the files and just live in the database so that your Stripe credentials don’t get compromised.

    Thanks for using GiveWP!

    Thanks for your reply!

    How would you do it with custom code, if you’d be kind to explain further? I should be able to account for the security concerns and store the keys in a database

    I can see all the keys being stored in an $options array, and there’s a filter built in to manually change the API keys for stripe.

    Thanks again

    Plugin Support Ben Meredith

    (@benmeredithgmailcom)

    I wouldn’t want to steer you wrong here, as I am not as familiar (without studying the code) with how that filter is used in conjunction with the Stripe API call, and unfortunately I don’t have the time to go and dig in.

    The code is all open source on github at https://github.com/impress-org/givewp and you’d need to find out which hook during the donation process to hook into to provide a per-form switch of the credentials, and then pull the value from the database accordingly.

    If you get something piced together, the best thing to do would be to reach out on github via an issue (or Pull Request) to have the development team have a look.

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