@bigbinary/neeto-payments-frontend 1.0.4 → 1.0.5

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 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)