Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions firestore-stripe-invoices/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Version 0.2.1 - 2022-08-24
[chore] Added `package-lock.json` to version control to prevent installation issues. [#426]

## Version 0.2.0 - 2022-04-26

[feat] - Add `invoice.paid`, `invoice.updated` to permitted webhook events list. #356
Expand Down
2 changes: 1 addition & 1 deletion firestore-stripe-invoices/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

name: firestore-stripe-invoices
version: 0.2.0
version: 0.2.1
specVersion: v1beta

displayName: Send Invoices using Stripe
Expand Down
2 changes: 1 addition & 1 deletion firestore-stripe-invoices/functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const stripe = new Stripe(config.stripeSecretKey, {
// https://stripe.com/docs/building-plugins#setappinfo
appInfo: {
name: 'Firebase firestore-stripe-invoices',
version: '0.2.0',
version: '0.2.1',
},
});

Expand Down
3 changes: 3 additions & 0 deletions firestore-stripe-payments/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Version 0.3.1 - 2022-08-24
[chore] Added `package-lock.json` to version control to prevent installation issues. [#426]

## Version 0.3.0 - 2022-08-23
[feat] Allow configurable minimum instances for `createCheckoutSession` function. [#375]

Expand Down
3 changes: 1 addition & 2 deletions firestore-stripe-payments/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

name: firestore-stripe-payments
version: 0.3.0
version: 0.3.1
specVersion: v1beta

displayName: Run Payments with Stripe
Expand Down Expand Up @@ -249,7 +249,6 @@ params:

- param: CREATE_CHECKOUT_SESSION_MIN_INSTANCES
label: Minimum instances for createCheckoutSession function
type: secret
description: >-
Set the minimum number of function instances that should be always be available to create Checkout Sessions.
This number can be adjusted to reduce cold starts and increase the responsiveness
Expand Down
3 changes: 2 additions & 1 deletion firestore-stripe-payments/functions/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ export default {
stripeConfigCollectionPath: process.env.STRIPE_CONFIG_COLLECTION,
syncUsersOnCreate: process.env.SYNC_USERS_ON_CREATE === 'Sync',
autoDeleteUsers: process.env.DELETE_STRIPE_CUSTOMERS === 'Auto delete',
minCheckoutInstances: Number(process.env.CREATE_CHECKOUT_MIN_INSTANCES) ?? 0,
minCheckoutInstances:
Number(process.env.CREATE_CHECKOUT_SESSION_MIN_INSTANCES) ?? 0,
};
12 changes: 7 additions & 5 deletions firestore-stripe-payments/functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const stripe = new Stripe(config.stripeSecretKey, {
// https://stripe.com/docs/building-plugins#setappinfo
appInfo: {
name: 'Firebase firestore-stripe-payments',
version: '0.3.0',
version: '0.3.1',
},
});

Expand Down Expand Up @@ -808,10 +808,12 @@ export const handleWebhookEvents = functions.handler.https.onRequest(
);
}

await eventChannel?.publish({
type: `com.stripe.v1.${event.type}`,
data: event.data.object,
});
if (eventChannel) {
await eventChannel.publish({
type: `com.stripe.v1.${event.type}`,
data: event.data.object,
});
}

logs.webhookHandlerSucceeded(event.id, event.type);
} catch (error) {
Expand Down