Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] * Change pmpro_checkout_before_change_membership_level() to run duriing process() #52

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions classes/class.pmprogateway_ccbill.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ static function init() {
add_filter( 'pmpro_include_payment_information_fields', '__return_false');
add_filter( 'pmpro_required_billing_fields', array( 'PMProGateway_CCBill', 'pmpro_required_billing_fields' ) );
add_filter( 'pmpro_checkout_default_submit_button', array( 'PMProGateway_CCBill', 'pmpro_checkout_default_submit_button' ) );
add_filter( 'pmpro_checkout_before_change_membership_level', array( 'PMProGateway_CCBill', 'pmpro_checkout_before_change_membership_level' ), 10, 2);
}
}

Expand Down Expand Up @@ -329,15 +328,14 @@ function process( &$order ) {
if ( empty( $order->code ) ) {
$order->code = $order->getRandomCode();
}

//clean up a couple values
$order->payment_type = "CCBill";
$order->CardType = "";
$order->cardtype = "";

//just save, the user will go to CCBill to pay
$order->status = "pending";
$order->saveOrder();
//do we still need to assign these above to the order ?

self::pmpro_checkout_before_change_membership_level( $order->user_id, $order );
return true;
}

Expand Down