Advertisement
eventsmanager

Paypal additional fee (Amount Base)

Apr 20th, 2023
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function my_em_add_fee($paypal_vars, $EM_Booking, $EM_Gateway_Paypal){
  2. $prix = $EM_Booking->get_price_pre_taxes();
  3. $pourcentage = 5;
  4. $amount = $prix - ($prix * ($pourcentage/100));
  5. if ( !empty($amount) ){
  6. $itemcount = (count($EM_Booking->get_tickets_bookings()->tickets_bookings) + 1);
  7. $paypal_vars['item_name_'.$itemcount] = wp_kses_data("Frais paypal");
  8. $paypal_vars['quantity_'.$itemcount] = 1;
  9. $paypal_vars['amount_'.$itemcount] = $amount;
  10. }
  11. return $paypal_vars;
  12. }
  13. add_filter('em_gateway_paypal_get_paypal_vars','my_em_add_fee',1,3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement