@bigbinary/neeto-payments-frontend 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +4 -0
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ neeto-payments-frontend exports:
|
|
|
27
27
|
|
|
28
28
|
- `Dashboard` component
|
|
29
29
|
- `buildStripeTransactionLink()` function
|
|
30
|
+
- `useStripePromise()` hook
|
|
30
31
|
|
|
31
32
|
### 1. `Dashboard` component
|
|
32
33
|
|
|
@@ -167,6 +168,23 @@ const transactionLink = buildStripeTransactionLink(
|
|
|
167
168
|
);
|
|
168
169
|
```
|
|
169
170
|
|
|
171
|
+
### 3. `useStripePromise` hook
|
|
172
|
+
|
|
173
|
+
This hook is used to generate the `stripePromise` object to be passed to the stripe `<Elements>` context. The `useStripePromise` hook takes a stripe account identifier as input and returns a `Promise`.
|
|
174
|
+
|
|
175
|
+
> :memo: **Note:** `STRIPE_PUBLISHABLE_KEY` environment variable must be present for this hook to work.
|
|
176
|
+
|
|
177
|
+
Example usage
|
|
178
|
+
|
|
179
|
+
```js
|
|
180
|
+
const stripeAccountIdentifier = "acct_1Mtqtz2e5McIywz4"
|
|
181
|
+
const stripePromise = useStripePromise(stripeAccountIdentifier);
|
|
182
|
+
...
|
|
183
|
+
<Elements stripe={stripePromise}>
|
|
184
|
+
<CardElement />
|
|
185
|
+
</Elements>
|
|
186
|
+
|
|
187
|
+
```
|
|
170
188
|
## Other References
|
|
171
189
|
|
|
172
190
|
- [Development instructions](./docs/general/development-instructions.md)
|