Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Keep pmpro_next_payment_date() from using the Stripe API.
- * Instead, the next payment date will be calculated based on
- * the date of the last order in PMPro.
- * This will be inaccurate in some cases with regards to trials,
- * but avoids issues where Stripe is giving the wrong "next payment"
- * date when payments fail.
- */
- function my_disable_stripe_api_next_payment_date( $next_payment_date ) {
- // remove this filter which may run later
- remove_filter('pmpro_next_payment', array('PMProGateway_stripe', 'pmpro_next_payment'), 10, 3);
- // return the default payment date calculated
- return $next_payment_date;
- }
- add_action( 'pmpro_next_payment', 'my_disable_stripe_api_next_payment_date', 1 );
Add Comment
Please, Sign In to add comment