Aller au contenu

PostPurchaseProps

Ce contenu n’est pas encore disponible dans votre langue.

PostPurchaseProps = { badgeText?: string; classname?: string; ctaText?: string; customerId?: string; imageUrl?: string; merchantId?: string; orderId?: string; placement?: string; preview?: string; previewVariant?: "referrer" | "referee"; products?: SharingPageProduct[] | string; refereeText?: string; referrerText?: string; sharingUrl?: string; token?: string; variant?: "referrer" | "referee"; }

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:7

Props for the PostPurchase component.

optional badgeText?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:47

Label for the pill badge displayed above the message. When omitted (and no placement config provides one), the badge is hidden.


optional classname?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:38

CSS class names passed through to the root element (Light DOM).


optional ctaText?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:62

Override the CTA button text. Use {REWARD} as placeholder for the reward amount.


optional customerId?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:13

Merchant customer ID for purchase tracking fallback. All three tracking props (customerId, orderId, token) must be present for tracking to fire.


optional imageUrl?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:69

Override the image displayed on the left of the post-purchase card. Accepts an image URL. Falls back to the built-in gift icon when omitted. The image is constrained to the icon slot via object-fit: contain, so any aspect ratio renders correctly.


optional merchantId?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:30

Override the merchant ID resolved from the SDK config.


optional orderId?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:17

Merchant order ID for purchase tracking fallback.


optional placement?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:34

Placement ID for backend-driven CSS customization.


optional preview?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:90

When set, renders the card in preview mode (e.g. Shopify/WP editor). Bypasses the client-ready / RPC gates that normally hide the card until the backend resolves, and no-ops the click handler so merchants can see the final layout with their configured copy.


optional previewVariant?: "referrer" | "referee"

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:95

Which variant to show when preview is set. Defaults to "referrer".


optional products?: SharingPageProduct[] | string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:83

Optional product cards forwarded to the sharing page when the user clicks the CTA. Accepts either a real SharingPageProduct array (when set imperatively via the JS property, el.products = [...]) or a JSON-stringified array (when set as an HTML attribute, <frak-post-purchase products='[...]'>). The HTML attribute path is required for server-rendered surfaces — e.g. WooCommerce / Magento plugins — because preact-custom-element delivers attribute values as raw strings.

Empty arrays / unparseable strings are treated as “no products” so the sharing page renders without the product card section.


optional refereeText?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:57

Override the message shown to referees. Use {REWARD} as placeholder for the reward amount.


optional referrerText?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:52

Override the message shown to referrers. Use {REWARD} as placeholder for the reward amount.


optional sharingUrl?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:26

Base URL to share. Falls back to the merchant domain returned by the backend when omitted.


optional token?: string

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:21

Checkout token for purchase tracking fallback.


optional variant?: "referrer" | "referee"

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/types.ts:42

Force a display variant instead of relying on the backend evaluation.