Cashier now nearly has all the functionality that I've needed to use where I could stop needing to use the Stripe library. However, there is no way currently to edit customer information, or update/change their credit card. Both of these methods are a part of the Stripe API, so Cashier would just need some new classes to perform them.
The Stripe API support both updating the card information (such as the customer name) or removing and adding a new card. I suppose this would have to be taken into account when creating and naming different methods.
I'm not sure how everyone thinks the naming conventions would go for them, but it could be something along the lines of:
// Update existing card information
$user->updateCard(['name' => $user->name]);
// Create new card.
// Bool for removing other card or setting this as default payment method?
$user->newCard($creditCardToken, true);
// Fetch the User's billing information
$user->getBillingInfo();
// Update the User's billing information
$user->updateBillingInfo(['name' => $user->name]);
These are all pretty rough proposals, but the added functionality would be great!
Would be great :+1:
:+1:
Yeah agree this would be cool.
Would totally be all over this. <3
Yeah - this would be vital.
Looking for a way to send a user's email/username to Stripe so I can save them on a customer record for identification purposes. This would solve that problem.
+1 for all of this.
also @nitrammit, could this be done by passing extra metadata to the create() method for subscriptions to pass an email or description to identify the customer?
$user->subscription('monthly')->create($stripetoken, ['email' => '[email protected]']);
+1
I like what You had to add as well danmatthews, that would be quite useful.
I was able to pass an email through to Stripe by altering the StripeGateway.php It'll break as soon as I run composer of course, but it gets the job done in a pinch.
I added an $email parameter to both the create & createStripeCustomer functions
public function create($token, $description = '', $customer = null, $email = null)
{
if ( ! $customer)
{
$customer = $this->createStripeCustomer($token, $description, $email);
}
$this->billable->setStripeSubscription(
$customer->updateSubscription($this->buildPayload())->id
);
$this->updateLocalStripeData($this->getStripeCustomer($customer->id));
}
public function createStripeCustomer($token, $description, $email = null)
{
$customer = Stripe_Customer::create([
'card' => $token,
'description' => $description,
'email' => $email
], $this->getStripeKey());
return $this->getStripeCustomer($customer->id);
}
+1 on this.
+1. The ability for customers to update credit card information is the missing piece in my case.
+1 is anyone working on this? Would be great.
+1
+1 for this, but bear in mind a customer can have several cards, but has a default card attached to them. I assume in this case you meant updating the default card with the above methods :)
Has this been fixed in the latest release?
Quit +1ing and someone make a pull request.
I apologize. I was just curious if this commit:
Fix how credit cards are updated.
Had anything to do with this issue. I'll get to work on a pull request otherwise.
+1
Most helpful comment
Quit +1ing and someone make a pull request.