Aller au contenu

PostPurchase

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

PostPurchase(__namedParameters): Element | null

Defined in: vendor/wallet/sdk/components/src/components/PostPurchase/PostPurchase.tsx:130

Post-purchase card component.

Renders an inline card on the merchant’s thank-you / order-status page that either congratulates a referee or invites a referrer to share.

Fetches referral status and merchant information via two independent RPC calls, then computes the display variant locally.

string

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

string = ""

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

string

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

string

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

string

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.

string

Override the merchant ID resolved from the SDK config.

string

Merchant order ID for purchase tracking fallback.

string

Placement ID for backend-driven CSS customization.

string

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.

"referrer" | "referee"

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

string | SharingPageProduct[]

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.

string

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

string

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

string

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

string

Checkout token for purchase tracking fallback.

"referrer" | "referee"

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

Element | null

Minimal — just show the card:

<frak-post-purchase></frak-post-purchase>

With purchase tracking fallback and custom sharing URL:

<frak-post-purchase
customer-id="cust_123"
order-id="ord_456"
token="checkout_abc"
sharing-url="https://merchant.com/product/shoes"
></frak-post-purchase>