@rebilly/framepay-vue 12.246.5 → 12.246.7
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/CHANGELOG.md +3 -2
- package/README.md +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -218,7 +218,7 @@ whereas:
|
|
|
218
218
|
|
|
219
219
|
#### With rebilly-form
|
|
220
220
|
|
|
221
|
-
The default behavior of `RebillyForm` is to intercept the regular submit event, execute `
|
|
221
|
+
The default behavior of `RebillyForm` is to intercept the regular submit event, execute `Framepay.createToken()`, and then submit the form with the newly created token attached. Any inputs that include `data-rebilly` attribute with the appropriate value will be sent to `Framepay.createToken()`.
|
|
222
222
|
|
|
223
223
|
```html
|
|
224
224
|
<rebilly-form @error="" @token-ready="" :extraData="{}">
|
|
@@ -241,7 +241,7 @@ The default behavior of `RebillyForm` is to intercept the regular submit event,
|
|
|
241
241
|
|
|
242
242
|
Any DOM attributes you attach to `RebillyForm` will automatically be passed to the base `form` element.
|
|
243
243
|
|
|
244
|
-
`@error` will expose the error message returned if the `
|
|
244
|
+
`@error` will expose the error message returned if the `Framepay.createToken()` request failed. You can inspect `error.message` and `error.code`.
|
|
245
245
|
|
|
246
246
|
`@token-ready` will expose the token object, if a Google/Apple Pay element was mounted in the form.
|
|
247
247
|
|
|
@@ -280,7 +280,7 @@ If you want to perform your own logic after token creation but before form submi
|
|
|
280
280
|
|
|
281
281
|
#### With rebilly-token
|
|
282
282
|
|
|
283
|
-
If you prefer to call `createToken()` manually, use the example below. Note that you don't want to use the `Framepay` object directly, but rather the proxied `createToken` method provided by `framepay-vue`. This method returns a promise that waits for the FramePay script to be loaded before calling `
|
|
283
|
+
If you prefer to call `createToken()` manually, use the example below. Note that you don't want to use the `Framepay` object directly, but rather the proxied `createToken` method provided by `framepay-vue`. This method returns a promise that waits for the FramePay script to be loaded before calling `Framepay.createToken()`. Using the pattern below will help eliminate errors due to race conditions.
|
|
284
284
|
|
|
285
285
|
```html
|
|
286
286
|
<form @submit="submitHandler">
|
|
@@ -445,7 +445,7 @@ Because this will only change the ID of the element you are mounting Framepay to
|
|
|
445
445
|
|
|
446
446
|
#### `createToken` Proxy Method
|
|
447
447
|
|
|
448
|
-
`framepay-vue` exports a single method: `createToken()`. This method simply wraps
|
|
448
|
+
`framepay-vue` exports a single method: `createToken()`. This method simply wraps `Framepay.createToken()` in a promise to ensure that the Framepay script has loaded and the object is available. Be sure to import `createToken` from `@rebilly/framepay-vue` instead of using `Framepay.createToken()`, otherwise you may run into errors due to race conditions.
|
|
449
449
|
|
|
450
450
|
Again, you don't need to use `createToken` at all if you choose to use the `RebillyForm` component.
|
|
451
451
|
|