laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.37k stars 671 forks source link

Address getting overridden when syncing data #1577

Closed harshitpeer closed 11 months ago

harshitpeer commented 11 months ago

Cashier Stripe Version

14.12.7

Laravel Version

9.52.15

PHP Version

8.2.5

Database Driver & Version

No response

Description

Gateway - Stripe

In case customer details are updated from Stripe's end (either from stripe.com or from Stripe hosted customer portal), the data is then overridden by Cashier and set back to a "null" value.

File - vendor\laravel\cashier\src\Concerns\ManagesCustomer.php

Line # 180 - function stripeAddress()

The above function is used to sync the data at Line # 217 function syncStripeCustomerDetails() and since the code in stripeAddress() is commented, null is the return value and that overrides any value set

Steps To Reproduce

  1. Update customer address from Stripe's Dashboard or Customer Portal
  2. The moment customer details are updated, another API call from the Cashier comes in and sets the value back to null
driesvints commented 11 months ago

Heya, thanks for reporting this. I've sent in https://github.com/laravel/cashier-stripe/pull/1580 to remedy this.

Just one note: this won't stop phone number/name etc from being overwritten. Ideally you overwrite syncStripeCustomerDetails to choose which data you'd like to keep in sync.