@b3dotfun/sdk 0.1.69-alpha.12 → 0.1.69-alpha.13

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.
@@ -121,5 +121,7 @@ export interface AnySpendCheckoutProps {
121
121
  feeOnTop?: boolean;
122
122
  /** When true, identity verification (KYC) is required before card payment. Defaults to false. */
123
123
  kycEnabled?: boolean;
124
+ /** Extra metadata included under the 'callbackMetadata' key in the order's callbackMetadata (e.g. workflowId, orgId from checkout session) */
125
+ callbackMetadata?: Record<string, unknown>;
124
126
  }
125
- export declare function AnySpendCheckout({ mode, recipientAddress, destinationTokenAddress, destinationTokenChainId, items, totalAmount: totalAmountOverride, organizationName, organizationLogo, themeColor, buttonText, checkoutSessionId, onSuccess, onError, returnUrl, returnLabel, classes, footer, defaultPaymentMethod, senderAddress, slots, content, theme, showPoints, showOrderId, shipping: shippingProp, tax, discount: discountProp, summaryLines, formSchema, formComponent, onFormSubmit, shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp, enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount, variablePricing, feeOnTop, kycEnabled, }: AnySpendCheckoutProps): import("react/jsx-runtime").JSX.Element;
127
+ export declare function AnySpendCheckout({ mode, recipientAddress, destinationTokenAddress, destinationTokenChainId, items, totalAmount: totalAmountOverride, organizationName, organizationLogo, themeColor, buttonText, checkoutSessionId, onSuccess, onError, returnUrl, returnLabel, classes, footer, defaultPaymentMethod, senderAddress, slots, content, theme, showPoints, showOrderId, shipping: shippingProp, tax, discount: discountProp, summaryLines, formSchema, formComponent, onFormSubmit, shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp, enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount, variablePricing, feeOnTop, kycEnabled, callbackMetadata: callbackMetadataProp, }: AnySpendCheckoutProps): import("react/jsx-runtime").JSX.Element;
@@ -24,7 +24,7 @@ shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp,
24
24
  // New discount props
25
25
  enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount,
26
26
  // Variable pricing
