Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @cfm168,

    PayPal Payments does not have an integrated feature to add additional fees to your payments. Extra fees could be added with custom code or third-party plugins, like the one mentioned above.

    Please keep in mind that PayPal permits handling fees that apply to all payment gateways, but no surcharges that apply only to PayPal. See the PayPal user agreement for more details: https://www.paypal.com/rw/webapps/mpp/ua/useragreement-full

    Kind regards,
    Niklas

    Thread Starter cfm168

    (@cfm168)

    @niklasinpsyde,
    Thank you for prompt response. I will try with this:
    PHP Snippet #2: Add fee to checkout for a specific payment gateway – WooCommerce

    @blclda
    Thank you for your suggestion.

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @cfm168,

    When using the snippet, you have to use the new gateway ids, as this example is for PayPal Standard.
    So in this line from the example #2:
    if ( $chosen_gateway == 'paypal' ) {

    You would need to replace paypal with ppcp-gateway for the PayPal Payments gateway and ppcp-credit-card-gateway for the Advanced Card Payments gateway.
    I hope this helps!

    Kind regards,
    Niklas

    Thread Starter cfm168

    (@cfm168)

    Hello @niklasinpsyde,

    Where should I put the php snippet in? I have Child theme.

    Please advise. Thanks!

    Thread Starter cfm168

    (@cfm168)

    Is amount 3% accepted?

    Thread Starter cfm168

    (@cfm168)

    Get site critical issue after Adding the following code in functions.php/child theme:
    ————————————————
    add_action( ‘woocommerce_cart_calculate_fees’, ‘bbloomer_add_checkout_fee_for_gateway’ );

    function bbloomer_add_checkout_fee_for_gateway() {
    $chosen_gateway = WC()->session->get( ‘chosen_payment_method’ );
    if ( $chosen_gateway == ‘ppcp-credit-card-gateway’ ) {
    WC()->cart->add_fee( ‘PayPal Fee’, 3% );
    }
    }

    add_action( ‘woocommerce_after_checkout_form’, ‘bbloomer_refresh_checkout_on_payment_methods_change’ );

    function bbloomer_refresh_checkout_on_payment_methods_change(){
    wc_enqueue_js( ”
    $( ‘form.checkout’ ).on( ‘change’, ‘input[name^=\’payment_method\’]’, function() {
    $(‘body’).trigger(‘update_checkout’);
    });
    “);
    }
    ————————————————————–
    my file currently is running good ending with } “);

    Please advise. Thanks in advance.

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @cfm168,

    Is amount 3% accepted?

    Do you mean by PayPal? I suggest reaching out to the PayPal merchant support to clarify. It all depends on your particular setup, but PayPal does not allow surcharges that only apply to PayPal and not to any other payment gateways you provide.

    Regarding the error, could you please give it a try with this snippet?:

    add_action( 'woocommerce_cart_calculate_fees', 'bbloomer_add_checkout_fee_for_gateway' );
      
    function bbloomer_add_checkout_fee_for_gateway() {
    	$amount = WC()->cart->cart_contents_total;
        $chosen_gateway = WC()->session->get( 'chosen_payment_method' );
         if ( $chosen_gateway == 'ppcp-credit-card-gateway' ) {
          WC()->cart->add_fee( 'Card Payment Fee', $amount * 0.03 );
       }
    }
     
    add_action( 'woocommerce_after_checkout_form', 'bbloomer_refresh_checkout_on_payment_methods_change' );
       
    function bbloomer_refresh_checkout_on_payment_methods_change(){
        wc_enqueue_js( "
           $( 'form.checkout' ).on( 'change', 'input[name^=\'payment_method\']', function() {
               $('body').trigger('update_checkout');
            });
       ");
    }

    Kind regards,
    Niklas

    Thread Starter cfm168

    (@cfm168)

    Hi @niklasinpsyde,

    This snippet is so far so good. I will have several tests and let you know here. Thank you very much.

    Thread Starter cfm168

    (@cfm168)

    Hi @niklasinpsyde,

    This snippet code is work (successfully checkout with correct amount payment), but I have to keep the Paypal Standard Payment enabled. If I turn the Paypal Standard off, the Advance Card processing checkout/It’s saying something about no payment method for this state. When customer select the Paypal Standard the order fail. This is reported from a domestic customer.

    Please advise. Thanks!

    Thread Starter cfm168

    (@cfm168)

    Hi @niklasinpsyde,

    It seams like really unstable for some reasons that some customers reported their orders failed and I can see those from back office (admin site). I have deleted the snippet until we have lasting/permanent solution.

    Please advise. Thanks!

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @cfm168,

    If I turn the Paypal Standard off, the Advance Card processing checkout/It’s saying something about no payment method for this state. When customer select the Paypal Standard the order fail.

    The setting “Enable the PayPal Gateway” must be enabled for Advanced Card Processing to work: https://woocommerce.com/document/woocommerce-paypal-payments/#paypal-checkout-tab
    You can disable the PayPal smart buttons on the Checkout page and then there would be no PayPal gateway and only the credit card gateway though.

    But to better understand why orders would fail for you, could you please send us a copy of your WooCommerce system report?
    The system report can be accessed from here:
    WooCommerce > Status > Get system report > Copy for support
    You can share it either here in the forums or privately with us from here:
    https://paypal.inpsyde.com/docs/request-support/
    If you send a private message, please include a link to this thread.
    Thanks!

    Kind regards,
    Niklas

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    We have not heard back from you in a while, so I’m marking this thread as resolved.
    Hopefully, the above information helped you out.
    If you have any further questions, please feel free to reopen this topic or create a new one.
    Thanks!

    Kind regards,
    Niklas

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Paypal/credit card processing fee’ is closed to new replies.