Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_filter( 'mycred_setup_gateways', 'register_custom_gateway' );
function register_custom_gateway( $gateways ) {
// Using a gateway class
$gateways['unique-gateway-id'] = array(
'title' => __( 'Gateway Title' ),
'callback' => array( 'gateway_class_name' )
);
// or Using a gateway function
$gateways['unique-gateway-id'] = array(
'title' => __( 'Gateway Title' ),
'callback' => 'gateway_function_name'
);
return $gateways;
}
// Purchases are made locally
class My_Custom_Gateway extends myCRED_Payment_Gateway {
function __construct( $gateway_prefs ) {
parent::__construct( $args, $gateway_prefs );
}
function buy() {
$this->purchase_header( 'Header / Title' );
echo 'these things needs to be included on this page';
$this->purchase_footer();
}
}
// Purchases are done remotely
class My_Custom_Gateway extends myCRED_Payment_Gateway {
function __construct( $gateway_prefs ) {
parent::__construct( $args, $gateway_prefs );
}
function buy() {
$this->purchase_header( 'Header / Title' );
$arguments = array();
$this->form_with_redirect( $arguments );
$this->purchase_footer();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.