Thursday, 27 April 2017

Building a Payment Gateway for Give WP the Donation Plugin for WordPress – Who Is Chris


My father runs a non-profit organization and I told him I’d help with some of his online needs. I’m in the midst of a task for him where I need a very simple, but precise method of donations through Stripe. While the Stripe Add-On for Give is excellent, it’s more than I need and missing some small features my project requires. I’m not going to get into that specific project but show you what I’ve learned. Unless I’m missing something obvious on their site and with some quick googling, there’s no documentation for building Give gateways. I had to reverse engineer a couple that are available to see what is necessary to make it work. Here it is in its simplest form.
Bare Bones Gateway
When building an extension for a plugin I like to try and build the absolute barest possible version. What you see at the bottom of this section is just that. We use just two hooks:
add_filter( ‘give_payment_gateways’ )
add_action( ‘give_gateway_{gateway_slug}’ )
The filter registers our gateway. This will then show our gateway as an option in the Give gateway settings.
The action is where we process the submitted form data. It’s pretty
Source: https://managewp.org/articles/14973/building-a-payment-gateway-for-give-wp-the-donation-plugin-for-wordpress-who-is-chris




source https://williechiu40.wordpress.com/2017/04/28/building-a-payment-gateway-for-give-wp-the-donation-plugin-for-wordpress-who-is-chris/

1 comment: