@zippypay/checkout 1.2.0 → 1.2.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 +52 -13
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.min.js +9 -9
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ Load from a public npm CDN:
|
|
|
108
108
|
</script>
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
Pin the version in production (e.g. `@1.
|
|
111
|
+
Pin the version in production (e.g. `@1.2.0` instead of `@1`).
|
|
112
112
|
|
|
113
113
|
---
|
|
114
114
|
|
|
@@ -134,9 +134,12 @@ type ZippyPayConfig = {
|
|
|
134
134
|
mode?: 'inline' | 'modal';
|
|
135
135
|
container?: HTMLElement | string; // required for inline
|
|
136
136
|
theme?: ZippyTheme;
|
|
137
|
-
/** Restrict checkout methods. Omit for full chooser (QR + manual). */
|
|
137
|
+
/** Restrict web checkout methods. Omit for full chooser (QR + manual). */
|
|
138
138
|
checkoutPolicy?: 'QR' | 'MANUAL';
|
|
139
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Phone-only app handoff. Ignored on desktop.
|
|
141
|
+
* Default policy: `enforce` (SDK 1.2.0+). Pass `{ policy: 'off' }` for web-only on phone.
|
|
142
|
+
*/
|
|
140
143
|
mobileApp?: { policy?: 'off' | 'option' | 'enforce' };
|
|
141
144
|
redirectOnComplete?: boolean;
|
|
142
145
|
redirectOnFailure?: boolean;
|
|
@@ -165,17 +168,52 @@ Control which payment methods customers can use:
|
|
|
165
168
|
|
|
166
169
|
### Mobile app (phone)
|
|
167
170
|
|
|
171
|
+
On **phone**, customers can pay in the Zippy app via **Pay with Zippy**. On **desktop**, mobile app settings are ignored — customers use QR and/or manual per `checkoutPolicy`.
|
|
172
|
+
|
|
168
173
|
| `mobileApp.policy` | Phone behavior |
|
|
169
174
|
|---|---|
|
|
170
|
-
| `
|
|
171
|
-
| `option` | “Pay with Zippy”
|
|
172
|
-
| `
|
|
175
|
+
| `enforce` *(default)* | Auto-starts Pay with Zippy; QR/manual hidden until app handoff fails |
|
|
176
|
+
| `option` | Full chooser plus a “Pay with Zippy” button |
|
|
177
|
+
| `off` | Web checkout only (QR / manual per `checkoutPolicy`) |
|
|
178
|
+
|
|
179
|
+
Omitting `mobileApp` (or `policy`) is the same as `enforce` (SDK **1.2.0+**). To keep web-only checkout on phone (behavior before 1.2.0):
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
mobileApp: { policy: 'off' }
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Pay with Zippy flow
|
|
186
|
+
|
|
187
|
+
1. Customer taps **Pay with Zippy** (or checkout auto-starts it when `enforce`).
|
|
188
|
+
2. The button becomes disabled and shows **Opening Zippy…** for up to **8 seconds**.
|
|
189
|
+
3. The SDK opens the app from that tap — checkout **stays on your page**:
|
|
190
|
+
- **iOS:** `https://zippypay.io/app/merchant-payment/{sessionId}`
|
|
191
|
+
- **Android:** intent URL for the same HTTPS link targeting `com.zippy.pay`
|
|
192
|
+
4. If the app opens → *Complete your payment in the Zippy app.*
|
|
193
|
+
5. If the app does not open → failed handoff UI:
|
|
194
|
+
- **Try again**
|
|
195
|
+
- **Or pay another way** (QR and/or manual per `checkoutPolicy`)
|
|
196
|
+
- **Install Zippy** (bottom) — opens the native store; **not** opened automatically
|
|
173
197
|
|
|
174
|
-
|
|
198
|
+
**Install Zippy store links** (fixed by Zippy, not merchant-configurable):
|
|
175
199
|
|
|
176
|
-
|
|
200
|
+
| Platform | Web / QR | Install button (native) |
|
|
201
|
+
|---|---|---|
|
|
202
|
+
| iOS | [App Store](https://apps.apple.com/in/app/zippypay/id6806799311) | `itms-apps://apps.apple.com/in/app/zippypay/id6806799311` |
|
|
203
|
+
| Android | [Google Play](https://play.google.com/store/apps/details?id=com.zippy.pay) | `market://details?id=com.zippy.pay` |
|
|
204
|
+
|
|
205
|
+
Deep links and QR payloads use **`sessionId` only** — never include `clientToken`.
|
|
206
|
+
|
|
207
|
+
#### Switching from mobile app to QR or manual
|
|
208
|
+
|
|
209
|
+
If checkout started as **MOBILE_APP** and the customer has **not** yet claimed payment in the app, they may switch from the **failed handoff** screen:
|
|
210
|
+
|
|
211
|
+
| Customer picks | SDK behavior |
|
|
212
|
+
|---|---|
|
|
213
|
+
| **QR code** | Starts QR checkout (pay timer is not reset) |
|
|
214
|
+
| **Zippy account (manual)** | Opens manual entry; backend switches to `MANUAL` when the payer is verified and attached |
|
|
177
215
|
|
|
178
|
-
|
|
216
|
+
After payment is claimed in the app or a payer is attached on manual, method switching is no longer available.
|
|
179
217
|
|
|
180
218
|
### Theming
|
|
181
219
|
|
|
@@ -206,13 +244,14 @@ The SDK guides customers through payment and keeps your page updated until the s
|
|
|
206
244
|
|---|---|
|
|
207
245
|
| **QR** | Scan a QR code in the Zippy app, then confirm payment in the app |
|
|
208
246
|
| **Manual** | Enter a Zippy ID, verify identity, then confirm payment in the app |
|
|
209
|
-
| **Mobile app** |
|
|
247
|
+
| **Mobile app (phone)** | Tap **Pay with Zippy** → pay in the app; fallback to QR/manual if the app cannot open |
|
|
210
248
|
|
|
211
|
-
After
|
|
249
|
+
After QR or manual checkout is committed, customers generally cannot switch methods. **Exception:** **MOBILE_APP → QR/MANUAL** is allowed **before claim**, via the failed handoff fallbacks.
|
|
212
250
|
|
|
213
251
|
### Timers and amount
|
|
214
252
|
|
|
215
|
-
- A **pay
|
|
253
|
+
- A **bottom pay progress bar** shows during the pay window (including idle **Pay with Zippy**).
|
|
254
|
+
- The **inline countdown timer** is hidden on idle and **Opening Zippy…**; it appears after the app opens, on failed handoff, and while awaiting payment.
|
|
216
255
|
- Display the **amount from the session** passed to your callbacks (`onReady`, `onSessionUpdate`, `onComplete`) — do not rely on amount props from your own page markup alone.
|
|
217
256
|
- Sessions also have idle and absolute expiry boundaries handled by the SDK UI.
|
|
218
257
|
|
|
@@ -228,7 +267,7 @@ After a method is chosen, the customer generally cannot switch to another method
|
|
|
228
267
|
| `session-id` | Session UUID |
|
|
229
268
|
| `mode` | `inline`, `modal` |
|
|
230
269
|
| `checkout-policy` | `QR`, `MANUAL` |
|
|
231
|
-
| `mobile-app-policy` | `option`, `enforce` |
|
|
270
|
+
| `mobile-app-policy` | `off`, `option`, `enforce` *(default: enforce when omitted)* |
|
|
232
271
|
| `theme-*` | See theming table above |
|
|
233
272
|
|
|
234
273
|
Set `clientToken` via the **property** (not an HTML attribute).
|