Skip to content

Commit ffb4709

Browse files
Merge pull request #318 from stripe/next
chore: update docs and release script for web-sdk nov 29 release
2 parents 45df7bc + 6c19e60 commit ffb4709

21 files changed

+277
-9
lines changed

firestore-stripe-web-sdk/deploy.sh

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,37 @@ RED_BG=$(tput setab 1)
88
YELLOW=$(tput setaf 3)
99
RESET=$(tput sgr 0)
1010
BOLD=$(tput bold)
11+
FIREBASE_WEB_SDK_DIR="firestore-stripe-web-sdk"
12+
MIN_NODE_VERSION="12"
13+
14+
# verify we are in the correct directory for the script
15+
if [[ "${PWD##*/}" != "${FIREBASE_WEB_SDK_DIR}" ]]; then
16+
echo "${RED}ERROR:${RESET} Please run this script in the ${FIREBASE_WEB_SDK_DIR} directory"
17+
exit 1
18+
fi
1119

1220
# verify we meant to run this script
1321
read -r -n 1 -p "${YELLOW}WARNING:${RESET} running this script deploys changes publicly. Are you sure you want to continue? [y/n] "
1422
echo
1523
echo
1624
if [[ ! "${REPLY}" =~ ^[Yy]$ ]]; then exit 1; fi
1725

