Last active
February 5, 2025 14:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe will add a fee to the initial and recurring value when using Stripe | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_checkout_level( $level ){ | |
if( !empty( $_REQUEST['gateway'] ) ){ | |
if( $_REQUEST['gateway'] == 'stripe' ){ | |
$level->initial_payment = $level->initial_payment + 3; //Updates initial payment value | |
$level->billing_amount = $level->billing_amount + 3; //Updates recurring payment value | |
} | |
} | |
return $level; | |
} | |
add_filter( "pmpro_checkout_level", "my_pmpro_checkout_level" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "3 Methods to Adjust Membership Pricing Based on Payment Gateway" at Paid Memberships Pro here: https://www.paidmembershipspro.com/adjust-membership-pricing-by-payment-gateway/