@misiki/gocommerce-connector 0.30.0 → 0.31.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
@@ -231,7 +231,7 @@ Each of these is a real gap, listed so nobody has to find it in production.
231
231
  none of them the gateway the shopper chose. Cash on delivery and Razorpay's
232
232
  modal match engine gateways directly. The storefront's redirect flow (which it
233
233
  reaches by the code `PAYPAL`) carries the store's first hosted-page gateway —
234
- Adyen, Paddle, Lemon Squeezy, Creem, Hyperswitch or RevenueCat — under that
234
+ PayPal, Adyen, Paddle, Lemon Squeezy, Creem, Hyperswitch or RevenueCat — under that
235
235
  gateway's own name and a neutral card icon; a second one cannot be told apart
236
236
  from the first and is not offered. GoCommerce's Stripe is a Payment Element (a
237
237
  client secret), which this storefront does not mount. Every method left off is
@@ -201,6 +201,8 @@ type Product = {
201
201
  seo_description: string;
202
202
  image_url?: string;
203
203
  media_count?: number;
204
+ /** The picture after the lead, which a listing card shows on hover. */
205
+ hover_image_url?: string;
204
206
  /** The gallery, pictures and videos in order: on the public product only (D134). */
205
207
  media?: VariantImage[];
206
208
  /** The sold count rounded down; absent unless the shop shows counts and it passed the threshold (D134). */
@@ -4719,12 +4721,12 @@ declare class CheckoutService extends BaseService {
4719
4721
  checkoutStripeCapture(): Promise<never>;
4720
4722
  /**
4721
4723
  * The storefront's generic redirect flow, which it reaches through the code
4722
- * `PAYPAL`. The engine has no PayPal gateway; paymentMethodService puts the
4723
- * store's first hosted-page gateway — Adyen, Paddle, Lemon Squeezy, Creem,
4724
- * Hyperswitch or RevenueCat — under that code, with its own name and a
4725
- * neutral icon, because this is the one storefront flow that sends a shopper
4726
- * to a URL and back. The shopper returns to the success page; the gateway's
4727
- * webhook tells the engine the order is paid.
4724
+ * `PAYPAL`. paymentMethodService puts the store's first hosted-page gateway
4725
+ * — PayPal, Adyen, Paddle, Lemon Squeezy, Creem, Hyperswitch or RevenueCat —
4726
+ * under that code, with its own name and a neutral icon, because this is the
4727
+ * one storefront flow that sends a shopper to a URL and back. The shopper
4728
+ * returns to the success page; the gateway's webhook tells the engine the
4729
+ * order is paid. PayPal's webhook is also what captures the approved payment.
4728
4730
  */
4729
4731
  checkoutPaypal({ cartId, origin }?: {
4730
4732
  cartId?: string;
@@ -201,6 +201,8 @@ type Product = {
201
201
  seo_description: string;
202
202
  image_url?: string;
203
203
  media_count?: number;
204
+ /** The picture after the lead, which a listing card shows on hover. */
205
+ hover_image_url?: string;
204
206
  /** The gallery, pictures and videos in order: on the public product only (D134). */
205
207
  media?: VariantImage[];
206
208
  /** The sold count rounded down; absent unless the shop shows counts and it passed the threshold (D134). */
@@ -4719,12 +4721,12 @@ declare class CheckoutService extends BaseService {
4719
4721
  checkoutStripeCapture(): Promise<never>;
4720
4722
  /**
4721
4723
  * The storefront's generic redirect flow, which it reaches through the code
4722
- * `PAYPAL`. The engine has no PayPal gateway; paymentMethodService puts the
4723
- * store's first hosted-page gateway — Adyen, Paddle, Lemon Squeezy, Creem,
4724
- * Hyperswitch or RevenueCat — under that code, with its own name and a
4725
- * neutral icon, because this is the one storefront flow that sends a shopper
4726
- * to a URL and back. The shopper returns to the success page; the gateway's
4727
- * webhook tells the engine the order is paid.
4724
+ * `PAYPAL`. paymentMethodService puts the store's first hosted-page gateway
4725
+ * — PayPal, Adyen, Paddle, Lemon Squeezy, Creem, Hyperswitch or RevenueCat —
4726
+ * under that code, with its own name and a neutral icon, because this is the
4727
+ * one storefront flow that sends a shopper to a URL and back. The shopper
4728
+ * returns to the success page; the gateway's webhook tells the engine the
4729
+ * order is paid. PayPal's webhook is also what captures the approved payment.
4728
4730
  */
4729
4731
  checkoutPaypal({ cartId, origin }?: {
4730
4732
  cartId?: string;
package/dist/index.cjs CHANGED
@@ -561,6 +561,7 @@ function productImages(p) {
561
561
  if (url && !out.includes(url)) out.push(url);
562
562
  };
563
563
  push(mediaUrl(p.image_url));
564
+ push(mediaUrl(p.hover_image_url));
564
565
  for (const m of arr(p.media)) if (m.kind === "image") push(mediaUrl(m.url));
565
566
  for (const v of arr(p.variants)) for (const url of variantImages(v)) push(url);
566
567
  return out;
@@ -2229,12 +2230,12 @@ var CheckoutService = class extends BaseService {
2229
2230
  }
2230
2231
  /**
2231
2232
  * The storefront's generic redirect flow, which it reaches through the code
2232
- * `PAYPAL`. The engine has no PayPal gateway; paymentMethodService puts the
2233
- * store's first hosted-page gateway — Adyen, Paddle, Lemon Squeezy, Creem,
2234
- * Hyperswitch or RevenueCat — under that code, with its own name and a
2235
- * neutral icon, because this is the one storefront flow that sends a shopper
2236
- * to a URL and back. The shopper returns to the success page; the gateway's
2237
- * webhook tells the engine the order is paid.
2233
+ * `PAYPAL`. paymentMethodService puts the store's first hosted-page gateway
2234
+ * — PayPal, Adyen, Paddle, Lemon Squeezy, Creem, Hyperswitch or RevenueCat —
2235
+ * under that code, with its own name and a neutral icon, because this is the
2236
+ * one storefront flow that sends a shopper to a URL and back. The shopper
2237
+ * returns to the success page; the gateway's webhook tells the engine the
2238
+ * order is paid. PayPal's webhook is also what captures the approved payment.
2238
2239
  */
2239
2240
  async checkoutPaypal({ cartId, origin } = {}) {
2240
2241
  const gateway = await this.redirectGateway();
@@ -2458,7 +2459,7 @@ var CheckoutService = class extends BaseService {
2458
2459
  return result;
2459
2460
  }
2460
2461
  };
2461
- var REDIRECT_GATEWAYS = /* @__PURE__ */ new Set(["adyen", "paddle", "lemonsqueezy", "creem", "hyperswitch", "revenuecat"]);
2462
+ var REDIRECT_GATEWAYS = /* @__PURE__ */ new Set(["paypal", "adyen", "paddle", "lemonsqueezy", "creem", "hyperswitch", "revenuecat"]);
2462
2463
  var unsupported = (method, why) => new NotSupportedError("CheckoutService", method, why);
2463
2464
  function keyAlreadyUsed(err) {
2464
2465
  return err instanceof GoCommerceError && err.status === 400 && err.message.includes("Idempotency-Key was already used");