The problem

As mentionned in this issue : #3420031: Use payment gateway display label instead of payment method label, stored payment methods use the payment method label as payment option label.

This label in build by the buildLabel() method in PayPalCheckout payment method. When no card_type is stored in the payment method (typically when we go back to the previous checkout step), the function return "Paypal" by default. I think it is a bad behaviour because of this issue : #3154770: Remove duplicate PayPal payment method options in checkout.. I'll explain : the condition added in this issue removes the "default" Paypal payment option when a Paypal payment method is already stored. But the label of these 2 options is not created the same way :
- One is made with the payment method label
- The other one is made with the payment gateway display label

So when I choose Paypal, that I go to the review step then I go gack on the previous checkout step, the label changed. In my site, the display label of my Paypal gateway is not just "Paypal", this is why I noticed the change.

It is not a major issue but I think it is missconfusing.

Proposed resolution

Use the payment gateway display label as default return value of the buildLabel() method, instead of just "Paypal".

CommentFileSizeAuthor
#3 3420132-2.patch1002 bytesjsacksick
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

solene_ggd created an issue. See original summary.

solene_ggd’s picture

Issue summary: View changes
jsacksick’s picture

Status: Active » Needs review
StatusFileSize
new1002 bytes

Let's see if this patch helps.

solene_ggd’s picture

Well this is exactly what I needed ! Thank you for your quick response and your patch (I was about to upload mine but yours is better !)

solene_ggd’s picture

I have to apologize @jsacksick because this isn't a real issue for now. I thought it was the display label that was used in payment option but it is actually the create_label (because it is a payment gateway with payment method) which is "Paypal".

I had the problem because I had installed this patch : https://www.drupal.org/project/commerce/issues/3250069#comment-14649769

However, the current patch might still be useful if this parent issue is ever resolved.

trickfun’s picture

Patch doesn't work.
The label is always paypal.

While patch https://www.drupal.org/project/commerce/issues/3250069#comment-14649769 works fine.
Thank you

jsacksick changed the visibility of the branch 3420132-use-payment-gateway to hidden.

jsacksick changed the visibility of the branch 3420132-use-payment-gateway to hidden.

jsacksick changed the visibility of the branch 3420132-use-payment-gateway to active.

jsacksick’s picture

Status: Needs review » Fixed

This is now fixed, but the Commerce core patch is needed in Commerce 2.x, or Commerce 3 is going to have to be used.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.