18-
# verify the user has required permissions
26+
# verify that we have updated the patch/release version
27+
public_sdk_version=$(npm view @stripe/firestore-stripe-payments version)
28+
local_sdk_version=$(npm version | sed -n '2'p | cut -d : -f 2 | cut -d , -f 1 | cut -d \' -f 2)
29+
if [[ "${public_sdk_version}" == "${local_sdk_version}" ]]; then
30+
echo "${RED}ERROR:${RESET} Your local web-sdk version matches the public web-sdk version. Please bump the version with ${BOLD}npm version patch${RESET} or a similar command"
31+
exit 1
32+
fi
33+
34+
echo "${GREEN}SUCCESS:${RESET} your local web-sdk version is different from the public web-sdk version"
35+
echo
36+
echo "local web-sdk version is ${YELLOW}${local_sdk_version}${RESET}"
37+
echo "public web-sdk version is ${GREEN}${public_sdk_version}${RESET}"
38+
echo
39+
echo
40+
41+
# verify the user has required npm permissions
1942
read -r -n 1 -p "Do you have a stripe npm account with 2FA? [y/n] "
2043
echo
2144
echo
@@ -25,14 +48,14 @@ if [[ ! "${REPLY}" =~ ^[Yy]$ ]]; then
2548
fi
2649

2750
version=$(nodenv version | cut -d . -f 1)
28-
if [ ! "${version}" -gt "12" ]; then
29-
echo "${RED}ERROR:${RESET} must have node version 12 or greater"
51+
if [ ! "${version}" -gt "${MIN_NODE_VERSION}" ]; then
52+
echo "${RED}ERROR:${RESET} must have node version ${MIN_NODE_VERSION} or greater"
3053
echo "current version is ${YELLOW}$(nodenv version | cut -d ' ' -f 1)${RESET}"
3154
echo
32-
echo "set new node version with ${BOLD}nodenv shell 14.7.0${RESET} or any other installed version 12 or greater to continue"
55+
echo "set new node version with ${BOLD}nodenv shell 14.7.0${RESET} or any other installed version ${MIN_NODE_VERSION} or greater to continue"
3356
exit 1
3457
fi
35-
echo "${GREEN}SUCCESS:${RESET} your current node version is 12 or greater (${GREEN}$(nodenv version | cut -d ' ' -f 1)${RESET})"
58+
echo "${GREEN}SUCCESS:${RESET} your current node version is ${MIN_NODE_VERSION} or greater (${GREEN}$(nodenv version | cut -d ' ' -f 1)${RESET})"
3659
echo
3760

3861
if ! npm team ls @stripe:developers &> /dev/null; then
@@ -76,10 +99,12 @@ echo
7699
echo "${GREEN}SUCCESS:${RESET} all tests have passed"
77100
echo
78101

79-
if ! rm stripe-firestore-stripe-payments-*.tgz; then
80-
echo
81-
echo "${RED}ERROR:${RESET} encountered an error removing old release artifacts"
82-
exit 1
102+
if [[ $(ls stripe-firestore-stripe-payments-*.tgz) ]]; then
103+
if ! rm stripe-firestore-stripe-payments-*.tgz; then
104+
echo
105+
echo "${RED}ERROR:${RESET} encountered an error removing old release artifacts"
106+
exit 1
107+
fi
83108
fi
84109

85110
if ! npm run build; then
@@ -98,6 +123,7 @@ echo
98123
echo "${GREEN}SUCCESS:${RESET} built the release artifact"
99124
echo
100125

126+
# verify one last time
101127
read -r -n 1 -p "Did you notify #developer-products and #developer-advocacy about this release? [y/n] "
102128
echo
103129
echo
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [allow\_promotion\_codes](./firestore-stripe-payments.commonsessioncreateparams.allow_promotion_codes.md)
4+
5+
## CommonSessionCreateParams.allow\_promotion\_codes property
6+
7+
Enables user redeemable promotion codes.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
allow_promotion_codes?: boolean;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [automatic\_tax](./firestore-stripe-payments.commonsessioncreateparams.automatic_tax.md)
4+
5+
## CommonSessionCreateParams.automatic\_tax property
6+
7+
Set to true to enable automatic taxes. Defaults to false.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
automatic_tax?: boolean;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [client\_reference\_id](./firestore-stripe-payments.commonsessioncreateparams.client_reference_id.md)
4+
5+
## CommonSessionCreateParams.client\_reference\_id property
6+
7+
A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
client_reference_id?: string;
13+
```

firestore-stripe-web-sdk/markdown/firestore-stripe-payments.commonsessioncreateparams.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ export interface CommonSessionCreateParams
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19+
| [allow\_promotion\_codes?](./firestore-stripe-payments.commonsessioncreateparams.allow_promotion_codes.md) | boolean | <i>(Optional)</i> Enables user redeemable promotion codes. |
20+
| [automatic\_tax?](./firestore-stripe-payments.commonsessioncreateparams.automatic_tax.md) | boolean | <i>(Optional)</i> Set to true to enable automatic taxes. Defaults to false. |
1921
| [cancel\_url?](./firestore-stripe-payments.commonsessioncreateparams.cancel_url.md) | string | <i>(Optional)</i> The URL the customer will be directed to if they decide to cancel payment and return to your website. |
22+
| [client\_reference\_id?](./firestore-stripe-payments.commonsessioncreateparams.client_reference_id.md) | string | <i>(Optional)</i> A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems. |
23+
| [metadata?](./firestore-stripe-payments.commonsessioncreateparams.metadata.md) | { \[key: string\]: any; } | <i>(Optional)</i> Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. |
2024
| [mode?](./firestore-stripe-payments.commonsessioncreateparams.mode.md) | "subscription" \| "payment" | <i>(Optional)</i> The mode of the Checkout Session. If not specified defaults to <code>subscription</code>. |
25+
| [payment\_method\_types?](./firestore-stripe-payments.commonsessioncreateparams.payment_method_types.md) | [PaymentMethodType](./firestore-stripe-payments.paymentmethodtype.md)<!-- -->\[\] | <i>(Optional)</i> A list of the types of payment methods (e.g., <code>card</code>) this Checkout Session can accept. Defaults to <code>[&quot;card&quot;]</code>. |
26+
| [promotion\_code?](./firestore-stripe-payments.commonsessioncreateparams.promotion_code.md) | string | <i>(Optional)</i> The promotion code to apply to this Session. |
2127
| [success\_url?](./firestore-stripe-payments.commonsessioncreateparams.success_url.md) | string | <i>(Optional)</i> The URL to which Stripe should send customers when payment or setup is complete. |
28+
| [tax\_id\_collection?](./firestore-stripe-payments.commonsessioncreateparams.tax_id_collection.md) | boolean | <i>(Optional)</i> Controls tax ID collection settings for the session. |
29+
| [trial\_from\_plan?](./firestore-stripe-payments.commonsessioncreateparams.trial_from_plan.md) | boolean | <i>(Optional)</i> Indicates if a plans <code>trial_period_days</code> should be applied to the subscription. Defaults to <code>true</code>. |
2230

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [metadata](./firestore-stripe-payments.commonsessioncreateparams.metadata.md)
4+
5+
## CommonSessionCreateParams.metadata property
6+
7+
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
metadata?: {
13+
[key: string]: any;
14+
};
15+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [payment\_method\_types](./firestore-stripe-payments.commonsessioncreateparams.payment_method_types.md)
4+
5+
## CommonSessionCreateParams.payment\_method\_types property
6+
7+
A list of the types of payment methods (e.g., `card`<!-- -->) this Checkout Session can accept. Defaults to `["card"]`<!-- -->.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
payment_method_types?: PaymentMethodType[];
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [promotion\_code](./firestore-stripe-payments.commonsessioncreateparams.promotion_code.md)
4+
5+
## CommonSessionCreateParams.promotion\_code property
6+
7+
The promotion code to apply to this Session.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
promotion_code?: string;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [tax\_id\_collection](./firestore-stripe-payments.commonsessioncreateparams.tax_id_collection.md)
4+
5+
## CommonSessionCreateParams.tax\_id\_collection property
6+
7+
Controls tax ID collection settings for the session.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
tax_id_collection?: boolean;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@stripe/firestore-stripe-payments](./firestore-stripe-payments.md) &gt; [CommonSessionCreateParams](./firestore-stripe-payments.commonsessioncreateparams.md) &gt; [trial\_from\_plan](./firestore-stripe-payments.commonsessioncreateparams.trial_from_plan.md)
4+
5+
## CommonSessionCreateParams.trial\_from\_plan property
6+
7+
Indicates if a plan’s `trial_period_days` should be applied to the subscription. Defaults to `true`<!-- -->.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
trial_from_plan?: boolean;
13+
```

0 commit comments

Comments
 (0)