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

[15.x] Stripe API and SDK update #1615

Merged
merged 4 commits into from
Dec 13, 2023
Merged

[15.x] Stripe API and SDK update #1615

merged 4 commits into from
Dec 13, 2023

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Dec 13, 2023

This updates the Stripe API to the most recent one 2023-10-16 as well as update the SDK version to v13 which is compatible with it.

I also decided to drop support for older SDK versions because v13 is the one that's compatible with this API version.

Closes #1556

$parameters = array_merge([
'automatic_tax' => $this->automaticTaxPayload(),
'customer' => $this->stripe_id,
'currency' => $stripeCustomer->currency ?? config('cashier.currency'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There cannot be multiple currencies anymore on invoices so we'll use the one from the customer or fallback to the Cashier default.

if (isset($parameters['subscription'])) {
unset($parameters['currency']);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currency cannot be combined with subscription so we allow subscription to take precedence.

@driesvints driesvints marked this pull request as draft December 13, 2023 16:05
if ($options['confirm'] ?? false) {
$options['return_url'] ??= route('home');
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a payment intent is being confirmed, we'll always need to supply a return url.

@driesvints driesvints linked an issue Dec 13, 2023 that may be closed by this pull request
@driesvints driesvints marked this pull request as ready for review December 13, 2023 16:37
@taylorotwell taylorotwell merged commit acc947b into master Dec 13, 2023
9 checks passed
@taylorotwell taylorotwell deleted the stripe-v13 branch December 13, 2023 16:46
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.

Support for Stripe PHP v12
2 participants