@vaultsaas/core 0.1.0 → 0.1.1

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
@@ -103,6 +103,8 @@ Run:
103
103
  STRIPE_API_KEY=sk_test_xxx bun quickstart.ts
104
104
  ```
105
105
 
106
+ Note: if you include `customer.name` for Stripe shipping details, also include `customer.address` to avoid provider validation errors.
107
+
106
108
  ## Documentation
107
109
 
108
110
  - [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?.name) {
2113
- body["shipping[name]"] = request.customer.name;
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",