27
- variablePricing, feeOnTop, kycEnabled = false, }) {
27
+ variablePricing, feeOnTop, kycEnabled = false, callbackMetadata: callbackMetadataProp, }) {
28
28
  // ===== Variable pricing state =====
29
29
  const [variablePricingAmount, setVariablePricingAmount] = (0, react_2.useState)("0");
30
30
  const isVariablePricingActive = variablePricing?.enabled === true;
@@ -176,8 +176,12 @@ variablePricing, feeOnTop, kycEnabled = false, }) {
176
176
  if (isVariablePricingActive && variablePricingAmount !== "0") {
177
177
  meta.variablePricingAmount = variablePricingAmount;
178
178
  }
179
+ // Namespace caller-supplied metadata to avoid collisions with internal keys
180
+ if (callbackMetadataProp)
181
+ meta.callbackMetadata = callbackMetadataProp;
179
182
  return Object.keys(meta).length > 0 ? meta : undefined;
180
183
  }, [
184
+ callbackMetadataProp,
181
185
  formData,
182
186
  selectedShipping,
183
187
  shippingAddress,
@@ -121,5 +121,7 @@ export interface AnySpendCheckoutProps {
121
121
  feeOnTop?: boolean;
122
122
  /** When true, identity verification (KYC) is required before card payment. Defaults to false. */
123
123
  kycEnabled?: boolean;
124
+ /** Extra metadata included under the 'callbackMetadata' key in the order's callbackMetadata (e.g. workflowId, orgId from checkout session) */
125
+ callbackMetadata?: Record<string, unknown>;
124
126
  }
125
- export declare function AnySpendCheckout({ mode, recipientAddress, destinationTokenAddress, destinationTokenChainId, items, totalAmount: totalAmountOverride, organizationName, organizationLogo, themeColor, buttonText, checkoutSessionId, onSuccess, onError, returnUrl, returnLabel, classes, footer, defaultPaymentMethod, senderAddress, slots, content, theme, showPoints, showOrderId, shipping: shippingProp, tax, discount: discountProp, summaryLines, formSchema, formComponent, onFormSubmit, shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp, enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount, variablePricing, feeOnTop, kycEnabled, }: AnySpendCheckoutProps): import("react/jsx-runtime").JSX.Element;
127
+ export declare function AnySpendCheckout({ mode, recipientAddress, destinationTokenAddress, destinationTokenChainId, items, totalAmount: totalAmountOverride, organizationName, organizationLogo, themeColor, buttonText, checkoutSessionId, onSuccess, onError, returnUrl, returnLabel, classes, footer, defaultPaymentMethod, senderAddress, slots, content, theme, showPoints, showOrderId, shipping: shippingProp, tax, discount: discountProp, summaryLines, formSchema, formComponent, onFormSubmit, shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp, enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount, variablePricing, feeOnTop, kycEnabled, callbackMetadata: callbackMetadataProp, }: AnySpendCheckoutProps): import("react/jsx-runtime").JSX.Element;
@@ -21,7 +21,7 @@ shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp,
21
21
  // New discount props
22
22
  enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount,
23
23
  // Variable pricing
24
- variablePricing, feeOnTop, kycEnabled = false, }) {
24
+ variablePricing, feeOnTop, kycEnabled = false, callbackMetadata: callbackMetadataProp, }) {
25
25
  // ===== Variable pricing state =====
26
26
  const [variablePricingAmount, setVariablePricingAmount] = useState("0");
27
27
  const isVariablePricingActive = variablePricing?.enabled === true;
@@ -173,8 +173,12 @@ variablePricing, feeOnTop, kycEnabled = false, }) {
173
173
  if (isVariablePricingActive && variablePricingAmount !== "0") {
174
174
  meta.variablePricingAmount = variablePricingAmount;
175
175
  }
176
+ // Namespace caller-supplied metadata to avoid collisions with internal keys
177
+ if (callbackMetadataProp)
178
+ meta.callbackMetadata = callbackMetadataProp;
176
179
  return Object.keys(meta).length > 0 ? meta : undefined;
177
180
  }, [
181
+ callbackMetadataProp,
178
182
  formData,
179
183
  selectedShipping,
180
184
  shippingAddress,
@@ -121,5 +121,7 @@ export interface AnySpendCheckoutProps {
121
121
  feeOnTop?: boolean;
122
122
  /** When true, identity verification (KYC) is required before card payment. Defaults to false. */
123
123
  kycEnabled?: boolean;
124
+ /** Extra metadata included under the 'callbackMetadata' key in the order's callbackMetadata (e.g. workflowId, orgId from checkout session) */
125
+ callbackMetadata?: Record<string, unknown>;
124
126
  }
125
- export declare function AnySpendCheckout({ mode, recipientAddress, destinationTokenAddress, destinationTokenChainId, items, totalAmount: totalAmountOverride, organizationName, organizationLogo, themeColor, buttonText, checkoutSessionId, onSuccess, onError, returnUrl, returnLabel, classes, footer, defaultPaymentMethod, senderAddress, slots, content, theme, showPoints, showOrderId, shipping: shippingProp, tax, discount: discountProp, summaryLines, formSchema, formComponent, onFormSubmit, shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp, enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount, variablePricing, feeOnTop, kycEnabled, }: AnySpendCheckoutProps): import("react/jsx-runtime").JSX.Element;
127
+ export declare function AnySpendCheckout({ mode, recipientAddress, destinationTokenAddress, destinationTokenChainId, items, totalAmount: totalAmountOverride, organizationName, organizationLogo, themeColor, buttonText, checkoutSessionId, onSuccess, onError, returnUrl, returnLabel, classes, footer, defaultPaymentMethod, senderAddress, slots, content, theme, showPoints, showOrderId, shipping: shippingProp, tax, discount: discountProp, summaryLines, formSchema, formComponent, onFormSubmit, shippingOptions, collectShippingAddress, onShippingChange: onShippingChangeProp, enableDiscountCode, onDiscountApplied: onDiscountAppliedProp, validateDiscount, variablePricing, feeOnTop, kycEnabled, callbackMetadata: callbackMetadataProp, }: AnySpendCheckoutProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.1.69-alpha.12",
3
+ "version": "0.1.69-alpha.13",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -138,6 +138,8 @@ export interface AnySpendCheckoutProps {
138
138
  feeOnTop?: boolean;
139
139
  /** When true, identity verification (KYC) is required before card payment. Defaults to false. */
140
140
  kycEnabled?: boolean;
141
+ /** Extra metadata included under the 'callbackMetadata' key in the order's callbackMetadata (e.g. workflowId, orgId from checkout session) */
142
+ callbackMetadata?: Record<string, unknown>;
141
143
  }
142
144
 
143
145
  const emptyAddress: AddressData = { street: "", city: "", state: "", zip: "", country: "" };
@@ -187,6 +189,7 @@ export function AnySpendCheckout({
187
189
  variablePricing,
188
190
  feeOnTop,
189
191
  kycEnabled = false,
192
+ callbackMetadata: callbackMetadataProp,
190
193
  }: AnySpendCheckoutProps) {
191
194
  // ===== Variable pricing state =====
192
195
  const [variablePricingAmount, setVariablePricingAmount] = useState<string>("0");
@@ -342,8 +345,11 @@ export function AnySpendCheckout({
342
345
  if (isVariablePricingActive && variablePricingAmount !== "0") {
343
346
  meta.variablePricingAmount = variablePricingAmount;
344
347
  }
348
+ // Namespace caller-supplied metadata to avoid collisions with internal keys
349
+ if (callbackMetadataProp) meta.callbackMetadata = callbackMetadataProp;
345
350
  return Object.keys(meta).length > 0 ? meta : undefined;
346
351
  }, [
352
+ callbackMetadataProp,
347
353
  formData,
348
354
  selectedShipping,
349
355
  shippingAddress,