Billing profile incomplete, when using the cart form buttons

Created on 25 October 2022, over 2 years ago
Updated 16 May 2023, about 2 years ago

Problem/Motivation

Billing profile only contains First & Last Name and Countrs, when using the cart form buttons (quick checkout)
The shipping address is complete and fine meanwhile.

Steps to reproduce

  1. Enable the "Show the Smart payment buttons on the cart form."-setting in the PayPal Checkout payment method settings
  2. Try a checkout using these buttons, for example, checking out with your PayPal account.
  3. After confirming the payment in the PayPal popup you're redirected back to /checkout/123/paypal_checkout and the shipping address is prefilled correctly, while the billing address only contains name and country. Street, ZIP and city are missing!

This makes the functionality unusable in production.

These are my PayPal Checkout settings:

Proposed resolution

Ensure all shipping fields are also set for the billing address.

There are several similar issues, so I've linked them as related. This one for PayPal EC is very close: #2632674: Add missing fields returned by paypal to billing customer profiles but it seems it's still different data structures from PayPal.

Update: This is the Drupal 8 twin: 💬 Billing address not returned from PayPal Fixed

Workaround:
Disable the "Show the Smart payment buttons on the cart form." functionality.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

2.0

Component

PayPal Checkout

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States DamienMcKenna NH, USA

    Updated patch with the wording fixes from the MR.

  • 🇩🇪Germany Anybody Porta Westfalica

    @jsacksick any plans to merge this?

  • 🇩🇪Germany Anybody Porta Westfalica

    Let's implement the same for 8.x-1.x like we did for Drupal 7 in MR!12.

  • 🇩🇪Germany Anybody Porta Westfalica

    anybody changed the visibility of the branch 8.x-1.x to hidden.

  • 🇩🇪Germany Anybody Porta Westfalica

    Okay, here we go! Setting this back to Needs review for the 8.x-1.x version. The Drupal 7 version has already been reviewed and seems to be used by several people beside us, e.g. @damienmckenna.

    Would be super happy to have the 8.x-1.x version tested, for us it's super helpful in terms PayPal doesn't return billing address details.

  • Pipeline finished with Failed
    6 months ago
    Total: 429s
    #352142
  • 🇩🇪Germany Grevil

    Nice work! Added a few comments! :)

  • 🇩🇪Germany Anybody Porta Westfalica

    See 📌 Fix PHPCS Active regarding the unrelated phpcs CI fail.

  • 🇩🇪Germany Grevil

    PHPCS issues are unrelated.

  • Pipeline finished with Failed
    6 months ago
    Total: 146s
    #352176
  • 🇩🇪Germany Anybody Porta Westfalica

    Static patch for 8.x-1.x until this is merged.

  • Pipeline finished with Failed
    6 months ago
    Total: 243s
    #352219
  • 🇩🇪Germany Grevil

    grevil changed the visibility of the branch 3317359-billing-profile-incomplete to hidden.

  • 🇩🇪Germany Grevil

    LGTM! CI failure is related to 📌 Fix PHPCS Active .

  • Status changed to Needs work 29 days ago
  • 🇮🇱Israel jsacksick

    While this can be true for some cases, there is no guarantee that the shipping address is the same as the billing address? I believe the right fix is to have PayPal send the information to us (it's a pity this isn't turned on by default).
    Also, the patch introduces mixed casing ($billingProfile instead of $billing_profile) (I'd prefer sticking to the casing used in the code currently.

    Can we remove the update hook too? Is it sufficient to just check for an empty locality?

    if ($billingProfile && $this->configuration['update_billing_profile_shipping_fallback'] && empty($billingProfile?->address?->locality)) {

    since we're checking if ($billingProfile) already, there is probably no need for "?>" in $billingProfile?->address. Also, that's a lot of magic getters :p, perhaps we could consider getting the address array first?

  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil could you check that, please? :)

  • Pipeline finished with Canceled
    15 days ago
    Total: 128s
    #489218
  • 🇩🇪Germany Anybody Porta Westfalica

    Rerolled against latest dev!

  • Pipeline finished with Success
    15 days ago
    Total: 151s
    #489221
  • Pipeline finished with Success
    8 days ago
    Total: 157s
    #494912
  • Pipeline finished with Success
    8 days ago
    Total: 164s
    #494929
  • Pipeline finished with Success
    8 days ago
    Total: 166s
    #494932
  • 🇩🇪Germany Grevil

    Alright, I fixed the remaining issues noted in #28. That should be it now!

  • Pipeline finished with Canceled
    8 days ago
    Total: 132s
    #494966
  • Pipeline finished with Success
    8 days ago
    Total: 159s
    #494970
  • 🇩🇪Germany Anybody Porta Westfalica

    Okay ready for review by @jsacksick! Thanks for the final adjustments @Grevil!

Production build 0.71.5 2024