Skip to content

Instantly share code, notes, and snippets.

@mehul0810
Last active January 10, 2020 03:49
Show Gist options
  • Save mehul0810/353b00bad1a31330f5b3d1971ce841f4 to your computer and use it in GitHub Desktop.
Save mehul0810/353b00bad1a31330f5b3d1971ce841f4 to your computer and use it in GitHub Desktop.
This Gist is used to register custom payment gateway for Give.
<?php
/**
* Register payment method.
*
* @since 1.0.0
*
* @param array $gateways List of registered gateways.
*
* @return array
*/
function mg_register_payment_method( $gateways ) {
// Duplicate this section to add support for multiple payment method from a custom payment gateway.
$gateways['instamojo'] = array(
'admin_label' => __( 'Instamojo - Credit Card', 'give' ), // This label will be displayed under Give settings in admin.
'checkout_label' => __( 'Credit Card', 'give' ), // This label will be displayed on donation form in frontend.
);
return $gateways;
}
add_filter( 'give_payment_gateways', 'mg_register_payment_method' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment