Posted: March 25, 2016 at 6:14 am
|
Hi! Recently came across this code and applied it to charge Paypal fees. Our country has a 4.4% + Php 15.00 Paypal charge. The problem is, the fee is only charged to 1 ticket whenever someone buys multiple tickets. Example: A ticket is worth Php1,000 so a Paypal fee is charged at Php59.00 (4.4% + 15). But if someone buys 2 tickets, a fee of Php59.00 is still charged instead of Php 118.00.
Hope you can help Thank you! |
You can use and adapt this example code instead: The above will apply a percentage surcharge to the entire cart. |
|
|
Hi Josh! How do I apply the surcharge to Paypal payments only? Sorry I’m kind of new to this.
Is this correct? The goal is to charge 4.4% + 15 per item for Paypal only. Thank you! |
No that’s not correct because you can only pass a percentage amount to the add_percentage_based_item(). With that 15 PayPal fee, is that per item or per transaction? |
|
|
The 4.4% + 15 is per item. |
Hello, There is a problem with the original sample code that you shared. Although it may be add that charge, it will set your transactions to overpaid. This is because it is adjusting the balance on the payment option for PayPal just before you go to pay so when you pay and arrive back, Event Espresso is seeing an amount that is higher than what is actually due. I recommend going with the suggestion that Josh shared: However, there are some things to be aware of. It adds a surcharge to the payment option that is specified. It adds a percentage based surcharge. If you would like to use that function, then you should change the entry for invoice here (https://github.com/eventespresso/ee-code-snippet-library/blob/master/checkout/bc_add_cart_modifier.php#L14) to this: paypal_standard Next, change the entry for 10 (https://github.com/eventespresso/ee-code-snippet-library/blob/master/checkout/bc_add_cart_modifier.php#L11) to a percentage such as 5. Once that is running, then you’ll see a fee added to PayPal standard transactions for the percentage that you added. If you need an exact calculation for the PayPal fees (e.g. percentage + a fixed fee), then feel free to reach out to an Event Espresso professional here: https://eventespresso.com/developers/event-espresso-pros/ — |
|
|
Hi Lorenzo, Thank you for that. It’s almost working now except for this issue: After I fill up the attendee information on Step 1, once I have selected Paypal from the payment options, the value it passes to Paypal is not computed with the surcharge. I have to go back to the registration site to refresh the details. |
|
Tried a couple of registrations but still no luck. You have to refresh the page once you have selected PayPal as a payment option. Of you don’t refresh, the declared PayPal fee still won’t push thru PayPal. Any help? Thanks! |
|
Hello, Since your replies are incomplete, I am still using the old code posted above If I use this code:
How can I make it get the quantity of the item in cart. What should I change in this line?
Thank you! |
Hello, Support isn’t available on the weekends as team members take time off to spend with their families. Please take another look at my earlier reply: https://eventespresso.com/topic/charge-paypal-fee-per-ticket/#post-197693 The old function that you are trying to use will result in an overpaid status so I do not recommend using it. Is the new example that I mentioned being used in a site specific plugin? — |
|
|
I temporarily used the earlier code and relabeled the ‘overpaid’ status to compensate. Yes. It worked but you have to refresh it so the value will pass on to PayPal or once you have selected PayPal, you have to go back to the checkout page then finalize it again. |
Another option you have (and this one doesn’t involve any custom coding) is you set up a separate event for collecting PayPal payments. You can set the price modifiers per ticket (both percentage fees and fixed fees) right in the ticket editor. Then, you install the Payment Methods Pro add-on and set the event to only use the PayPal gateway. The other events without the fees can be set to use the other payment methods. |
|
The support post ‘Charge Paypal Fee per Ticket.’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.