Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Send invoice #942

Merged
merged 2 commits into from
May 21, 2020
Merged

[11.x] Send invoice #942

merged 2 commits into from
May 21, 2020

Conversation

driesvints
Copy link
Member

Replaces #935

Resent to run the test suite.

eckelarsson and others added 2 commits May 12, 2020 15:04
In some edge cases (like mine) we have clients that can't use a credit card, but we still want to have all the data in Stripe. So we create a subscription with collection_method = 'send_invoice' and the manually sent the invoices to be paid, once we received payment we just change the status manually in Stripe.

´´´
$model->invoice(['collection_method' => 'send_invoice']);
$subscription->invoice(['collection_method' => 'send_invoice']);
´´´

When you use this collection method you can't apply $stripeInvoice->pay() function, you need to use the $stripeInvoice->sendInvoice();

When using the $stripeInvoice->pay() on when a colletion_method is 'send_invoice' it throws PaymentFailure, it doesn't require a payment method.

The only two options in 'collection_methods' is charge_automatically (default) or 'send_invoice' there fore using a simple if else statement.

https://stripe.com/docs/api/invoices/create#create_invoice-collection_method
@taylorotwell taylorotwell merged commit 92eb7d8 into 11.x May 21, 2020
@driesvints driesvints deleted the send-invoice branch May 21, 2020 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants