Posted: March 2, 2016 at 12:20 pm
|
Dear support team, In this topic, you show a workaround for adding a service fee to PayPal standard transactions. Would you be willing to tell me how to add the same fee to PayPal Pro and iDeal (Mollie) transactions? Unfortunately, I seem to be unable to grasp the concept of the hooks within Event Espresso completely and get stuck on this matter. Thank you for helping me out. Best, |
Hi Luc, Here’s another example that can work with any gateway. You’ll plug in the payment methods into line 14 of the example: |
|
|
Dear Josh, Thanks, but: Best, |
|
Sorry, I forgot: I prefered the other options because it lets me add a fixed fee instead of a percentage. Regarding the payment method identifiers I reckon I should use the name as specified in the name field in the payment settings panel. Luc |
Hi Luc, You should be able to use the add_unrelated_item() method instead of the add_percentage_based_item() method to add a fixed fee. |
|
|
Dear Josh, Thank you. The other questions remain: |
You can add the code to a functions plugin or into your WordPress theme’s functions.php file. Each payment method has its own unique slug. |
|
|
Dear Josh, I changed these two lines when copying the code to the child theme’s functions.php: $payment_methods_with_surcharges = array( ‘iDeal, Paypal Standard, Paypal Pro, Stripe’ ); $success = EEH_Line_Item::add_unrelated_item( Unfortunately, no service fee is added upon paying the transaction? Best, |
Luc, you’re going to need to actually look at the method you’re trying to use and set the parameters in the way it expects. eg, You can’t pass in a percentage amount to the add_unrelated_item method. Do you have a PHP developer on your team that you can work with on this? |
|
|
Dear Josh, Would you be so kind to provide me with a reference to the relevant documentation about the function? |
The PHP doc block inside the Event Espresso plugin code itself has the documentation. Since you’ve asked though here’s a direct link:
Do you think support is lacking because we’re not providing one-off customizations for every possible customization request? Support staff is here to provide support and documentation for how to use Event Espresso. While we’ll try to work with developers to help assist with customizations, we are not qualified to provide in-depth one-off customizations, which are best handled by experienced PHP developers. If you need assistance from an experienced PHP developer I can recommend one of the developers listed here: |
|
|
Dear Josh, I explicitly wrote your support is great, but that a clearer structure between general documentation and support provided would make it even more easier to get the best results with Event Espresso. I’ll start with the code reference you sent now. Thanks! Cheers! |
|
Dear Josh, I found the parameters, thank you for the link. A remaining question is about the payment method’s slug. Is it the name you specify in the settings panel in Event Espresso? I included this piece of code in the child theme’s functions.php, but without result – I suspect the payment method’s slug because I could not find a clear reference to that one.
|
No it’s actually your syntax in the array is incorrect. Here’s an example of a reference that shows how to write an array: http://php.net/manual/en/language.types.array.php#example-99 |
|
|
Dear Josh, Of course you’re right. Dumb. I copied it 1:1 from another example on the site, but apparently slept while checking it. π Still:
… doesn’t do the trick either. It still won’t add the fee. Really appreciate your help! Luc |
Hi Luc, I’m going to suggest teaming up with a PHP developer on this one. This is really outside the scope of support. |
|
The support post ‘Filter hooks for service fee’ 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.