@payment-kit-js/vanilla 0.3.0-alpha.1 → 0.3.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.
- package/README.md +1 -61
- package/dist/cdn/paymentkit.js +1979 -0
- package/dist/cdn/paymentkit.js.map +7 -0
- package/dist/cdn/paymentkit.min.js +10 -0
- package/dist/cdn/paymentkit.min.js.map +7 -0
- package/dist/{connect-tunnel-x-rLA6I_EO.d.mts → connect-tunnel-x-B7iMQ7DX.d.mts} +17 -3
- package/dist/connect-tunnel-x-B7iMQ7DX.d.mts.map +1 -0
- package/dist/connect-tunnel-x-BhVAej5Q.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/payment-methods/card.d.mts +2 -2
- package/dist/payment-methods/card.mjs.map +1 -1
- package/dist/payment-methods/google-pay.d.mts +2 -2
- package/dist/payment-methods/google-pay.d.mts.map +1 -1
- package/dist/payment-methods/google-pay.mjs.map +1 -1
- package/dist/payment-methods/paypal.d.mts +2 -2
- package/dist/penpal/connect-tunnel-x.d.mts +1 -1
- package/dist/{types-WgbMhIYb.d.mts → types-DsVMq4jZ.d.mts} +2 -2
- package/dist/{types-WgbMhIYb.d.mts.map → types-DsVMq4jZ.d.mts.map} +1 -1
- package/package.json +8 -4
- package/dist/connect-tunnel-x-rLA6I_EO.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -6,64 +6,4 @@ Vanilla JavaScript SDK for PaymentKit. A type-safe, framework-agnostic payment p
|
|
|
6
6
|
|
|
7
7
|
For complete documentation, guides, and examples, visit:
|
|
8
8
|
|
|
9
|
-
**[PaymentKit.js Documentation](https://docs.paymentkit.com/guides/integration/
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install @payment-kit-js/vanilla
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Quick Start
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
import PaymentKit from '@payment-kit-js/vanilla';
|
|
21
|
-
import CardPaymentMethod from '@payment-kit-js/vanilla/payment-methods/card';
|
|
22
|
-
|
|
23
|
-
const paymentKit = PaymentKit({
|
|
24
|
-
environment: 'production', // 'sandbox' or 'production'
|
|
25
|
-
secureToken: 'checkout_session_token',
|
|
26
|
-
paymentMethods: [CardPaymentMethod]
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Mount card inputs
|
|
30
|
-
paymentKit.card.createElement('card_pan').mount('#card-number');
|
|
31
|
-
paymentKit.card.createElement('card_exp').mount('#card-expiry');
|
|
32
|
-
paymentKit.card.createElement('card_cvc').mount('#card-cvc');
|
|
33
|
-
|
|
34
|
-
// Submit payment
|
|
35
|
-
paymentKit.submit({
|
|
36
|
-
fields: {
|
|
37
|
-
customer_name: 'John Doe',
|
|
38
|
-
customer_email: 'john@example.com',
|
|
39
|
-
customer_country: 'US',
|
|
40
|
-
customer_zip_code: '10001'
|
|
41
|
-
},
|
|
42
|
-
paymentMethod: 'card',
|
|
43
|
-
onSuccess: (result) => console.log('Success:', result),
|
|
44
|
-
onError: (errors) => console.error('Error:', errors)
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// Cleanup when done
|
|
48
|
-
paymentKit.cleanup();
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Payment Methods
|
|
52
|
-
|
|
53
|
-
| Method | Import |
|
|
54
|
-
|--------|--------|
|
|
55
|
-
| Card | `@payment-kit-js/vanilla/payment-methods/card` |
|
|
56
|
-
| PayPal | `@payment-kit-js/vanilla/payment-methods/paypal` |
|
|
57
|
-
| Google Pay | `@payment-kit-js/vanilla/payment-methods/google-pay` |
|
|
58
|
-
|
|
59
|
-
## Configuration
|
|
60
|
-
|
|
61
|
-
| Parameter | Type | Description |
|
|
62
|
-
|-----------|------|-------------|
|
|
63
|
-
| `environment` | `string` | `'sandbox'` or `'production'` |
|
|
64
|
-
| `secureToken` | `string` | Checkout session token from your backend |
|
|
65
|
-
| `paymentMethods` | `array` | Array of payment method handlers to enable |
|
|
66
|
-
|
|
67
|
-
## License
|
|
68
|
-
|
|
69
|
-
MIT
|
|
9
|
+
**[PaymentKit.js Documentation](https://docs.paymentkit.com/guides/integration/sdk-reference/payment-kit-js/getting-started)**
|