feat: Implement medusa payments provider (#13772)
* feat: Implement medusa payments provider * chore: Improvements after testing * chore: Add typings to medusa payments * fix: Final changes to complete medusa payment provider * update package * fix: Final changes to complete medusa payment provider --------- Co-authored-by: adrien2p <adrien.deperetti@gmail.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
co-authored by
adrien2p
Oli Juhl
parent
1defb3c29b
commit
ef7b9b9375
@@ -53,6 +53,7 @@ import {
|
||||
type StripeIndeterminateState = {
|
||||
indeterminate_due_to: string
|
||||
}
|
||||
|
||||
type StripeErrorData = Stripe.PaymentIntent | StripeIndeterminateState
|
||||
type HandledErrorType =
|
||||
| { retry: true }
|
||||
@@ -128,9 +129,7 @@ abstract class StripeBase extends AbstractPaymentProvider<StripeOptions> {
|
||||
res.return_url = extra?.return_url as string | undefined
|
||||
|
||||
// @ts-expect-error - Need to update Stripe SDK
|
||||
res.shared_payment_token = extra?.shared_payment_token as
|
||||
| string
|
||||
| undefined
|
||||
res.shared_payment_token = extra?.shared_payment_token as string | undefined
|
||||
|
||||
return res
|
||||
}
|
||||
@@ -248,7 +247,10 @@ abstract class StripeBase extends AbstractPaymentProvider<StripeOptions> {
|
||||
const intentRequest: Stripe.PaymentIntentCreateParams = {
|
||||
amount: getSmallestUnit(amount, currency_code),
|
||||
currency: currency_code,
|
||||
metadata: { ...(data?.metadata ?? {}), session_id: data?.session_id as string },
|
||||
metadata: {
|
||||
...(data?.metadata ?? {}),
|
||||
session_id: data?.session_id as string,
|
||||
},
|
||||
...additionalParameters,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user