From 665e247cf6f182fe50e1685e27b7aba1d386813a Mon Sep 17 00:00:00 2001 From: Darren Ackers Date: Tue, 20 Aug 2024 17:41:00 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bf8f1440..e14b68dd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # UPDATE 2023-10-08: -This project has now being officailly transferred to [Invertase](https://github.com/invertase), who will maintain this extension going forward. Please see [this issue](https://github.com/stripe/stripe-firebase-extensions/issues/524) for more details. -It is now reccomended to uninstall the `stripe/firestore-stripe-payments` extension and install `invertase/firestore-stripe-payments` from the Firebase Extension Hub. +This project has now being officially transferred to [Invertase](https://github.com/invertase), who will maintain this extension going forward. Please see [this issue](https://github.com/stripe/stripe-firebase-extensions/issues/524) for more details. +It is now recommended to uninstall the `stripe/firestore-stripe-payments` extension and install `invertase/firestore-stripe-payments` from the Firebase Extension Hub. -Alternativley, you can also use the following link to convert your current installation to the Invertase version +Alternatively, you can also use the following link to convert your current installation to the Invertase version `https://console.firebase.google.com/project/_/extensions/install?instanceId=STRIPE_EXTENSION_INSTANCE_ID&ref=invertase%2Ffirestore-stripe-payments@0.3.5` From 578e307804f85237a64d7b99aa5f8da2663a79e6 Mon Sep 17 00:00:00 2001 From: Evan Caldwell Date: Thu, 7 Nov 2024 07:18:35 +0000 Subject: [PATCH 2/2] feat: adding ability to pass through payment_intent_data. This simple addition will enable functionality such as destination payments. --- firestore-stripe-payments/functions/src/index.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/firestore-stripe-payments/functions/src/index.ts b/firestore-stripe-payments/functions/src/index.ts index 74a72472..5c97168e 100644 --- a/firestore-stripe-payments/functions/src/index.ts +++ b/firestore-stripe-payments/functions/src/index.ts @@ -136,6 +136,7 @@ exports.createCheckoutSession = functions allow_promotion_codes = false, trial_period_days, line_items, + payment_intent_data, billing_address_collection = 'required', collect_shipping_address = false, customer_update = {}, @@ -220,10 +221,12 @@ exports.createCheckoutSession = functions sessionCreateParams.subscription_data.default_tax_rates = tax_rates; } } else if (mode === 'payment') { - sessionCreateParams.payment_intent_data = { - metadata, - ...(setup_future_usage && { setup_future_usage }), - }; + sessionCreateParams.payment_intent_data = payment_intent_data ? + payment_intent_data : + { + metadata, + ...(setup_future_usage && {setup_future_usage}), + }; if (invoice_creation) { sessionCreateParams.invoice_creation = { enabled: true,