Guest User

Untitled

a guest
Dec 12th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. /**
  2. * Keep pmpro_next_payment_date() from using the Stripe API.
  3. * Instead, the next payment date will be calculated based on
  4. * the date of the last order in PMPro.
  5. * This will be inaccurate in some cases with regards to trials,
  6. * but avoids issues where Stripe is giving the wrong "next payment"
  7. * date when payments fail.
  8. */
  9. function my_disable_stripe_api_next_payment_date( $next_payment_date ) {
  10. // remove this filter which may run later
  11. remove_filter('pmpro_next_payment', array('PMProGateway_stripe', 'pmpro_next_payment'), 10, 3);
  12.  
  13. // return the default payment date calculated
  14. return $next_payment_date;
  15. }
  16. add_action( 'pmpro_next_payment', 'my_disable_stripe_api_next_payment_date', 1 );
Add Comment
Please, Sign In to add comment