@waffo/pancake-ts 0.14.0 → 0.16.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/dist/index.d.cts CHANGED
@@ -327,6 +327,7 @@ interface NotificationSettings {
327
327
  emailSubscriptionPastDue: boolean;
328
328
  emailTrialStarted: boolean;
329
329
  emailTrialEnding: boolean;
330
+ emailUpcomingCharge: boolean;
330
331
  notifyNewOrders: boolean;
331
332
  notifyNewSubscriptions: boolean;
332
333
  notifySubscriptionCanceled: boolean;
@@ -336,17 +337,16 @@ interface NotificationSettings {
336
337
  notifySubscriptionUncanceled: boolean;
337
338
  notifySubscriptionUpdated: boolean;
338
339
  notifyChargeback: boolean;
339
- notifyPayoutCompleted: boolean;
340
- notifyPayoutFailed: boolean;
341
340
  }
342
341
  /**
343
342
  * Merchant-writable subset of {@link NotificationSettings}.
344
343
  *
345
- * Consumer-email toggles (`email*`) are managed by the PANCAKE platform (admin-only
346
- * via DB) and **not** writable from this SDK; they would be silently dropped by the
347
- * `update-store` endpoint if included. Use this type for any merchant-side update.
344
+ * Consumer-email toggles (`email*`) are managed by the PANCAKE platform and **not**
345
+ * writable from this SDK; they would be silently dropped by the `update-store`
346
+ * endpoint if included. Payout result notifications are platform-managed and always
347
+ * delivered — they have no toggle key. Use this type for any merchant-side update.
348
348
  */
349
- type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionUpdated" | "notifyChargeback" | "notifyPayoutCompleted" | "notifyPayoutFailed">;
349
+ type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionUpdated" | "notifyChargeback">;
350
350
  /**
351
351
  * Single-theme checkout page styling.
352
352
  * @see docs/api-reference/endpoints/stores/overview.mdx
@@ -722,6 +722,15 @@ interface BillingDetail {
722
722
  * on the checkout page. Language×currency mismatches are rejected by the payment provider.
723
723
  */
724
724
  type CashierLanguage = "en" | "pt-BR" | "es-MX" | "id-ID" | "vi-VN" | "ru-RU" | "en-KE" | "es-PE" | "es-CO" | "es-CL" | "zh-Hant-TW" | "zh-Hant-HK" | "th-TH" | "ja-JP" | "en-NG" | "ko-KR" | "en-HK" | "zh-Hans-HK" | "pl-PL" | "tr-TR" | "zh-Hans" | "ms-MY";
725
+ /**
726
+ * Payment methods that can be offered on the hosted checkout page.
727
+ *
728
+ * Availability depends on the product type × currency pair. One-time: `USD` supports all four;
729
+ * `EUR` / `GBP` / `HKD` / `JPY` support `card` / `applepay` / `googlepay`; `CNY` supports `wechat`.
730
+ * Subscription: `USD` / `EUR` / `GBP` / `HKD` / `JPY` support `card` / `applepay` / `googlepay`.
731
+ * Currencies outside this matrix cannot be charged at all — checkout session creation is rejected with a 400.
732
+ */
733
+ type PaymentMethod = "card" | "applepay" | "googlepay" | "wechat";
725
734
  /**
726
735
  * Parameters for creating a checkout session.
727
736
  * @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
@@ -754,6 +763,19 @@ interface CreateCheckoutSessionParams {
754
763
  * The customer can switch language on the checkout page. Omit to let the provider infer.
755
764
  */
756
765
  language?: CashierLanguage;
766
+ /**
767
+ * Whitelist — offer only these payment methods ({@link PaymentMethod}).
768
+ * Every value must be supported by the product type × currency pair, otherwise the request is rejected.
769
+ * Mutually exclusive with {@link CreateCheckoutSessionParams.excludePaymentMethods}.
770
+ * Omit both to offer every method the currency supports.
771
+ */
772
+ includePaymentMethods?: PaymentMethod[];
773
+ /**
774
+ * Blacklist — offer every method the currency supports except these ({@link PaymentMethod}).
775
+ * Values the currency does not offer are ignored, so one blacklist can be reused across currencies.
776
+ * Mutually exclusive with {@link CreateCheckoutSessionParams.includePaymentMethods}.
777
+ */
778
+ excludePaymentMethods?: PaymentMethod[];
757
779
  }
758
780
  /** Result of creating a checkout session. */
