@vaultsaas/core 0.1.0 → 0.1.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 +4 -4
- package/dist/index.cjs +15 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,10 +54,7 @@ try {
|
|
|
54
54
|
currency: 'USD',
|
|
55
55
|
paymentMethod: {
|
|
56
56
|
type: 'card',
|
|
57
|
-
|
|
58
|
-
expMonth: 12,
|
|
59
|
-
expYear: 2030,
|
|
60
|
-
cvc: '123',
|
|
57
|
+
token: 'pm_card_visa',
|
|
61
58
|
},
|
|
62
59
|
customer: {
|
|
63
60
|
email: 'buyer@example.com',
|
|
@@ -103,6 +100,9 @@ Run:
|
|
|
103
100
|
STRIPE_API_KEY=sk_test_xxx bun quickstart.ts
|
|
104
101
|
```
|
|
105
102
|
|
|
103
|
+
Note: if you include `customer.name` for Stripe shipping details, also include `customer.address` to avoid provider validation errors.
|
|
104
|
+
For Stripe test mode, use test tokens/payment methods (for example `pm_card_visa`) instead of raw card numbers unless Stripe has explicitly enabled raw card data APIs on your account.
|
|
105
|
+
|
|
106
106
|
## Documentation
|
|
107
107
|
|
|
108
108
|
- [Routing](./docs/routing.md)
|
package/dist/index.cjs
CHANGED
|
@@ -2109,8 +2109,21 @@ var StripeAdapter = class _StripeAdapter {
|
|
|
2109
2109
|
if (request.customer?.email) {
|
|
2110
2110
|
body.receipt_email = request.customer.email;
|
|
2111
2111
|
}
|
|
2112
|
-
if (request.customer?.
|
|
2113
|
-
|
|
2112
|
+
if (request.customer?.address) {
|
|
2113
|
+
const { address, name } = request.customer;
|
|
2114
|
+
if (name) {
|
|
2115
|
+
body["shipping[name]"] = name;
|
|
2116
|
+
}
|
|
2117
|
+
body["shipping[address][line1]"] = address.line1;
|
|
2118
|
+
if (address.line2) {
|
|
2119
|
+
body["shipping[address][line2]"] = address.line2;
|
|
2120
|
+
}
|
|
2121
|
+
body["shipping[address][city]"] = address.city;
|
|
2122
|
+
if (address.state) {
|
|
2123
|
+
body["shipping[address][state]"] = address.state;
|
|
2124
|
+
}
|
|
2125
|
+
body["shipping[address][postal_code]"] = address.postalCode;
|
|
2126
|
+
body["shipping[address][country]"] = address.country;
|
|
2114
2127
|
}
|
|
2115
2128
|
const intent = await this.postForm(
|
|
2116
2129
|
"/v1/payment_intents",
|