Cashier-stripe: Update the customer on stripe

Created on 11 Apr 2019  路  5Comments  路  Source: laravel/cashier-stripe

Hi.

I have the ability for the user to update their billing information in my system. I want to sync this with Stripe and I can't find a way to do this using Laravel Cashier. This is what I propose to add to the Billable.php file:

public function updateStripeCustomer(array $options = [])
{
    $customer = StripeCustomer::update(
        $this->stripe_id, $options, $this->getStripeKey()
    );

    return $customer;
}

Now I can use it like so: $request->user()->updateStripeCustomer(['email' => '[email protected]]);

enhancement

All 5 comments

I had this on my list as well and a generic solution might work, however I'd also like to see some specific methods like updateVat, updateShippingAddress etc but they could technically make use of this method under the hood.

Totally agree. I'm using this to update the Shipping address so I can see if I can write another one to do that specifically.

Just another vote for this...

Just another vote for this...

@scottybo I have sent in a PR for this that has been merged. Check it out #634

Ah, brilliant! Thanks :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexbowers picture alexbowers  路  6Comments

peeyush1234 picture peeyush1234  路  4Comments

signvikas picture signvikas  路  5Comments

AnalyzeMe picture AnalyzeMe  路  5Comments

josephcocoa picture josephcocoa  路  3Comments