@spree/docs 0.1.55 → 0.1.57
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.
|
@@ -155,6 +155,41 @@ Storefronts and custom integrations that act on the cart should expect this new
|
|
|
155
155
|
|
|
156
156
|
Other customers now see availability reduced by all active reservations, not just by completed orders. This is the intended fix to overselling — but if you have a real-time inventory dashboard that reads `count_on_hand` directly (rather than going through Spree's availability checks), you'll want to expose a "Reserved" axis to merchants so they can see in-checkout demand.
|
|
157
157
|
|
|
158
|
+
### Payment method `type` on the wire is now a shorthand, not a Rails class name
|
|
159
|
+
|
|
160
|
+
The `type` attribute on `Spree::PaymentMethod` (returned by both the Store API and the Admin API) used to be the full Rails STI class name — `"SpreeStripe::Gateway"`, `"SpreeAdyen::Gateway"`, `"Spree::PaymentMethod::Check"`. In 5.5 it switches to a stable shorthand derived from `Spree::Base.api_type`:
|
|
161
|
+
|
|
162
|
+
| Class | Pre-5.5 `type` | 5.5+ `type` |
|
|
163
|
+
| ---------------------------------- | ------------------------------- | ------------------ |
|
|
164
|
+
| `Spree::PaymentMethod::Check` | `Spree::PaymentMethod::Check` | `check` |
|
|
165
|
+
| `Spree::PaymentMethod::StoreCredit`| `Spree::PaymentMethod::StoreCredit` | `store_credit` |
|
|
166
|
+
| `SpreeStripe::Gateway` | `SpreeStripe::Gateway` | `stripe` |
|
|
167
|
+
| `SpreeAdyen::Gateway` | `SpreeAdyen::Gateway` | `adyen` |
|
|
168
|
+
| `SpreePaypalCheckout::Gateway` | `SpreePaypalCheckout::Gateway` | `paypal_checkout` |
|
|
169
|
+
| `SpreeRazorpayCheckout::Gateway` | `SpreeRazorpayCheckout::Gateway`| `razorpay_checkout`|
|
|
170
|
+
|
|
171
|
+
The shorthand is also what `POST /api/v3/admin/payment_methods` now expects as `type` when creating a new method, and what `GET /api/v3/admin/payment_methods/types` returns in its `type` field.
|
|
172
|
+
|
|
173
|
+
This is a breaking change for any storefront or integration that **string-matches the payment method type** to pick which payment-gateway SDK to load. The official Spree Next.js storefront resolves the gateway in `src/lib/utils/payment-gateway.ts`; update its map to key on the new shorthand:
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
const GATEWAY_TYPE_MAP: Record<string, GatewayId> = {
|
|
177
|
+
// 5.5+ shorthands
|
|
178
|
+
stripe: "stripe",
|
|
179
|
+
adyen: "adyen",
|
|
180
|
+
paypal_checkout: "paypal",
|
|
181
|
+
razorpay_checkout: "razorpay",
|
|
182
|
+
// Pre-5.5 Rails class names — keep while you have older backends in
|
|
183
|
+
// the field; drop once everyone is on 5.5+.
|
|
184
|
+
"SpreeStripe::Gateway": "stripe",
|
|
185
|
+
"SpreeAdyen::Gateway": "adyen",
|
|
186
|
+
"SpreePaypalCheckout::Gateway": "paypal",
|
|
187
|
+
"SpreeRazorpayCheckout::Gateway": "razorpay",
|
|
188
|
+
};
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
If you maintain a custom storefront, search it for the legacy class strings (`"SpreeStripe::Gateway"`, `"SpreePaypalCheckout::Gateway"`, etc.) and add the corresponding 5.5+ shorthand alongside each one. The symptom of missing this is checkout rendering a generic "this payment method is not yet supported" placeholder instead of the gateway's SDK form.
|
|
192
|
+
|
|
158
193
|
### Order Routing chooses location order via merchant rules instead of database order
|
|
159
194
|
|
|
160
195
|
The default routing strategy (`Spree::OrderRouting::Strategy::Rules`) packs the same set of stock locations as before, but the **order** in which locations are tried is now determined by the routing rules — Preferred Location → Minimize Splits → Default Location — rather than by raw database row order. The unit distribution (Prioritizer + Adjuster) is unchanged: top-ranked location's packages get first pick of on-hand inventory, the rest spills over.
|