Support » Plugin: PDF Invoices & Packing Slips for WooCommerce » Payement method not displayed on pdf invoice when using Stripe

  • Resolved kambro

    (@kambro)


    Good evening,

    Thank you for your plugin.
    We have just a problem : when client pays with bankcard via Stripe, the payment method is not displayed on pdf invoice.
    All others methods are well displayed : check, Paypal, Google Pay.

    Thank you in advance.
    Met vriendelijke groeten.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @kambro,

    Could you please tell me which plugin are you using to connect your store with Stripe? I have tested with WooCommerce Stripe Payment Gateway and the payment method appears in the invoice correctly.

    Thread Starter kambro

    (@kambro)

    Good morning,

    Thank you for your answer.
    We use also WooCommerce Stripe Payment Gateway.
    Here the result on the pdf invoice with a Stripe Payement :

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for sending that screenshot, @kambro.

    I also ran some tests, but with a different result: I see the payment method correctly.

    A screenshot that displays an invoice displaying the payment method: Credit Card - Stripe

    Could you please view the order #10540 details, edit the billing info (clicking on the pencil icon) and see if the payment method is displayed like this:

    A screenshot that displays the payment method highlighted within the customer's billing info

    Thread Starter kambro

    (@kambro)

    Thank you for your quick answer.
    You’r right ; the field is empty :

    Thread Starter kambro

    (@kambro)

    I entered a name to the Stripe method payment (in WooCommerce settings > payments > Stripe). So, in the order detail, the field is now indicating the payment method but on the invoice, nothing to see.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I think that you found the issue: The payment method name was overridden to blank, and we don’t display the Payment method label if it’s empty.

    On the other hand, please note that updating the payment method settings, doesn’t update your previous orders. You can check your last settings placing a test order, or waiting to your next order, to confirm that it’s fixed.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi again @kambro,

    Try adding this code snippet to force the payment method displaying in your old orders:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Displays Stripe as payment method when it's selected
     */
    add_filter( 'wpo_wcpdf_payment_method', function( $payment_method, $document  ) {
    	if ( ( $payment_method_id = $document->order->get_payment_method() ) && $payment_method_id == 'stripe' ) {
    		$payment_method = 'Credit Card (Stripe)';
    	}
    	return $payment_method;
    }, 10, 2 );

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Let me know if it worked! 😉

    Thread Starter kambro

    (@kambro)

    Yes, it works fine with your snippet.
    Checking the test order did not result.

    Thank you very much for your help.

    Best regards.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I’m glad to hear that it worked!

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.