759
781
  interface CheckoutSessionResult {
@@ -2250,4 +2272,4 @@ declare class WaffoPancakeError extends Error {
2250
2272
  */
2251
2273
  declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
2252
2274
 
2253
- export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
2275
+ export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, type PaymentMethod, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
package/dist/index.d.ts CHANGED
@@ -327,6 +327,7 @@ interface NotificationSettings {
327
327
  emailSubscriptionPastDue: boolean;
328
328
  emailTrialStarted: boolean;
329
329
  emailTrialEnding: boolean;
330
+ emailUpcomingCharge: boolean;
330
331
  notifyNewOrders: boolean;
331
332
  notifyNewSubscriptions: boolean;
332
333
  notifySubscriptionCanceled: boolean;
@@ -336,17 +337,16 @@ interface NotificationSettings {
336
337
  notifySubscriptionUncanceled: boolean;
337
338
  notifySubscriptionUpdated: boolean;
338
339
  notifyChargeback: boolean;
339
- notifyPayoutCompleted: boolean;
340
- notifyPayoutFailed: boolean;
341
340
  }
342
341
  /**
343
342
  * Merchant-writable subset of {@link NotificationSettings}.
344
343
  *
345
- * Consumer-email toggles (`email*`) are managed by the PANCAKE platform (admin-only
346
- * via DB) and **not** writable from this SDK; they would be silently dropped by the
347
- * `update-store` endpoint if included. Use this type for any merchant-side update.
344
+ * Consumer-email toggles (`email*`) are managed by the PANCAKE platform and **not**
345
+ * writable from this SDK; they would be silently dropped by the `update-store`
346
+ * endpoint if included. Payout result notifications are platform-managed and always
347
+ * delivered — they have no toggle key. Use this type for any merchant-side update.
348
348
  */
349
- type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionUpdated" | "notifyChargeback" | "notifyPayoutCompleted" | "notifyPayoutFailed">;
349
+ type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionUpdated" | "notifyChargeback">;
350
350
  /**
351
351
  * Single-theme checkout page styling.
352
352
  * @see docs/api-reference/endpoints/stores/overview.mdx
@@ -722,6 +722,15 @@ interface BillingDetail {
722
722
  * on the checkout page. Language×currency mismatches are rejected by the payment provider.
723
723
  */
724
724
  type CashierLanguage = "en" | "pt-BR" | "es-MX" | "id-ID" | "vi-VN" | "ru-RU" | "en-KE" | "es-PE" | "es-CO" | "es-CL" | "zh-Hant-TW" | "zh-Hant-HK" | "th-TH" | "ja-JP" | "en-NG" | "ko-KR" | "en-HK" | "zh-Hans-HK" | "pl-PL" | "tr-TR" | "zh-Hans" | "ms-MY";
725
+ /**
726
+ * Payment methods that can be offered on the hosted checkout page.
727
+ *
728
+ * Availability depends on the product type × currency pair. One-time: `USD` supports all four;
729
+ * `EUR` / `GBP` / `HKD` / `JPY` support `card` / `applepay` / `googlepay`; `CNY` supports `wechat`.
730
+ * Subscription: `USD` / `EUR` / `GBP` / `HKD` / `JPY` support `card` / `applepay` / `googlepay`.
731
+ * Currencies outside this matrix cannot be charged at all — checkout session creation is rejected with a 400.
732
+ */
733
+ type PaymentMethod = "card" | "applepay" | "googlepay" | "wechat";
725
734
  /**
726
735
  * Parameters for creating a checkout session.
727
736
  * @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
@@ -754,6 +763,19 @@ interface CreateCheckoutSessionParams {
754
763
  * The customer can switch language on the checkout page. Omit to let the provider infer.
755
764
  */
756
765
  language?: CashierLanguage;
766
+ /**
767
+ * Whitelist — offer only these payment methods ({@link PaymentMethod}).
768
+ * Every value must be supported by the product type × currency pair, otherwise the request is rejected.
769
+ * Mutually exclusive with {@link CreateCheckoutSessionParams.excludePaymentMethods}.
770
+ * Omit both to offer every method the currency supports.
771
+ */
772
+ includePaymentMethods?: PaymentMethod[];
773
+ /**
774
+ * Blacklist — offer every method the currency supports except these ({@link PaymentMethod}).
775
+ * Values the currency does not offer are ignored, so one blacklist can be reused across currencies.
776
+ * Mutually exclusive with {@link CreateCheckoutSessionParams.includePaymentMethods}.
777
+ */
778
+ excludePaymentMethods?: PaymentMethod[];
757
779
  }
758
780
  /** Result of creating a checkout session. */
759
781
  interface CheckoutSessionResult {
@@ -2250,4 +2272,4 @@ declare class WaffoPancakeError extends Error {
2250
2272
  */
2251
2273
  declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
2252
2274
 
2253
- export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
2275
+ export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, type PaymentMethod, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };