@rebilly/framepay-vue 12.123.0 → 12.125.0

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +143 -141
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [12.123.0](https://github.com/Rebilly/rebilly/compare/framepay-vue-v12.122.0...framepay-vue-v12.123.0) (2026-06-15)
1
+ ## [12.125.0](https://github.com/Rebilly/rebilly/compare/framepay-vue-v12.124.0...framepay-vue-v12.125.0) (2026-06-17)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#22691](https://github.com/Rebilly/rebilly/issues/22691)) ([1ad1ebe](https://github.com/Rebilly/rebilly/commit/1ad1ebedd1501017cec860ec915eb3783b54803d))
6
+ * **recomm, replay-elements, team-docs:** Extract ScoringStrategy into a named schema and rebuild SDK ([#22767](https://github.com/Rebilly/rebilly/issues/22767)) ([82dd5b4](https://github.com/Rebilly/rebilly/commit/82dd5b442850113ca5e229afef4c3f7079d4876f))
package/README.md CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  > Vue components for FramePay.js
4
4
 
5
- Supported:
5
+ Supported:
6
+
6
7
  - framepay-vue < 3.0.0 supports Vue 2.4+
7
8
  - framepay-vue >= 3.0.0 supports Vue 3
8
9
 
9
10
  This is the repo for the official Vue.js wrapper for Rebilly's [FramePay](https://www.rebilly.com/docs/dev-docs/framepay/). This package provides a flexible set of methods and components to allow drop-in support of FramePay in any Vue project.
10
11
 
11
12
  ## Table of Contents
13
+
12
14
  - [framepay-vue](#framepay-vue)
13
15
  - [Table of Contents](#table-of-contents)
14
16
  - [FramePay Documentation](#framepay-documentation)
@@ -57,18 +59,21 @@ This is the repo for the official Vue.js wrapper for Rebilly's [FramePay](https:
57
59
  For more information on FramePay see its [official documentation](https://www.rebilly.com/docs/developer-docs/framepay/).
58
60
 
59
61
  ## Demos
60
- - [Basic card example](https://codesandbox.io/s/framepay-vue-basic-card-example-ydr7s)
61
62
 
63
+ - [Basic card example](https://codesandbox.io/s/framepay-vue-basic-card-example-ydr7s)
62
64
 
63
65
  ## Installation
66
+
64
67
  **Step 1:**
65
68
 
66
69
  Install using [Yarn](https://yarnpkg.com/en/):
70
+
67
71
  ```
68
72
  yarn add @rebilly/framepay-vue
69
73
  ```
70
74
 
71
75
  Or using NPM:
76
+
72
77
  ```
73
78
  npm install @rebilly/framepay-vue --save
74
79
  ```
@@ -82,6 +87,7 @@ import FramePay from '@rebilly/framepay-vue';
82
87
 
83
88
  app.use(FramePay);
84
89
  ```
90
+
85
91
  `app.use()` also accepts an optional argument for initialization options. See [Initialization](#initialization) below.
86
92
 
87
93
  ## Getting Started
@@ -99,7 +105,7 @@ See here for all initialization options: https://www.rebilly.com/docs/dev-docs/f
99
105
  import FramePay from '@rebilly/framepay-vue';
100
106
 
101
107
  const configuration = {
102
- publishableKey: 'pk_sandbox_1234567890',
108
+ publishableKey: 'pk_sandbox_1234567890',
103
109
  };
104
110
  app.use(FramePay, configuration);
105
111
  ```
@@ -110,48 +116,45 @@ Add the `publishableKey` on only the first component in the template.
110
116
 
111
117
  ```html
112
118
  <rebilly-form :configuration="{ publishableKey: 'pk_sandbox_1234567890' }">
113
- <input data-rebilly="firstName">
114
- <input data-rebilly="lastName">
115
- <rebilly-card></rebilly-card>
116
- </rebilly-form>
119
+ <input data-rebilly="firstName" />
120
+ <input data-rebilly="lastName" />
121
+ <rebilly-card></rebilly-card>
122
+ </rebilly-form>
117
123
  ```
118
124
 
119
- *NOTE:* Do not include the `publishableKey` on a component if you have already passed it via the config object when calling `app.use(Framepay, config)`.
125
+ _NOTE:_ Do not include the `publishableKey` on a component if you have already passed it via the config object when calling `app.use(Framepay, config)`.
120
126
 
121
127
  #### Lazy loading Framepay files
122
128
 
123
- The Framepay script files will be loaded as soon as `app.use(Framepay)` is called. This does not necessarily need to be done when the app loads, and can instead be done inside the Vue component which actually uses Framepay. In the following example, the Framepay script will not be fetched until the `created()` hook is called.
129
+ The Framepay script files will be loaded as soon as `app.use(Framepay)` is called. This does not necessarily need to be done when the app loads, and can instead be done inside the Vue component which actually uses Framepay. In the following example, the Framepay script will not be fetched until the `created()` hook is called.
124
130
 
125
131
  The script will only be loaded the first time `created()` is called, so you can safely call `created()` multiple times without worrying about duplicates.
126
132
 
127
133
  ```html
128
134
  <template>
129
- <rebilly-form>
130
- <input data-rebilly="firstName">
131
- <input data-rebilly="lastName">
132
- <rebilly-card></rebilly-card>
133
- </rebilly-form>
135
+ <rebilly-form>
136
+ <input data-rebilly="firstName" />
137
+ <input data-rebilly="lastName" />
138
+ <rebilly-card></rebilly-card>
139
+ </rebilly-form>
134
140
  </template>
135
141
 
136
142
  <script>
137
- import FramePay, {
138
- RebillyForm,
139
- RebillyCard,
140
- } from '@rebilly/framepay-vue';
141
-
142
- export default {
143
- components: {
144
- RebillyForm,
145
- RebillyCard,
146
- },
147
- created() {
148
- const config = {
149
- publishableKey: 'pk_sandbox_1234567890',
150
- // etc
151
- };
152
- app.use(FramePay, config);
153
- },
154
- };
143
+ import FramePay, { RebillyForm, RebillyCard } from '@rebilly/framepay-vue';
144
+
145
+ export default {
146
+ components: {
147
+ RebillyForm,
148
+ RebillyCard,
149
+ },
150
+ created() {
151
+ const config = {
152
+ publishableKey: 'pk_sandbox_1234567890',
153
+ // etc
154
+ };
155
+ app.use(FramePay, config);
156
+ },
157
+ };
155
158
  </script>
156
159
  ```
157
160
 
@@ -164,21 +167,22 @@ The script will only be loaded the first time `created()` is called, so you can
164
167
  - `RebillyBankAccountNumber`, `RebillyBankAccountType`, and `RebillyBankRoutingNumber` mount the `ach` (bank account) payment method
165
168
  - `RebillyGooglePay` and `RebillyApplePay` mount Google Pay and Apple Pay respectively. These two methods are different from the rest, as they require additional inputs and emit the payment token with a separate event.
166
169
 
167
- Two more components are also offered for convenience:
170
+ Two more components are also offered for convenience:
168
171
 
169
172
  - `RebillyForm` wraps a regular HTML `form`. It automatically detects payment method components and performs token creation/injection when the form is submitted. It is the simplest way to get started with `framepay-vue`.
170
- - `RebillyToken` can be added to any standard form, and when present will automatically receive the token created by `createToken()`. You do not need to use `RebillyToken` if you are using `RebillyForm` already.
173
+ - `RebillyToken` can be added to any standard form, and when present will automatically receive the token created by `createToken()`. You do not need to use `RebillyToken` if you are using `RebillyForm` already.
171
174
 
172
175
  #### Google Pay and Apple Pay
176
+
173
177
  `RebillyGooglePay` and `RebillyApplePay` are used like so:
178
+
174
179
  ```html
175
- <rebilly-apple-pay
176
- @token-ready="handleToken"
177
- />
180
+ <rebilly-apple-pay @token-ready="handleToken" />
178
181
  ```
179
182
 
180
183
  whereas:
181
- * `@token-ready` is an event emitted once the payment token has been generated and its payload contains the token object.
184
+
185
+ - `@token-ready` is an event emitted once the payment token has been generated and its payload contains the token object.
182
186
 
183
187
  #### With rebilly-form
184
188
 
@@ -186,22 +190,23 @@ The default behavior of `RebillyForm` is to intercept the regular submit event,
186
190
 
187
191
  ```html
188
192
  <rebilly-form @error="" @token-ready="" :extraData="{}">
189
- <input data-rebilly="firstName">
190
- <input data-rebilly="lastName">
191
- <rebilly-card></rebilly-card>
193
+ <input data-rebilly="firstName" />
194
+ <input data-rebilly="lastName" />
195
+ <rebilly-card></rebilly-card>
192
196
  </rebilly-form>
193
197
 
194
198
  <script>
195
- import { RebillyForm, RebillyCard } from '@rebilly/framepay-vue';
199
+ import { RebillyForm, RebillyCard } from '@rebilly/framepay-vue';
196
200
 
197
- export default {
201
+ export default {
198
202
  components: {
199
- RebillyCard,
200
- RebillyForm,
203
+ RebillyCard,
204
+ RebillyForm,
201
205
  },
202
- };
206
+ };
203
207
  </script>
204
208
  ```
209
+
205
210
  Any DOM attributes you attach to `RebillyForm` will automatically be passed to the base `form` element.
206
211
 
207
212
  `@error` will expose the error message returned if the `Rebilly.createToken()` request failed. You can inspect `error.message` and `error.code`.
@@ -212,104 +217,103 @@ See here for all arguments to `extraData`: https://www.rebilly.com/docs/dev-docs
212
217
 
213
218
  See here for list of `data-rebilly` types: https://www.rebilly.com/docs/dev-docs/form-setup.
214
219
 
215
-
216
220
  #### With rebilly-form and custom submit logic
217
221
 
218
222
  If you want to perform your own logic after token creation but before form submission, attach a listener to `@submit` on `RebillyForm`. If `RebillyForm` detects the listener on `@submit`, it will not submit the form automatically but instead emit it alongside the newly created token.
219
223
 
220
224
  ```html
221
225
  <rebilly-form @submit="submitHandler" @error="" :extraData="{}">
222
- <input data-rebilly="firstName">
223
- <input data-rebilly="lastName">
224
- <rebilly-card></rebilly-card>
226
+ <input data-rebilly="firstName" />
227
+ <input data-rebilly="lastName" />
228
+ <rebilly-card></rebilly-card>
225
229
  </rebilly-form>
226
230
 
227
231
  <script>
228
- import { RebillyForm, RebillyCard } from '@rebilly/framepay-vue';
232
+ import { RebillyForm, RebillyCard } from '@rebilly/framepay-vue';
229
233
 
230
- export default {
234
+ export default {
231
235
  components: {
232
- RebillyCard,
233
- RebillyForm,
236
+ RebillyCard,
237
+ RebillyForm,
234
238
  },
235
239
  methods: {
236
- submitHandler(token, form) {
237
- // do something with token
238
- form.submit()
239
- },
240
+ submitHandler(token, form) {
241
+ // do something with token
242
+ form.submit();
243
+ },
240
244
  },
241
- };
245
+ };
242
246
  </script>
243
247
  ```
244
248
 
245
249
  #### With rebilly-token
246
250
 
247
- 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 `Rebilly.createToken()`. Using the pattern below will help eliminate errors due to race conditions.
251
+ 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 `Rebilly.createToken()`. Using the pattern below will help eliminate errors due to race conditions.
248
252
 
249
253
  ```html
250
254
  <form @submit="submitHandler">
251
- <input data-rebilly="firstName">
252
- <input data-rebilly="lastName">
253
- <rebilly-card></rebilly-card>
254
- <rebilly-token></rebilly-token>
255
+ <input data-rebilly="firstName" />
256
+ <input data-rebilly="lastName" />
257
+ <rebilly-card></rebilly-card>
258
+ <rebilly-token></rebilly-token>
255
259
  </form>
256
260
 
257
261
  <script>
258
- import { createToken, RebillyCard, RebillyToken } from '@rebilly/framepay-vue';
259
-
260
- export default {
261
- methods: {
262
- submitHandler(event) {
263
- event.preventDefault();
264
- const form = event.target;
265
- const extraData = { } // some stuff
266
- createToken(form, extraData))
267
- .then((token) => {
268
- // the token is already added to the form via RebillyToken
269
- form.submit();
270
- })
271
- .catch((error) => {
272
- // see error.code and error.message
273
- console.log(error);
274
- });
275
- },
276
- },
277
- };
262
+ import { createToken, RebillyCard, RebillyToken } from '@rebilly/framepay-vue';
263
+
264
+ export default {
265
+ methods: {
266
+ submitHandler(event) {
267
+ event.preventDefault();
268
+ const form = event.target;
269
+ const extraData = { } // some stuff
270
+ createToken(form, extraData))
271
+ .then((token) => {
272
+ // the token is already added to the form via RebillyToken
273
+ form.submit();
274
+ })
275
+ .catch((error) => {
276
+ // see error.code and error.message
277
+ console.log(error);
278
+ });
279
+ },
280
+ },
281
+ };
278
282
  </script>
279
283
  ```
280
284
 
281
285
  #### Handle token manually
282
286
 
283
- The token can also be handled entirely manually. As above, be sure to call the imported `createToken()` method instead of the global `Framepay` object. This approach offers the most flexibility, but still removes the need for you to handle initialization, mounting and destruction of payment method elements.
287
+ The token can also be handled entirely manually. As above, be sure to call the imported `createToken()` method instead of the global `Framepay` object. This approach offers the most flexibility, but still removes the need for you to handle initialization, mounting and destruction of payment method elements.
284
288
 
285
289
  ```html
286
290
  <form @submit="submitHandler">
287
- <input data-rebilly="firstName">
288
- <input data-rebilly="lastName">
289
- <rebilly-card></rebilly-card>
291
+ <input data-rebilly="firstName" />
292
+ <input data-rebilly="lastName" />
293
+ <rebilly-card></rebilly-card>
290
294
  </form>
291
295
 
292
296
  <script>
293
- import { createToken, RebillyCard } from '@rebilly/framepay-vue';
294
-
295
- export default {
296
- methods: {
297
- submitHandler(event) {
298
- event.preventDefault();
299
- const form = event.target;
300
- const extraData = { } // some stuff
301
- createToken(form, extraData))
302
- .then((token) => {
303
- // you must dynamically add the token id to the form
304
- form.submit();
305
- })
306
- .catch((error) => {
307
- // see error.code and error.message
308
- console.log(error);
309
- });
310
- },
311
- },
312
- };
297
+ import { createToken, RebillyCard } from '@rebilly/framepay-vue';
298
+
299
+ export default {
300
+ methods: {
301
+ submitHandler(event) {
302
+ event.preventDefault();
303
+ const form = event.target;
304
+ const extraData = { } // some stuff
305
+ createToken(form, extraData))
306
+ .then((token) => {
307
+ // you must dynamically add the token id to the form
308
+ form.submit();
309
+ })
310
+ .catch((error) => {
311
+ // see error.code and error.message
312
+ console.log(error);
313
+ });
314
+ },
315
+ },
316
+ };
313
317
  </script>
314
318
  ```
315
319
 
@@ -323,37 +327,36 @@ Framepay will automatically use the first payment method it detects in the form.
323
327
 
324
328
  ```html
325
329
  <rebilly-form @error="" :extraData="{}">
326
- <input data-rebilly="firstName">
327
- <input data-rebilly="lastName">
328
- <rebilly-card v-if="paymentMethod === 'payment-card'"></rebilly-card>
329
- <div v-if="paymentMethod=== 'ach'">
330
- <rebilly-bank-account-type></rebilly-bank-account-type>
331
- <rebilly-bank-account-number></rebilly-bank-account-number>
332
- <rebilly-bank-routing-number></rebilly-bank-routing-number>
333
- </div>
330
+ <input data-rebilly="firstName" />
331
+ <input data-rebilly="lastName" />
332
+ <rebilly-card v-if="paymentMethod === 'payment-card'"></rebilly-card>
333
+ <div v-if="paymentMethod=== 'ach'">
334
+ <rebilly-bank-account-type></rebilly-bank-account-type>
335
+ <rebilly-bank-account-number></rebilly-bank-account-number>
336
+ <rebilly-bank-routing-number></rebilly-bank-routing-number>
337
+ </div>
334
338
  </rebilly-form>
335
339
 
336
340
  <button @click="paymentMethod = 'payment-card'">PaymentCard</button>
337
341
  <button @click="paymentMethod = 'ach'">Bank</button>
338
342
  ```
339
343
 
340
-
341
344
  #### v-show
342
345
 
343
- `v-if` causes the elements to be destroyed and recycled, meaning payment method fields will be re-mounted each time `method` changes in the above example.
346
+ `v-if` causes the elements to be destroyed and recycled, meaning payment method fields will be re-mounted each time `method` changes in the above example.
344
347
 
345
- It is possible to use `v-show` instead, which will allow you to preserve the user's input when they switch payment methods in your UI. However, you must specify which `method` FramePay should use to create the token, by passing it to `extraData`.
348
+ It is possible to use `v-show` instead, which will allow you to preserve the user's input when they switch payment methods in your UI. However, you must specify which `method` FramePay should use to create the token, by passing it to `extraData`.
346
349
 
347
350
  ```html
348
351
  <rebilly-form @error="" :extraData="{ method: paymentMethod }">
349
- <input data-rebilly="firstName">
350
- <input data-rebilly="lastName">
351
- <rebilly-card v-show="paymentMethod === 'payment-card'"></rebilly-card>
352
- <div v-show="paymentMethod=== 'ach'">
353
- <rebilly-bank-account-type></rebilly-bank-account-type>
354
- <rebilly-bank-account-number></rebilly-bank-account-number>
355
- <rebilly-bank-routing-number></rebilly-bank-routing-number>
356
- </div>
352
+ <input data-rebilly="firstName" />
353
+ <input data-rebilly="lastName" />
354
+ <rebilly-card v-show="paymentMethod === 'payment-card'"></rebilly-card>
355
+ <div v-show="paymentMethod=== 'ach'">
356
+ <rebilly-bank-account-type></rebilly-bank-account-type>
357
+ <rebilly-bank-account-number></rebilly-bank-account-number>
358
+ <rebilly-bank-routing-number></rebilly-bank-routing-number>
359
+ </div>
357
360
  </rebilly-form>
358
361
 
359
362
  <button @click="paymentMethod = 'payment-card'">PaymentCard</button>
@@ -364,7 +367,7 @@ It is possible to use `v-show` instead, which will allow you to preserve the use
364
367
 
365
368
  #### `rebilly-form`
366
369
 
367
- As covered above, `rebilly-form` emits `error` and `submit` events.
370
+ As covered above, `rebilly-form` emits `error` and `submit` events.
368
371
 
369
372
  #### on payment method components
370
373
 
@@ -374,23 +377,23 @@ See details: https://www.rebilly.com/docs/dev-docs/element
374
377
 
375
378
  ### Validation
376
379
 
377
- Validation errors on payment method components can be detected by attaching a listener to `change`.
380
+ Validation errors on payment method components can be detected by attaching a listener to `change`.
378
381
 
379
382
  ```html
380
383
  <rebilly-form @error="" :extraData="{}">
381
- <input data-rebilly="firstName">
382
- <input data-rebilly="lastName">
383
- <rebilly-card @change="changeHandler"></rebilly-card>
384
+ <input data-rebilly="firstName" />
385
+ <input data-rebilly="lastName" />
386
+ <rebilly-card @change="changeHandler"></rebilly-card>
384
387
  </rebilly-form>
385
388
 
386
389
  <script>
387
- export default {
388
- methods: {
389
- changeHandler(e) {
390
- // e.valid, e.source, e.error
391
- },
392
- },
393
- };
390
+ export default {
391
+ methods: {
392
+ changeHandler(e) {
393
+ // e.valid, e.source, e.error
394
+ },
395
+ },
396
+ };
394
397
  </script>
395
398
  ```
396
399
 
@@ -410,7 +413,7 @@ Because this will only change the ID of the element you are mounting Framepay to
410
413
 
411
414
  #### `createToken` Proxy Method
412
415
 
413
- `framepay-vue` exports a single method: `createToken()`. This method simply wraps the Framepay method `Rebilly.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 `Rebilly.createToken()`, otherwise you may run into errors due to race conditions.
416
+ `framepay-vue` exports a single method: `createToken()`. This method simply wraps the Framepay method `Rebilly.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 `Rebilly.createToken()`, otherwise you may run into errors due to race conditions.
414
417
 
415
418
  Again, you don't need to use `createToken` at all if you choose to use the `RebillyForm` component.
416
419
 
@@ -480,4 +483,3 @@ Payment method components all accept the same props:
480
483
 
481
484
  Rebilly API for Payment Tokens
482
485
  https://rebilly.github.io/RebillyAPI/#tag/Payment-Tokens
483
-
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebilly/framepay-vue",
3
3
  "type": "module",
4
- "version": "12.123.0",
4
+ "version": "12.125.0",
5
5
  "description": "Official Vue wrapper for Rebilly FramePay",
6
6
  "author": "Rebilly",
7
7
  "repository": {