Description

Stored payment method without a billing address causes the checkout to give the following error:
Drupal\commerce_order\Entity\Order::setBillingProfile(): Argument #1 ($profile) must be of type Drupal\profile\Entity\ProfileInterface, null given

If the payment gateway requires_billing_information = false, the setBillingProfile function should not be called.

Steps to repreduce

Use the commerce stripe module, and use the Stripe Payment Element gateway, then checkout normally and enter the test card details, then try to checkout using the saved payment method from the previous step and you will face the error.

CommentFileSizeAuthor
#2 3494179-2.patch1001 bytesanas_maw

Issue fork commerce-3494179

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

anas_maw created an issue. See original summary.

anas_maw’s picture

Status: Active » Needs review
StatusFileSize
new1001 bytes

This patch solves the issue

jsacksick’s picture

Hm... Perhaps we can simply check that $payment_method->getBillingProfile() isn't NULL?

anas_maw’s picture

This will work also

zaporylie made their first commit to this issue’s fork.

zaporylie’s picture

Version: 8.x-2.x-dev » 3.x-dev

Changing target

  • jsacksick committed 8a2f6dc2 on 3.x authored by zaporylie
    fix: #3494179 Checkout with payment method without billing address not...
jsacksick’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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