@waffo/pancake-ts 0.15.0 → 0.16.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/CHANGELOG.md +25 -0
- package/README.md +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -2
- package/dist/index.d.ts +29 -2
- package/dist/index.js.map +1 -1
- package/docs/api-reference.md +29 -29
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -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
|
|
@@ -737,7 +746,12 @@ interface CreateCheckoutSessionParams {
|
|
|
737
746
|
withTrial?: boolean;
|
|
738
747
|
/** Pre-filled customer email */
|
|
739
748
|
buyerEmail?: string;
|
|
740
|
-
/**
|
|
749
|
+
/**
|
|
750
|
+
* Pre-filled billing details. Passing this couples the cashier to the order's billing country: it then offers
|
|
751
|
+
* only that country's payment market and the customer cannot switch. The country that applies is the one on the
|
|
752
|
+
* finished order, not the one you sent; a country outside the payment markets we cover applies no restriction.
|
|
753
|
+
* Omit to leave the cashier unrestricted.
|
|
754
|
+
*/
|
|
741
755
|
billingDetail?: BillingDetail;
|
|
742
756
|
/** Redirect URL after successful payment */
|
|
743
757
|
successUrl?: string;
|
|
@@ -754,6 +768,19 @@ interface CreateCheckoutSessionParams {
|
|
|
754
768
|
* The customer can switch language on the checkout page. Omit to let the provider infer.
|
|
755
769
|
*/
|
|
756
770
|
language?: CashierLanguage;
|
|
771
|
+
/**
|
|
772
|
+
* Whitelist — offer only these payment methods ({@link PaymentMethod}).
|
|
773
|
+
* Every value must be supported by the product type × currency pair, otherwise the request is rejected.
|
|
774
|
+
* Mutually exclusive with {@link CreateCheckoutSessionParams.excludePaymentMethods}.
|
|
775
|
+
* Omit both to offer every method the currency supports.
|
|
776
|
+
*/
|
|
777
|
+
includePaymentMethods?: PaymentMethod[];
|
|
778
|
+
/**
|
|
779
|
+
* Blacklist — offer every method the currency supports except these ({@link PaymentMethod}).
|
|
780
|
+
* Values the currency does not offer are ignored, so one blacklist can be reused across currencies.
|
|
781
|
+
* Mutually exclusive with {@link CreateCheckoutSessionParams.includePaymentMethods}.
|
|
782
|
+
*/
|
|
783
|
+
excludePaymentMethods?: PaymentMethod[];
|
|
757
784
|
}
|
|
758
785
|
/** Result of creating a checkout session. */
|
|
759
786
|
interface CheckoutSessionResult {
|
|
@@ -2250,4 +2277,4 @@ declare class WaffoPancakeError extends Error {
|
|
|
2250
2277
|
*/
|
|
2251
2278
|
declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
|
|
2252
2279
|
|
|
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 };
|
|
2280
|
+
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
|
@@ -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
|
|
@@ -737,7 +746,12 @@ interface CreateCheckoutSessionParams {
|
|
|
737
746
|
withTrial?: boolean;
|
|
738
747
|
/** Pre-filled customer email */
|
|
739
748
|
buyerEmail?: string;
|
|
740
|
-
/**
|
|
749
|
+
/**
|
|
750
|
+
* Pre-filled billing details. Passing this couples the cashier to the order's billing country: it then offers
|
|
751
|
+
* only that country's payment market and the customer cannot switch. The country that applies is the one on the
|
|
752
|
+
* finished order, not the one you sent; a country outside the payment markets we cover applies no restriction.
|
|
753
|
+
* Omit to leave the cashier unrestricted.
|
|
754
|
+
*/
|
|
741
755
|
billingDetail?: BillingDetail;
|
|
742
756
|
/** Redirect URL after successful payment */
|
|
743
757
|
successUrl?: string;
|
|
@@ -754,6 +768,19 @@ interface CreateCheckoutSessionParams {
|
|
|
754
768
|
* The customer can switch language on the checkout page. Omit to let the provider infer.
|
|
755
769
|
*/
|
|
756
770
|
language?: CashierLanguage;
|
|
771
|
+
/**
|
|
772
|
+
* Whitelist — offer only these payment methods ({@link PaymentMethod}).
|
|
773
|
+
* Every value must be supported by the product type × currency pair, otherwise the request is rejected.
|
|
774
|
+
* Mutually exclusive with {@link CreateCheckoutSessionParams.excludePaymentMethods}.
|
|
775
|
+
* Omit both to offer every method the currency supports.
|
|
776
|
+
*/
|
|
777
|
+
includePaymentMethods?: PaymentMethod[];
|
|
778
|
+
/**
|
|
779
|
+
* Blacklist — offer every method the currency supports except these ({@link PaymentMethod}).
|
|
780
|
+
* Values the currency does not offer are ignored, so one blacklist can be reused across currencies.
|
|
781
|
+
* Mutually exclusive with {@link CreateCheckoutSessionParams.includePaymentMethods}.
|
|
782
|
+
*/
|
|
783
|
+
excludePaymentMethods?: PaymentMethod[];
|
|
757
784
|
}
|
|
758
785
|
/** Result of creating a checkout session. */
|
|
759
786
|
interface CheckoutSessionResult {
|
|
@@ -2250,4 +2277,4 @@ declare class WaffoPancakeError extends Error {
|
|
|
2250
2277
|
*/
|
|
2251
2278
|
declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
|
|
2252
2279
|
|
|
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 };
|
|
2280
|
+
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 };
|