@flopay/vue 2.0.0 → 2.0.2

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
@@ -173,23 +173,23 @@ No public prop, option or type names a payment processor any more. Payment metho
173
173
  - `fallbackPublishableKey`: `fallbackPublishableKey` is deleted with no replacement.
174
174
  - CheckoutGateways (`gateways.stripe`, `gateways.paypal`): `paymentMethods`: availability of `card`, `paypal`, `wallets` and `apms`, with no processor key. `gateways.stripe` becomes `card`, `wallets` and `apms`; `gateways.paypal` becomes `paypal`.
175
175
 
176
- `showPayPal` stays: `showPayPal: false` is forwarded as hiding `paypal`, merged with any `hiddenPaymentMethods` you pass. Omitting both hides nothing. The presentation props the runtime accepts (`appearance`, `strings`, `layout`, `paymentMethodLayout`, and the setup components' `theme`, `appearance` and `buttonsStyles`) are forwarded, not interpreted. Seven more 1.x checkout props stay and are forwarded too; see **Known limits in 2.0.0** below.
176
+ `showPayPal` stays: `showPayPal: false` is forwarded as hiding `paypal`, merged with any `hiddenPaymentMethods` you pass. Omitting both hides nothing. The presentation props the runtime accepts (`appearance`, `strings`, `layout`, `paymentMethodLayout`, and the setup components' `theme`, `appearance` and `buttonsStyles`) are forwarded, not interpreted. Seven more 1.x checkout props stay, are forwarded too and work again from runtime contract 2.6.0; see **Known limits in 2.0.0** below.
177
177
 
178
178
  **Default checkout mode.** A session created with no `checkoutMode` now defaults to `'full'` (it was `'confirm'` in 1.x), in `@flopay/js` and `@flopay/node`. An explicit `'confirm'`, `'auto'` or `'full'` is sent unchanged. Merchants who want the old default must set `checkoutMode: 'confirm'` and create the session from a server with merchant credentials (`@flopay/node` `checkout.sessions.createOneClick`, handed to `getSession`).
179
179
 
180
180
  ### Known limits in 2.0.0
181
181
 
182
- `FloPayCheckout`, `SplitCardForm`, `FloPayAutomaticPaymentButton`, `DirectPayPalButton` and `VaultCardFields` take the same seven 1.x props as React and forward them to the hosted runtime unchanged, but **the runtime does not act on them yet, so in 2.0.0 they have no effect**: `theme`, `showCardBrandIcons`, `showCardFieldLabels`, `cardFieldLabels`, `cardFieldPlaceholders`, `enabledPaymentMethods` and `initialPayPalOrderId`. They are not removed. A component that sets them keeps type-checking and emits no error, and it needs no change once the runtime supports them. Omitted, nothing is sent.
182
+ `FloPayCheckout`, `SplitCardForm`, `FloPayAutomaticPaymentButton`, `DirectPayPalButton` and `VaultCardFields` take the same seven 1.x props as React and forward them to the hosted runtime, which acts on them (runtime contract 2.6.0): `theme`, `showCardBrandIcons`, `showCardFieldLabels`, `cardFieldLabels`, `cardFieldPlaceholders`, `enabledPaymentMethods` and `initialPayPalOrderId`. The 2.0.0 runtime ignored them; a component that already sets them needs no change for them to work. A mount that sets any of them declares contract 2.6.0. Omitted, nothing is sent.
183
183
 
184
- - `theme` leaves the checkout's look as it is. On `FloPayCardSetup` and `FloPayPaymentMethodSetup`, `theme` is applied.
185
- - `showCardBrandIcons`, `showCardFieldLabels`, `cardFieldLabels` and `cardFieldPlaceholders` leave the hosted card form's own icons, labels and placeholder text as they are. `cardFieldLabels` and `cardFieldPlaceholders` take optional `number`, `expiry`, `cvv` and `name` text.
186
- - `enabledPaymentMethods` does not narrow the payment methods on offer. The session's `paymentMethods` decide which methods the runtime offers, and `hiddenPaymentMethods` hides them.
187
- - `initialPayPalOrderId` does not resume a PayPal order.
184
+ - `theme` styles the hosted card form: a `ThemeId`, or the raw colours as an object. On `FloPayCardSetup` and `FloPayPaymentMethodSetup`, `theme` is applied to the setup form.
185
+ - `showCardBrandIcons` and `showCardFieldLabels` turn the hosted card form's brand icons and field labels on or off, and `cardFieldLabels` and `cardFieldPlaceholders` set its label and placeholder text, from optional `number`, `expiry`, `cvv` and `name` text. The runtime hands them to the card form when it loads and again whenever it becomes ready again. Changing one of them mounts the checkout again with the new value.
186
+ - `enabledPaymentMethods` narrows the payment methods on offer, by the same names as `hiddenPaymentMethods`: `card`, `paypal`, `apple_pay`, `google_pay`, `apms`, or one alternative method such as `ideal`. A method is shown only when the session's `paymentMethods` offer it, it is enabled and it is not hidden: the list never adds a method. Omitted or empty, every offered method is shown.
187
+ - `initialPayPalOrderId` resumes a PayPal order you already created: the buyer's PayPal click starts from that order instead of creating a new one, and approving it pays that order once.
188
188
 
189
189
  `appearance` still carries any `.Label` rule you set for the labels. In 1.x the labels used its `color`, `fontSize`, `fontWeight`, `letterSpacing`, `textTransform` and `marginBottom`, and every other `.Label` property was ignored.
190
190
 
191
191
  ```ts
192
- // Forwarded unchanged in 2.0.0.
192
+ // Labels above the hosted card fields, with your own placeholder text.
193
193
  h(FloPayCheckout, {
194
194
  sessionId: 'sess_123',
195
195
  nonce: 'nonce_123',
package/dist/index.cjs CHANGED
@@ -268,7 +268,26 @@ function asFloPayError(caught) {
268
268
  var RUNTIME_CONTRACT_VERSION = "2.2.0";
269
269
  var SAVED_PAYMENT_CONTRACT_VERSION = "2.3.0";
270
270
  var HIDDEN_PAYMENT_METHODS_CONTRACT_VERSION = "2.5.0";
271
+ var PRESENTATION_CONTRACT_VERSION = "2.6.0";
272
+ var OPTIONS_BEFORE_PRESENTATION = /* @__PURE__ */ new Set([
273
+ "publishableKey",
274
+ "sessionId",
275
+ "nonce",
276
+ "createSession",
277
+ "appearance",
278
+ "strings",
279
+ "onEvent",
280
+ "contractVersion",
281
+ "paymentMethodLayout",
282
+ "layout",
283
+ "automaticPayment",
284
+ "setup",
285
+ "hiddenPaymentMethods"
286
+ ]);
271
287
  function declaredContractVersion(savedPayment, extra) {
288
+ if (extra !== void 0 && Object.keys(extra).some((name) => !OPTIONS_BEFORE_PRESENTATION.has(name))) {
289
+ return PRESENTATION_CONTRACT_VERSION;
290
+ }
272
291
  if (extra !== void 0 && "hiddenPaymentMethods" in extra) {
273
292
  return HIDDEN_PAYMENT_METHODS_CONTRACT_VERSION;
274
293
  }
package/dist/index.mjs CHANGED
@@ -25,7 +25,26 @@ function asFloPayError(caught) {
25
25
  var RUNTIME_CONTRACT_VERSION = "2.2.0";
26
26
  var SAVED_PAYMENT_CONTRACT_VERSION = "2.3.0";
27
27
  var HIDDEN_PAYMENT_METHODS_CONTRACT_VERSION = "2.5.0";
28
+ var PRESENTATION_CONTRACT_VERSION = "2.6.0";
29
+ var OPTIONS_BEFORE_PRESENTATION = /* @__PURE__ */ new Set([
30
+ "publishableKey",
31
+ "sessionId",
32
+ "nonce",
33
+ "createSession",
34
+ "appearance",
35
+ "strings",
36
+ "onEvent",
37
+ "contractVersion",
38
+ "paymentMethodLayout",
39
+ "layout",
40
+ "automaticPayment",
41
+ "setup",
42
+ "hiddenPaymentMethods"
43
+ ]);
28
44
  function declaredContractVersion(savedPayment, extra) {
45
+ if (extra !== void 0 && Object.keys(extra).some((name) => !OPTIONS_BEFORE_PRESENTATION.has(name))) {
46
+ return PRESENTATION_CONTRACT_VERSION;
47
+ }
29
48
  if (extra !== void 0 && "hiddenPaymentMethods" in extra) {
30
49
  return HIDDEN_PAYMENT_METHODS_CONTRACT_VERSION;
31
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/vue",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {
@@ -36,8 +36,8 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@flopay/js": "2.0.0",
40
- "@flopay/shared": "2.0.0"
39
+ "@flopay/js": "2.0.2",
40
+ "@flopay/shared": "2.0.2"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "vue": ">=3.3.0"