Skip to content

Commit ad9382c

Browse files
committed
Update Stripe SDK and add marketing_features field to Product
Adding this field required updating the Stripe SDK. It was quite out of date.
1 parent cd31d3e commit ad9382c

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

firestore-stripe-payments/extension.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
name: firestore-stripe-payments
16-
version: 0.3.9
16+
version: 0.4.0
1717
specVersion: v1beta
1818

1919
displayName: Run Payments with Stripe
@@ -30,10 +30,12 @@ sourceUrl: https://github.com/stripe/stripe-firebase-extensions/tree/master/fire
3030
releaseNotesUrl: https://github.com/stripe/stripe-firebase-extensions/tree/master/firestore-stripe-payments/CHANGELOG.md
3131

3232
author:
33-
authorName: Invertase
34-
url: https://invertase.io
33+
authorName: Trent Rand
34+
url: https://trentrand.com
3535

3636
contributors:
37+
- authorName: Trent Rand
38+
url: https://trentrand.com
3739
- authorName: Thorsten Schaeff
3840
url: https://twitter.com/thorwebdev
3941
- authorName: Firebase

firestore-stripe-payments/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"firebase-admin": "^11.10.1",
2828
"firebase-functions": "^3.21.2",
2929
"rimraf": "^3.0.2",
30-
"stripe": "11.15.0",
30+
"stripe": "17.4.0",
3131
"typescript": "^4.9.5"
3232
},
3333
"devDependencies": {

firestore-stripe-payments/functions/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import * as logs from './logs';
2929
import config from './config';
3030
import { Timestamp } from 'firebase-admin/firestore';
3131

32-
const apiVersion = '2022-11-15';
32+
const apiVersion = '2024-11-20.acacia';
3333
const stripe = new Stripe(config.stripeSecretKey, {
3434
apiVersion,
3535
// Register extension as a Stripe plugin
@@ -126,7 +126,7 @@ exports.createCheckoutSession = functions
126126
cancel_url,
127127
quantity = 1,
128128
payment_method_types,
129-
shipping_rates = [],
129+
shipping_options = [],
130130
metadata = {},
131131
automatic_payment_methods = { enabled: true },
132132
automatic_tax = false,
@@ -183,7 +183,7 @@ exports.createCheckoutSession = functions
183183
const sessionCreateParams: Stripe.Checkout.SessionCreateParams = {
184184
billing_address_collection,
185185
shipping_address_collection: { allowed_countries: shippingCountries },
186-
shipping_rates,
186+
shipping_options,
187187
customer,
188188
customer_update,
189189
line_items: line_items
@@ -441,6 +441,7 @@ const createProductRecord = async (product: Stripe.Product): Promise<void> => {
441441
role: firebaseRole ?? null,
442442
images: product.images,
443443
metadata: product.metadata,
444+
marketing_features: product?.marketing_features,
444445
tax_code: product.tax_code ?? null,
445446
...prefixMetadata(rawMetadata),
446447
};

firestore-stripe-payments/functions/src/interfaces.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ export interface Product {
8282
* A list of Prices for this billing product.
8383
*/
8484
prices?: Array<Price>;
85+
/**
86+
* A list of up to 15 marketing features for this product.
87+
* These are displayed in pricing tables.
88+
*/
89+
marketingFeatures?: Array<Stripe.Product.MarketingFeature>;
8590
/**
8691
* Any additional properties
8792
*/

firestore-stripe-web-sdk/src/product.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ export interface Product {
8787
*/
8888
readonly metadata: { [key: string]: string | number | null };
8989

90+
/**
91+
* A list of up to 15 marketing features for this product. These are displayed in pricing tables.
92+
*/
93+
readonly marketingFeatures?: string[];
94+
9095
readonly [propName: string]: any;
9196
}
9297

0 commit comments

Comments
 (0)