Let Users Select Offline Payment Methods Using the Pay by Check Gateway in Paid Memberships Pro

Let Users Select Offline Payment Methods Using the Pay by Check Gateway in Paid Memberships Pro on child sites.

Snippet Type

Execute on Child Sites

Snippet

function my_pmpro_add_payment_type_to_order( $order ) {

	// Bail if payment gateway isn't check.
	if ( 'check' != $order->gateway ) {
		return;
	}

	if ( isset( $_REQUEST['payment_type']) && 'other' !== $_REQUEST['payment_type'] ) {
		$order->payment_type = esc_attr( $_REQUEST['payment_type'] );
	}

	$order->saveOrder();
}
add_action( 'pmpro_added_order', 'my_pmpro_add_payment_type_to_order' );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.