buycred – buyers pay paypal fees?
-
I want the user to pay the paypal fee when they buy points using the buycred form. I figured I could just edit the example for mycred_buycred_get_cost that is in the docs, but I copied all three examples exactly into my theme’s function.php and it breaks (no price shows up at all in the paypal popup).
Paypal fees are 3.49% + $.49 So I figured this code below would work. But again, simply no price shows up at all in the paypal confirmation popup.
/** * Buyer pays PayPal fees for custom point purchases */ add_filter( 'mycred_buycred_get_cost', 'mycredpro_buycred_user_pays_fees', 10, 3 ); function mycredpro_buycred_user_pays_fees( $cost, $type ) { if ( $type != 'mycred_default' ) return $cost; // paypal fees $percent_fee = 3.49; $set_fee = .49; // Get the percentage $percent = round( ( ( $percent_fee / 100 ) * $cost ) ); // Deduct the discount amount $cost = $cost + $percent + $set_fee; return $cost; }
Any help would be greatly appreciated.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘buycred – buyers pay paypal fees?’ is closed to new replies.