@rechargeapps/storefront-client 1.70.0 → 1.70.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentMethodForm.js","sources":["../../../src/api/paymentMethodForm.ts"],"sourcesContent":["import {\n CardDetailsFirstNameLastName,\n CardDetailsFullName,\n IsoDateString,\n PaymentFormConfig,\n PaymentFormController,\n PaymentFormEventHandlers,\n PaymentMethod,\n PaymentMethodFormOptions,\n Session,\n} from '../types';\nimport { getInternalSession, rechargeApiRequest } from '../utils/request';\nimport { createPaymentMethod } from './paymentMethod';\n\nasync function loadScript(scriptSrc: string, integrity: string): Promise<void> {\n // Check if already loaded\n if (typeof window !== 'undefined' && window.Spreedly) {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n if (typeof document === 'undefined') {\n reject(new Error('Document is not available. This function must be called in a browser environment.'));\n return;\n }\n\n // Check if script is already in the DOM\n const existingScript = document.querySelector(`script[src=\"${scriptSrc}\"]`);\n if (existingScript) {\n // Wait for it to load\n const checkLoaded = () => {\n if (window.Spreedly) {\n resolve();\n } else {\n setTimeout(checkLoaded, 50);\n }\n };\n checkLoaded();\n return;\n }\n\n const script = document.createElement('script');\n script.src = scriptSrc;\n script.integrity = integrity;\n script.crossOrigin = 'anonymous';\n\n script.addEventListener('load', () => {\n // Wait for payment script to be fully initialized\n const checkLoaded = () => {\n if (window.Spreedly) {\n resolve();\n } else {\n setTimeout(checkLoaded, 50);\n }\n };\n checkLoaded();\n });\n\n script.addEventListener('error', () => {\n reject(new Error('Failed to load payment iFrame script'));\n });\n\n document.head.appendChild(script);\n });\n}\n\n/** @internal */\nexport async function createPaymentFormV1(\n session: Session,\n rechargePaymentMethodId?: string\n): Promise<PaymentFormController> {\n // Initialize and get environment key\n const initResponse = await initPaymentFormV1(session, rechargePaymentMethodId);\n\n const environmentKey = initResponse.external.environment_key;\n const paymentMethodIntentId = initResponse.payment_method_intent_id;\n const externalCustomerId = initResponse.external_customer_id.ecommerce;\n const resourceUrl = initResponse.external.resource_url;\n const integrityHash = initResponse.external.integrity_hash;\n const externalPaymentMethodId = initResponse.payment_method?.processor_payment_method_token;\n\n // Load script\n await loadScript(resourceUrl, integrityHash);\n\n let isInitialized = false;\n let currentToken: string | null = null;\n let tokenCallback: ((token: string) => void) | null = null;\n let pendingSubmitOptions: PaymentMethodFormOptions | null = null;\n\n const controller: PaymentFormController = {\n mount(config: PaymentFormConfig, handlers?: PaymentFormEventHandlers): void {\n if (typeof window === 'undefined' || !window.Spreedly) {\n throw new Error('Payment script failed to load');\n }\n\n // Initialize Spreedly with element IDs\n window.Spreedly!.init(environmentKey, {\n numberEl: config.numberElementId,\n cvvEl: config.cvvElementId,\n });\n\n // Set up ready handler\n window.Spreedly!.on('ready', () => {\n isInitialized = true;\n\n // Apply styles\n if (config.styles) {\n window.Spreedly!.setStyle('number', config.styles);\n window.Spreedly!.setStyle('cvv', config.styles);\n }\n\n // Apply labels\n if (config.numberLabel) {\n window.Spreedly!.setLabel('number', config.numberLabel);\n }\n if (config.cvvLabel) {\n window.Spreedly!.setLabel('cvv', config.cvvLabel);\n }\n\n // Apply placeholders\n if (config.numberPlaceholder) {\n window.Spreedly!.setPlaceholder('number', config.numberPlaceholder);\n }\n if (config.cvvPlaceholder) {\n window.Spreedly!.setPlaceholder('cvv', config.cvvPlaceholder);\n }\n\n // Apply number format\n if (config.numberFormat === 'plainFormat') {\n // Apply field types\n if (config.numberFieldType) {\n window.Spreedly!.setFieldType('number', config.numberFieldType);\n }\n if (config.cvvFieldType) {\n window.Spreedly!.setFieldType('cvv', config.cvvFieldType);\n }\n // @ts-expect-error - SpreedlyNumberFormat doesn't match\n window.Spreedly!.setNumberFormat('plainFormat');\n } else if (config.numberFormat === 'maskedFormat') {\n window.Spreedly!.setFieldType('cvv', 'text');\n window.Spreedly!.setFieldType('number', 'text');\n window.Spreedly!.setNumberFormat('maskedFormat');\n } else if (config.numberFormat === 'prettyFormat') {\n // Apply field types\n if (config.numberFieldType === 'text' || config.numberFieldType === 'tel') {\n window.Spreedly!.setFieldType('number', config.numberFieldType);\n } else {\n window.Spreedly!.setFieldType('number', 'tel');\n }\n if (config.cvvFieldType === 'text' || config.cvvFieldType === 'tel') {\n window.Spreedly!.setFieldType('cvv', config.cvvFieldType);\n } else {\n window.Spreedly!.setFieldType('cvv', 'tel');\n }\n window.Spreedly!.setNumberFormat('prettyFormat');\n } else {\n // Apply field types\n if (config.numberFieldType) {\n window.Spreedly!.setFieldType('number', config.numberFieldType);\n }\n if (config.cvvFieldType) {\n window.Spreedly!.setFieldType('cvv', config.cvvFieldType);\n }\n }\n\n handlers?.onReady?.();\n });\n\n // Set up field event handler\n window.Spreedly!.on('fieldEvent', (name, eventType, activeElement, inputProperties) => {\n handlers?.onFieldEvent?.(name, eventType, activeElement, inputProperties);\n });\n\n // Set up error handler\n window.Spreedly!.on('errors', errors => {\n handlers?.onErrors?.(errors);\n });\n\n // Set up payment method handler\n window.Spreedly!.on('paymentMethod', (token, paymentMethod) => {\n currentToken = token;\n\n handlers?.onPaymentMethod?.(token, paymentMethod);\n\n // If there's a pending submit, execute it\n if (tokenCallback) {\n tokenCallback(token);\n tokenCallback = null;\n }\n });\n },\n\n tokenize(cardDetails: CardDetailsFirstNameLastName | CardDetailsFullName): void {\n if (!isInitialized || !window.Spreedly) {\n throw new Error('Payment form is not initialized');\n }\n\n // Normalize year to YYYY format\n let year = String(cardDetails.year);\n if (year.length === 2) {\n year = `20${year}`;\n }\n const month = String(cardDetails.month).padStart(2, '0');\n\n if ('full_name' in cardDetails) {\n window.Spreedly.tokenizeCreditCard({\n full_name: cardDetails.full_name,\n month,\n year,\n });\n } else {\n window.Spreedly.tokenizeCreditCard({\n first_name: cardDetails.first_name,\n last_name: cardDetails.last_name,\n month,\n year,\n });\n }\n },\n\n async submit(options: PaymentMethodFormOptions): Promise<PaymentMethod> {\n if (!isInitialized) {\n throw new Error('Payment form is not initialized');\n }\n\n // Check if we already have a token\n if (currentToken) {\n const token = currentToken;\n currentToken = null; // Clear the token after use\n return submitPaymentMethodV1(session, token, options, {\n external_payment_method_id: externalPaymentMethodId,\n payment_method_intent_id: paymentMethodIntentId,\n external_customer_id: externalCustomerId,\n });\n }\n\n // Need to tokenize first, then submit\n return new Promise(resolve => {\n pendingSubmitOptions = options;\n\n tokenCallback = async (token: string) => {\n const result = await submitPaymentMethodV1(session, token, pendingSubmitOptions!, {\n external_payment_method_id: externalPaymentMethodId,\n payment_method_intent_id: paymentMethodIntentId,\n external_customer_id: externalCustomerId,\n });\n pendingSubmitOptions = null;\n resolve(result);\n };\n\n // Trigger tokenization\n this.tokenize(options.card_details);\n });\n },\n\n reset(): void {\n if (window.Spreedly) {\n window.Spreedly.reload();\n }\n currentToken = null;\n tokenCallback = null;\n pendingSubmitOptions = null;\n },\n\n unmount(): void {\n if (window.Spreedly) {\n window.Spreedly.removeHandlers();\n }\n isInitialized = false;\n currentToken = null;\n tokenCallback = null;\n pendingSubmitOptions = null;\n },\n\n addEventHandlers(handlers: PaymentFormEventHandlers): void {\n if (handlers.onReady) {\n window.Spreedly!.on('ready', handlers.onReady);\n }\n if (handlers.onFieldEvent) {\n window.Spreedly!.on('fieldEvent', handlers.onFieldEvent);\n }\n if (handlers.onErrors) {\n window.Spreedly!.on('errors', handlers.onErrors);\n }\n if (handlers.onPaymentMethod) {\n window.Spreedly!.on('paymentMethod', handlers.onPaymentMethod);\n }\n },\n\n removeHandlers(): void {\n if (window.Spreedly) {\n window.Spreedly.removeHandlers();\n }\n },\n\n setFieldType(name: spreedly.SpreedlyField, type: spreedly.SpreedlyFieldType): void {\n window.Spreedly!.setFieldType(name, type);\n },\n\n setLabel(name: spreedly.SpreedlyField, label: string): void {\n window.Spreedly!.setLabel(name, label);\n },\n\n setNumberFormat(format: 'plainFormat' | 'prettyFormat' | 'maskedFormat'): void {\n // @ts-expect-error - SpreedlyNumberFormat doesn't match allowed values\n window.Spreedly!.setNumberFormat(format);\n },\n\n setPlaceholder(name: spreedly.SpreedlyField, placeholder: string): void {\n window.Spreedly!.setPlaceholder(name, placeholder);\n },\n\n setStyle(name: spreedly.SpreedlyField, style: string): void {\n window.Spreedly!.setStyle(name, style);\n },\n };\n\n return controller;\n}\n\n// defined here since this is only for internal use\ninterface PaymentMethodIntentResponse {\n payment_method_intent_id: string;\n customer_id: number;\n external_customer_id: {\n ecommerce: number;\n };\n external: {\n environment_key: string;\n resource_url: string;\n integrity_hash: string;\n };\n created_at: IsoDateString;\n expires_at: IsoDateString;\n payment_method?: PaymentMethod;\n}\n\nasync function initPaymentFormV1(\n session: Session,\n rechargePaymentMethodId?: string\n): Promise<PaymentMethodIntentResponse> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const response = await rechargeApiRequest<PaymentMethodIntentResponse>(\n 'post',\n '/payment_method_intents',\n { data: { customer_id: id, payment_method_id: rechargePaymentMethodId } },\n getInternalSession(session, 'initPaymentForm')\n );\n return response;\n}\n\n// defined here since this is only for internal use\ninterface PaymentMethodV1Request {\n /** ID of the payment method to update */\n external_payment_method_id?: string;\n payment_method_intent_id: string;\n external_customer_id: number;\n}\n\nasync function submitPaymentMethodV1(\n session: Session,\n token: string,\n { billing_address, default_payment_method, address_ids }: PaymentMethodFormOptions,\n { external_payment_method_id, payment_method_intent_id, external_customer_id }: PaymentMethodV1Request\n): Promise<PaymentMethod> {\n const paymentMethod = await createPaymentMethod(getInternalSession(session, 'submitPaymentMethodV1'), {\n default: default_payment_method ?? false,\n payment_type: 'CREDIT_CARD',\n processor_customer_token: external_customer_id.toString(),\n processor_name: 'frictionless',\n processor_payment_method_token: token,\n billing_address,\n payment_method_intent_id,\n address_ids,\n external_payment_method_id,\n });\n return paymentMethod;\n}\n"],"names":[],"mappings":";;;AAcA,eAAe,UAAA,CAAW,WAAmB,SAAkC,EAAA;AAE7E,EAAA,IAAI,OAAO,MAAA,KAAW,WAAe,IAAA,MAAA,CAAO,QAAU,EAA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M,WAAW,MAAM,kBAAA;AAAA,IACrB,MAAA;AAAA,IACA,yBAAA;AAAA,IACA,EAAE,IAAM,EAAA,EAAE,aAAa,EAAI,EAAA,iBAAA,EAAmB,yBAA0B,EAAA;AAAA,IACxE,kBAAA,CAAmB,SAAS,iBAAiB,CAAA;AAAA,GAC/C,CAAA;AACA,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAUA,eAAe,qBACb,CAAA,OAAA,EACA,KACA,EAAA,EAAE,eAAiB,EAAA,sBAAA,EAAwB,WAAY,EAAA,EACvD,EAAE,0BAAA,EAA4B,wBAA0B,EAAA,oBAAA,EAChC,EAAA;AACxB,EAAA,MAAM,gBAAgB,MAAM,mBAAA,CAAoB,kBAAmB,CAAA,OAAA,EAAS,uBAAuB,CAAG,EAAA;AAAA,IACpG,SAAS,sBAA0B,IAAA,KAAA;AAAA,IACnC,YAAc,EAAA,aAAA;AAAA,IACd,wBAAA,EAA0B,qBAAqB,QAAS,EAAA;AAAA,IACxD,cAAgB,EAAA,cAAA;AAAA,IAChB,8BAAgC,EAAA,KAAA;AAAA,IAChC,eAAA;AAAA,IACA,wBAAA;AAAA,IACA,WAAA;AAAA,IACA,0BAAA;AAAA,GACD,CAAA,CAAA;AACD,EAAO,OAAA,aAAA,CAAA;AACT;;;;"}
package/dist/esm/index.js CHANGED
@@ -15,6 +15,7 @@ export { createMetafield, deleteMetafield, updateMetafield } from './api/metafie
15
15
  export { createOnetime, deleteOnetime, getOnetime, listOnetimes, updateOnetime } from './api/onetime.js';
16
16
  export { delayOrder, getOrder, listOrders } from './api/order.js';
17
17
  export { createPaymentMethod, getPaymentMethod, listPaymentMethods, updatePaymentMethod } from './api/paymentMethod.js';
18
+ export { createPaymentFormV1 } from './api/paymentMethodForm.js';
18
19
  export { getPlan, listPlans } from './api/plan.js';
19
20
  export { productSearch } from './api/product.js';
20
21
  export { getShippingCountries, getStoreSettings } from './api/store.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -47,7 +47,7 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
47
47
  "X-Recharge-Sdk-Fn": session.internalFnCall,
48
48
  ...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
49
49
  ...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
50
- "X-Recharge-Sdk-Version": "1.70.0",
50
+ "X-Recharge-Sdk-Version": "1.70.2",
51
51
  "X-Request-Id": session.internalRequestId,
52
52
  ...session.tmp_fn_identifier ? { "X-Recharge-Sdk-Fn-Identifier": session.tmp_fn_identifier } : {},
53
53
  ...headers ? headers : {}
package/dist/index.d.ts CHANGED
@@ -364,7 +364,7 @@ interface Order {
364
364
  /** The subtotal price (sum of all line items * their quantity) of the order less discounts. */
365
365
  subtotal_price: string;
366
366
  /** A comma separated list of tags on the Order. */
367
- tags: string;
367
+ tags: string | null;
368
368
  /** An array of tax lines that apply to the Order. */
369
369
  tax_lines: TaxLine[];
370
370
  /** A boolean indicator of the taxability of the Order. */
@@ -452,7 +452,7 @@ interface PaymentDetails {
452
452
  funding_type?: string;
453
453
  }
454
454
  type PaymentType = 'CREDIT_CARD' | 'PAYPAL' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'SEPA_DEBIT' | 'IDEAL' | 'SHOP_PAY' | 'PAYPAL_EXPRESS' | 'SOFORT' | 'GIROPAY' | 'STORED_VALUE' | 'AMAZON_PAY' | 'INVOICE' | 'AFTERPAY_CLEARPAY' | 'KLARNA';
455
- type ProcessorName = 'stripe' | 'braintree' | 'authorize' | 'shopify_payments' | 'mollie' | 'adyen' | 'shopify_app_subscription_billing';
455
+ type ProcessorName = 'stripe' | 'braintree' | 'authorize' | 'shopify_payments' | 'mollie' | 'adyen' | 'shopify_app_subscription_billing' | 'frictionless';
456
456
  type PaymentMethodStatus = 'not_validated' | 'valid' | 'invalid';
457
457
  interface PaymentMethod {
458
458
  /** The unique payment method id for a customer. */
@@ -509,6 +509,10 @@ interface CreatePaymentMethodRequest extends SubType<PaymentMethod, PaymentMetho
509
509
  address_ids?: number[];
510
510
  /** like “mandate_1O7lt8FHTwP5c651R…” */
511
511
  external_mandate_id?: string;
512
+ /** The payment method intent id */
513
+ payment_method_intent_id?: string;
514
+ /** The external payment method id */
515
+ external_payment_method_id?: string;
512
516
  }
513
517
  interface UpdatePaymentMethodRequest extends Partial<Pick<PaymentMethod, 'billing_address' | 'default'>> {
514
518
  }
@@ -1468,7 +1472,7 @@ interface Charge {
1468
1472
  /** The combined price of all line_items without taxes and shipping. */
1469
1473
  subtotal_price: string;
1470
1474
  /** A comma-separated list of tags on the Charge. */
1471
- tags: string;
1475
+ tags: string | null;
1472
1476
  /** An array of tax lines that apply to the Charge. */
1473
1477
  tax_lines: TaxLine[];
1474
1478
  /** A boolean indicator of the taxability of the Charge. */
@@ -3291,6 +3295,155 @@ interface InitOptions {
3291
3295
  __unstable_twoFactorRetryFn?: () => Promise<Session | undefined>;
3292
3296
  }
3293
3297
 
3298
+ /** @internal */
3299
+ interface BaseCardDetails {
3300
+ /** Expiration month (1-12 or '01'-'12') */
3301
+ month: string | number;
3302
+ /** Expiration year (YYYY or YY format) */
3303
+ year: string | number;
3304
+ }
3305
+ /** @internal */
3306
+ interface CardDetailsFirstNameLastName extends BaseCardDetails {
3307
+ /** First name on the card */
3308
+ first_name: string;
3309
+ /** Last name on the card */
3310
+ last_name: string;
3311
+ }
3312
+ /** @internal */
3313
+ interface CardDetailsFullName extends BaseCardDetails {
3314
+ /** Full name on the card */
3315
+ full_name: string;
3316
+ }
3317
+ /** @internal */
3318
+ interface PaymentMethodFormOptions {
3319
+ /** Card holder details */
3320
+ card_details: CardDetailsFirstNameLastName | CardDetailsFullName;
3321
+ /** Billing address for the payment method */
3322
+ billing_address: AssociatedAddress;
3323
+ /** Whether to set this payment method as the default */
3324
+ default_payment_method?: boolean;
3325
+ /** Recharge address IDs to associate with this payment method */
3326
+ address_ids?: number[];
3327
+ }
3328
+ /** @internal */
3329
+ interface PaymentFormConfig {
3330
+ /** DOM element ID where the card number field will be mounted */
3331
+ numberElementId: string;
3332
+ /** DOM element ID where the CVV field will be mounted */
3333
+ cvvElementId: string;
3334
+ /** Optional css styles for the hosted fields (number and cvv) */
3335
+ styles?: string;
3336
+ /** Field type for the card number field, defaults to 'number' */
3337
+ numberFieldType?: spreedly.SpreedlyFieldType;
3338
+ /** Field type for the CVV field, defaults to 'number' */
3339
+ cvvFieldType?: spreedly.SpreedlyFieldType;
3340
+ /** Label for the card number field, defaults to 'Card Number' */
3341
+ numberLabel?: string;
3342
+ /** Label for the CVV field, defaults to 'CVV' */
3343
+ cvvLabel?: string;
3344
+ /** Placeholder text for card number field, default is empty string */
3345
+ numberPlaceholder?: string;
3346
+ /** Placeholder text for CVV field, default is empty string */
3347
+ cvvPlaceholder?: string;
3348
+ /**
3349
+ * Format for card number and CVV display
3350
+ * 'plainFormat' - default (no formatting)
3351
+ * 'prettyFormat' - adds spaces between groups of 4 digits, requires numberFieldType to be 'text' or 'tel'
3352
+ * 'maskedFormat' - masked via '*' no spaces, forces numberFieldType to 'text'
3353
+ */
3354
+ numberFormat?: 'plainFormat' | 'prettyFormat' | 'maskedFormat';
3355
+ }
3356
+ /** @internal */
3357
+ interface PaymentFieldEventCallback {
3358
+ (fieldName: spreedly.SpreedlyField, eventType: spreedly.SpreedlyFieldEventType, activeElement: spreedly.SpreedlyField, inputProperties: spreedly.SpreedlyFieldEventInputProperties): void;
3359
+ }
3360
+ /** @internal */
3361
+ interface PaymentMethodTokenCallback {
3362
+ (token: string, paymentMethod: spreedly.SpreedlyPaymentMethod): void;
3363
+ }
3364
+ /** @internal */
3365
+ interface PaymentErrorCallback {
3366
+ (errors: spreedly.SpreedlyError[]): void;
3367
+ }
3368
+ /** @internal */
3369
+ interface PaymentFormEventHandlers {
3370
+ /** Called when the form is ready for input */
3371
+ onReady?: () => void;
3372
+ /** Called when a field event occurs */
3373
+ onFieldEvent?: PaymentFieldEventCallback;
3374
+ /** Called when a payment method token is received */
3375
+ onPaymentMethod?: PaymentMethodTokenCallback;
3376
+ /** Called when validation errors occur */
3377
+ onErrors?: PaymentErrorCallback;
3378
+ }
3379
+ /** @internal */
3380
+ interface PaymentFormController {
3381
+ /**
3382
+ * Initialize the payment form with the payment script
3383
+ * @param config - Configuration for the form
3384
+ * @param handlers - Event handlers for form events
3385
+ */
3386
+ mount(config: PaymentFormConfig, handlers?: PaymentFormEventHandlers): void;
3387
+ /**
3388
+ * Tokenize the current card data
3389
+ * This triggers the payment script to create a payment method token
3390
+ * @param cardDetails - Card holder name and expiration
3391
+ */
3392
+ tokenize(cardDetails: CardDetailsFirstNameLastName | CardDetailsFullName): void;
3393
+ /**
3394
+ * Submit the tokenized payment method to Recharge, will not tokenize the card data again if tokenize has already been called
3395
+ * @param options - Payment method options including billing address
3396
+ * @returns Result of the submission
3397
+ */
3398
+ submit(options: PaymentMethodFormOptions): Promise<PaymentMethod>;
3399
+ /**
3400
+ * Reset the form fields
3401
+ */
3402
+ reset(): void;
3403
+ /**
3404
+ * Clean up and remove event handlers
3405
+ */
3406
+ unmount(): void;
3407
+ /**
3408
+ * Add event handlers to the form
3409
+ * @param handlers - The event handlers to add
3410
+ */
3411
+ addEventHandlers(handlers: PaymentFormEventHandlers): void;
3412
+ /**
3413
+ * Remove all event handlers currently registered via mount
3414
+ */
3415
+ removeHandlers(): void;
3416
+ /**
3417
+ * Set the field type for a field
3418
+ * @param name - The name of the field
3419
+ * @param type - The type of the field
3420
+ */
3421
+ setFieldType(name: spreedly.SpreedlyField, type: spreedly.SpreedlyFieldType): void;
3422
+ /**
3423
+ * Set the label for a field
3424
+ * @param name - The name of the field
3425
+ * @param label - The label for the field
3426
+ */
3427
+ setLabel(name: spreedly.SpreedlyField, label: string): void;
3428
+ /**
3429
+ * Set the number format for the form
3430
+ * @param format - The number format
3431
+ */
3432
+ setNumberFormat(format: 'plainFormat' | 'prettyFormat' | 'maskedFormat'): void;
3433
+ /**
3434
+ * Set the placeholder for a field
3435
+ * @param name - The name of the field
3436
+ * @param placeholder - The placeholder for the field
3437
+ */
3438
+ setPlaceholder(name: spreedly.SpreedlyField, placeholder: string): void;
3439
+ /**
3440
+ * Set the style for a field
3441
+ * @param name - The name of the field
3442
+ * @param style - The css string to apply to the field
3443
+ */
3444
+ setStyle(name: spreedly.SpreedlyField, style: string): void;
3445
+ }
3446
+
3294
3447
  interface ShippingCountriesResponse {
3295
3448
  shipping_countries: ShippingCountry[];
3296
3449
  }
@@ -3760,6 +3913,9 @@ declare function createPaymentMethod(session: Session, createRequest: CreatePaym
3760
3913
  declare function updatePaymentMethod(session: Session, id: string | number, updateRequest: UpdatePaymentMethodRequest): Promise<PaymentMethod>;
3761
3914
  declare function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse>;
3762
3915
 
3916
+ /** @internal */
3917
+ declare function createPaymentFormV1(session: Session, rechargePaymentMethodId?: string): Promise<PaymentFormController>;
3918
+
3763
3919
  declare function getPlan(session: Session, id: string | number): Promise<Plan>;
3764
3920
  declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
3765
3921
 
@@ -3847,4 +4003,4 @@ declare const api: {
3847
4003
  };
3848
4004
  declare function initRecharge(opt?: InitOptions): void;
3849
4005
 
3850
- export { type ActivateMembershipRequest, type AddToCartCallbackSettings, type AddonProduct, type AddonSettings, type AddonsSection, type Address, type AddressIncludes, type AddressListParams, type AddressListResponse, type AddressResponse, type AddressSortBy, type AnalyticsData, type Announcement, type ApplyCreditOptions, type AssociatedAddress, type BaseProduct, type BaseProductVariant, type BaseVariant, type BasicSubscriptionParams, type BooleanLike, type BooleanNumbers, type BooleanString, type BooleanStringNumbers, type BulkSubscriptionParams, type BundleAppProxy, type BundleData, type BundleDataBaseProduct, type BundleDataCollection, type BundleDataSellingPlan, type BundleDataSellingPlanGroup, type BundleDataVariant, type BundlePriceRule, type BundleProduct, type BundleProductLayoutSettings, type BundlePurchaseItem, type BundlePurchaseItemParams, type BundleSelection, type BundleSelectionAppProxy, type BundleSelectionItem, type BundleSelectionItemRequiredCreateProps, type BundleSelectionListParams, type BundleSelectionsResponse, type BundleSelectionsSortBy, type BundleSettings, type BundleTemplateSettings, type BundleTemplateType, type BundleTranslations, type BundleVariant, type BundleVariantOptionSource, type BundleVariantRange, type BundleVariantSelectionDefault, type CDNBaseWidgetSettings, type CDNBundleSettings, type CDNBundleVariant, type CDNBundleVariantOptionSource, type CDNPlan, type CDNProduct, type CDNProductAndSettings, type CDNProductKeyObject, type CDNProductQuery_2020_12, type CDNProductQuery_2022_06, type CDNProductRaw, type CDNProductResource, type CDNProductResponseType, type CDNProductType, type CDNProductVariant_2022_06, type CDNProduct_2022_06, type CDNProductsAndSettings, type CDNProductsAndSettingsResource, type CDNStoreSettings, type CDNSubscriptionOption, type CDNVariant, type CDNVersion, type CDNWidgetSettings, type CDNWidgetSettingsRaw, type CDNWidgetSettingsResource, type CRUDRequestOptions, type CancelMembershipRequest, type CancelSubscriptionRequest, type ChangeMembershipRequest, type ChannelSettings, type Charge, type ChargeIncludes, type ChargeListParams, type ChargeListResponse, type ChargeResponse, type ChargeSortBy, type ChargeStatus, type Collection, type CollectionBinding, type CollectionListParams, type CollectionTypes, type CollectionsResponse, type CollectionsSortBy, type ColorString, type CreateAddressRequest, type CreateBundleSelectionRequest, type CreateMetafieldRequest, type CreateOnetimeRequest, type CreatePaymentMethodRequest, type CreateRecipientAddress, type CreateSubscriptionRequest, type CreateSubscriptionsParams, type CreateSubscriptionsRequest, type CreditAccount, type CreditAccountIncludes, type CreditAccountListParams, type CreditAccountType, type CreditAccountsResponse, type CreditAccountsSortBy, type CreditSummaryIncludes, type CrossSellsSection, type CrossSellsSettings, type CurrencyPriceSet, type Customer, type CustomerCreditSummary, type CustomerDeliveryScheduleParams, type CustomerDeliveryScheduleResponse, type CustomerIncludes, type CustomerNotification, type CustomerNotificationOptions, type CustomerNotificationTemplate, type CustomerNotificationType, type CustomerPortalAccessOptions, type CustomerPortalAccessResponse, type CustomerPortalSettings, type CustomerSurveyOfferParams, type CustomerSurveyOfferResponse, type CustomerSurveyOffersResponse, type CustomerSurveyReason, type CustomerSurveyReasonsResponse, type DefaultProduct, type DefaultSelection, type DefaultVariant, type DelayOption, type DeleteSubscriptionsParams, type DeleteSubscriptionsRequest, type Delivery, type DeliveryLineItem, type DeliveryOrder, type DeliveryPaymentMethod, type Discount, type DiscountType, type DynamicBundleItemAppProxy, type DynamicBundlePropertiesAppProxy, type EligibleChargeType, type EligibleLineItemType, type ExternalAttributeSchema, type ExternalId, type ExternalProductStatus, type ExternalTransactionId, type FirstOption, type GetAddressOptions, type GetChargeOptions, type GetCreditSummaryOptions, type GetCustomerOptions, type GetMembershipProgramOptions, type GetPaymentMethodOptions, type GetRequestOptions, type GetSubscriptionOptions, type GiftPurchase, type GiftPurchasesParams, type GiftPurchasesResponse, type HTMLString, type Incentives, type InitOptions, type InternalSession, type IntervalUnit, type InventoryPolicy, type IsoDateString, type LineItem, type ListParams, type LoginResponse, type Membership, type MembershipBenefit, type MembershipIncludes, type MembershipListParams, type MembershipListResponse, type MembershipProgram, type MembershipProgramIncludes, type MembershipProgramListParams, type MembershipProgramListResponse, type MembershipProgramResponse, type MembershipProgramSortBy, type MembershipProgramStatus, type MembershipResponse, type MembershipStatus, type MembershipsSortBy, type MergeAddressesRequest, type Metafield, type MetafieldOptionalCreateProps, type MetafieldOwnerResource, type MetafieldRequiredCreateProps, type Method, type Modifier, type MultiStepSettings, type OfferAttributes, type OnePageSettings, type Onetime, type OnetimeIncludes, type OnetimeListParams, type OnetimeOptionalCreateProps, type OnetimeRequiredCreateProps, type OnetimeSubscription, type OnetimesResponse, type OnetimesSortBy, type OnlineStoreOptions, type Options, type Order, type OrderIncludes, type OrderListParams, type OrderSortBy, type OrderStatus, type OrderType, type OrdersResponse, type PasswordlessCodeResponse, type PasswordlessOptions, type PasswordlessValidateResponse, type PaymentDetails, type PaymentMethod, type PaymentMethodIncludes, type PaymentMethodListParams, type PaymentMethodOptionalCreateProps, type PaymentMethodRequiredCreateProps, type PaymentMethodSortBy, type PaymentMethodStatus, type PaymentMethodsResponse, type PaymentType, type Plan, type PlanListParams, type PlanSortBy, type PlanType, type PlansResponse, type PriceRange, type PriceRule, type PriceSet, type ProcessorName, type Product, type ProductImage, type ProductInclude, type ProductListResponse, type ProductOption, type ProductSearchParams_2020_12, type ProductSearchParams_2022_06, type ProductSearchResponse_2020_12, type ProductSearchResponse_2022_06, type ProductSearchType, type ProductSource, type ProductValueOption, type ProductVariant_2020_12, type ProductVariant_2022_06, type Product_2020_12, type Product_2022_06, type Property, type PublicBundleData, type PublishStatus, type PunchCardProgress, type PunchCardProgressData, type QuantityRange, type RecurringSubscription, type ReferralInfo, type ReferralUrl, type Request, type RequestHeaders, type RequestOptions, type SellingPlan, type SellingPlanAllocation, type SellingPlanGroup, type Session, type ShippingCountriesOptions, type ShippingCountriesResponse, type ShippingCountry, type ShippingLine, type ShippingProvince, type ShopifyStorefrontOptions, type ShopifyUpdatePaymentInfoOptions, type SkipChargeParams, type SkipFutureChargeAddressRequest, type SkipFutureChargeAddressResponse, type SortBy, type SortField, type SortKeys, type StepSettings, type StepSettingsCommon, type StepSettingsTypes, type StoreSettings, type StorefrontEnvironment, type StorefrontOptions, type StorefrontPurchaseOption, type SubType, type Subscription, type SubscriptionBase, type SubscriptionCancelled, type SubscriptionIncludes, type SubscriptionListParams, type SubscriptionOption, type SubscriptionOptionalCreateProps, type SubscriptionPreferences, type SubscriptionRequiredCreateProps, type SubscriptionSortBy, type SubscriptionStatus, type Subscription_2021_01, type SubscriptionsResponse, type TaxLine, type Tier, type TieredDiscount, type TieredDiscountStatus, type Translations, type UpdateAddressParams, type UpdateAddressRequest, type UpdateBundlePurchaseItem, type UpdateBundleSelectionRequest, type UpdateCustomerRequest, type UpdateMetafieldRequest, type UpdateOnetimeRequest, type UpdatePaymentMethodRequest, type UpdateSubscriptionChargeDateParams, type UpdateSubscriptionParams, type UpdateSubscriptionRequest, type UpdateSubscriptionsParams, type UpdateSubscriptionsRequest, type Variant, type VariantSelector, type VariantSelectorStepSetting, type WidgetIconColor, type WidgetTemplateType, type WidgetVisibility, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, changeMembership, claimOfferCustomerSurvey, createAddress, createBundleSelection, createMetafield, createOnetime, createPaymentMethod, createSubscription, createSubscriptions, delayOrder, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, deleteSubscriptions, getActiveChurnLandingPageURL, getAddress, getBundleId, getBundleSelection, getBundleSelectionId, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCollection, getCreditSummary, getCustomer, getCustomerPortalAccess, getCustomerSurveyOffers, getCustomerSurveyReasons, getDeliverySchedule, getDynamicBundleItems, getFailedPaymentMethodRecoveryLandingPageURL, getGiftPurchase, getGiftRedemptionLandingPageURL, getMembership, getMembershipProgram, getOnetime, getOrder, getPaymentMethod, getPlan, getShippingCountries, getStoreSettings, getSubscription, initRecharge, type intervalUnit, listAddresses, listBundleSelections, listCharges, listCollectionProducts, listCollections, listCreditAccounts, listGiftPurchases, listMembershipPrograms, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loadBundleData, loginCustomerPortal, loginShopifyApi, loginShopifyAppProxy, loginWithShopifyCustomerAccount, loginWithShopifyStorefront, type membershipIncludes, mergeAddresses, processCharge, productSearch, removeDiscountsFromAddress, removeDiscountsFromCharge, rescheduleCharge, resetCDNCache, sendCustomerNotification, sendPasswordlessCode, sendPasswordlessCodeAppProxy, setApplyCreditsToNextCharge, skipCharge, skipFutureCharge, skipGiftSubscriptionCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateBundle, updateBundleSelection, updateCustomer, updateMetafield, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions, validateBundle, validateBundleSelection, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };
4006
+ export { type ActivateMembershipRequest, type AddToCartCallbackSettings, type AddonProduct, type AddonSettings, type AddonsSection, type Address, type AddressIncludes, type AddressListParams, type AddressListResponse, type AddressResponse, type AddressSortBy, type AnalyticsData, type Announcement, type ApplyCreditOptions, type AssociatedAddress, type BaseCardDetails, type BaseProduct, type BaseProductVariant, type BaseVariant, type BasicSubscriptionParams, type BooleanLike, type BooleanNumbers, type BooleanString, type BooleanStringNumbers, type BulkSubscriptionParams, type BundleAppProxy, type BundleData, type BundleDataBaseProduct, type BundleDataCollection, type BundleDataSellingPlan, type BundleDataSellingPlanGroup, type BundleDataVariant, type BundlePriceRule, type BundleProduct, type BundleProductLayoutSettings, type BundlePurchaseItem, type BundlePurchaseItemParams, type BundleSelection, type BundleSelectionAppProxy, type BundleSelectionItem, type BundleSelectionItemRequiredCreateProps, type BundleSelectionListParams, type BundleSelectionsResponse, type BundleSelectionsSortBy, type BundleSettings, type BundleTemplateSettings, type BundleTemplateType, type BundleTranslations, type BundleVariant, type BundleVariantOptionSource, type BundleVariantRange, type BundleVariantSelectionDefault, type CDNBaseWidgetSettings, type CDNBundleSettings, type CDNBundleVariant, type CDNBundleVariantOptionSource, type CDNPlan, type CDNProduct, type CDNProductAndSettings, type CDNProductKeyObject, type CDNProductQuery_2020_12, type CDNProductQuery_2022_06, type CDNProductRaw, type CDNProductResource, type CDNProductResponseType, type CDNProductType, type CDNProductVariant_2022_06, type CDNProduct_2022_06, type CDNProductsAndSettings, type CDNProductsAndSettingsResource, type CDNStoreSettings, type CDNSubscriptionOption, type CDNVariant, type CDNVersion, type CDNWidgetSettings, type CDNWidgetSettingsRaw, type CDNWidgetSettingsResource, type CRUDRequestOptions, type CancelMembershipRequest, type CancelSubscriptionRequest, type CardDetailsFirstNameLastName, type CardDetailsFullName, type ChangeMembershipRequest, type ChannelSettings, type Charge, type ChargeIncludes, type ChargeListParams, type ChargeListResponse, type ChargeResponse, type ChargeSortBy, type ChargeStatus, type Collection, type CollectionBinding, type CollectionListParams, type CollectionTypes, type CollectionsResponse, type CollectionsSortBy, type ColorString, type CreateAddressRequest, type CreateBundleSelectionRequest, type CreateMetafieldRequest, type CreateOnetimeRequest, type CreatePaymentMethodRequest, type CreateRecipientAddress, type CreateSubscriptionRequest, type CreateSubscriptionsParams, type CreateSubscriptionsRequest, type CreditAccount, type CreditAccountIncludes, type CreditAccountListParams, type CreditAccountType, type CreditAccountsResponse, type CreditAccountsSortBy, type CreditSummaryIncludes, type CrossSellsSection, type CrossSellsSettings, type CurrencyPriceSet, type Customer, type CustomerCreditSummary, type CustomerDeliveryScheduleParams, type CustomerDeliveryScheduleResponse, type CustomerIncludes, type CustomerNotification, type CustomerNotificationOptions, type CustomerNotificationTemplate, type CustomerNotificationType, type CustomerPortalAccessOptions, type CustomerPortalAccessResponse, type CustomerPortalSettings, type CustomerSurveyOfferParams, type CustomerSurveyOfferResponse, type CustomerSurveyOffersResponse, type CustomerSurveyReason, type CustomerSurveyReasonsResponse, type DefaultProduct, type DefaultSelection, type DefaultVariant, type DelayOption, type DeleteSubscriptionsParams, type DeleteSubscriptionsRequest, type Delivery, type DeliveryLineItem, type DeliveryOrder, type DeliveryPaymentMethod, type Discount, type DiscountType, type DynamicBundleItemAppProxy, type DynamicBundlePropertiesAppProxy, type EligibleChargeType, type EligibleLineItemType, type ExternalAttributeSchema, type ExternalId, type ExternalProductStatus, type ExternalTransactionId, type FirstOption, type GetAddressOptions, type GetChargeOptions, type GetCreditSummaryOptions, type GetCustomerOptions, type GetMembershipProgramOptions, type GetPaymentMethodOptions, type GetRequestOptions, type GetSubscriptionOptions, type GiftPurchase, type GiftPurchasesParams, type GiftPurchasesResponse, type HTMLString, type Incentives, type InitOptions, type InternalSession, type IntervalUnit, type InventoryPolicy, type IsoDateString, type LineItem, type ListParams, type LoginResponse, type Membership, type MembershipBenefit, type MembershipIncludes, type MembershipListParams, type MembershipListResponse, type MembershipProgram, type MembershipProgramIncludes, type MembershipProgramListParams, type MembershipProgramListResponse, type MembershipProgramResponse, type MembershipProgramSortBy, type MembershipProgramStatus, type MembershipResponse, type MembershipStatus, type MembershipsSortBy, type MergeAddressesRequest, type Metafield, type MetafieldOptionalCreateProps, type MetafieldOwnerResource, type MetafieldRequiredCreateProps, type Method, type Modifier, type MultiStepSettings, type OfferAttributes, type OnePageSettings, type Onetime, type OnetimeIncludes, type OnetimeListParams, type OnetimeOptionalCreateProps, type OnetimeRequiredCreateProps, type OnetimeSubscription, type OnetimesResponse, type OnetimesSortBy, type OnlineStoreOptions, type Options, type Order, type OrderIncludes, type OrderListParams, type OrderSortBy, type OrderStatus, type OrderType, type OrdersResponse, type PasswordlessCodeResponse, type PasswordlessOptions, type PasswordlessValidateResponse, type PaymentDetails, type PaymentErrorCallback, type PaymentFieldEventCallback, type PaymentFormConfig, type PaymentFormController, type PaymentFormEventHandlers, type PaymentMethod, type PaymentMethodFormOptions, type PaymentMethodIncludes, type PaymentMethodListParams, type PaymentMethodOptionalCreateProps, type PaymentMethodRequiredCreateProps, type PaymentMethodSortBy, type PaymentMethodStatus, type PaymentMethodTokenCallback, type PaymentMethodsResponse, type PaymentType, type Plan, type PlanListParams, type PlanSortBy, type PlanType, type PlansResponse, type PriceRange, type PriceRule, type PriceSet, type ProcessorName, type Product, type ProductImage, type ProductInclude, type ProductListResponse, type ProductOption, type ProductSearchParams_2020_12, type ProductSearchParams_2022_06, type ProductSearchResponse_2020_12, type ProductSearchResponse_2022_06, type ProductSearchType, type ProductSource, type ProductValueOption, type ProductVariant_2020_12, type ProductVariant_2022_06, type Product_2020_12, type Product_2022_06, type Property, type PublicBundleData, type PublishStatus, type PunchCardProgress, type PunchCardProgressData, type QuantityRange, type RecurringSubscription, type ReferralInfo, type ReferralUrl, type Request, type RequestHeaders, type RequestOptions, type SellingPlan, type SellingPlanAllocation, type SellingPlanGroup, type Session, type ShippingCountriesOptions, type ShippingCountriesResponse, type ShippingCountry, type ShippingLine, type ShippingProvince, type ShopifyStorefrontOptions, type ShopifyUpdatePaymentInfoOptions, type SkipChargeParams, type SkipFutureChargeAddressRequest, type SkipFutureChargeAddressResponse, type SortBy, type SortField, type SortKeys, type StepSettings, type StepSettingsCommon, type StepSettingsTypes, type StoreSettings, type StorefrontEnvironment, type StorefrontOptions, type StorefrontPurchaseOption, type SubType, type Subscription, type SubscriptionBase, type SubscriptionCancelled, type SubscriptionIncludes, type SubscriptionListParams, type SubscriptionOption, type SubscriptionOptionalCreateProps, type SubscriptionPreferences, type SubscriptionRequiredCreateProps, type SubscriptionSortBy, type SubscriptionStatus, type Subscription_2021_01, type SubscriptionsResponse, type TaxLine, type Tier, type TieredDiscount, type TieredDiscountStatus, type Translations, type UpdateAddressParams, type UpdateAddressRequest, type UpdateBundlePurchaseItem, type UpdateBundleSelectionRequest, type UpdateCustomerRequest, type UpdateMetafieldRequest, type UpdateOnetimeRequest, type UpdatePaymentMethodRequest, type UpdateSubscriptionChargeDateParams, type UpdateSubscriptionParams, type UpdateSubscriptionRequest, type UpdateSubscriptionsParams, type UpdateSubscriptionsRequest, type Variant, type VariantSelector, type VariantSelectorStepSetting, type WidgetIconColor, type WidgetTemplateType, type WidgetVisibility, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, changeMembership, claimOfferCustomerSurvey, createAddress, createBundleSelection, createMetafield, createOnetime, createPaymentFormV1, createPaymentMethod, createSubscription, createSubscriptions, delayOrder, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, deleteSubscriptions, getActiveChurnLandingPageURL, getAddress, getBundleId, getBundleSelection, getBundleSelectionId, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCollection, getCreditSummary, getCustomer, getCustomerPortalAccess, getCustomerSurveyOffers, getCustomerSurveyReasons, getDeliverySchedule, getDynamicBundleItems, getFailedPaymentMethodRecoveryLandingPageURL, getGiftPurchase, getGiftRedemptionLandingPageURL, getMembership, getMembershipProgram, getOnetime, getOrder, getPaymentMethod, getPlan, getShippingCountries, getStoreSettings, getSubscription, initRecharge, type intervalUnit, listAddresses, listBundleSelections, listCharges, listCollectionProducts, listCollections, listCreditAccounts, listGiftPurchases, listMembershipPrograms, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loadBundleData, loginCustomerPortal, loginShopifyApi, loginShopifyAppProxy, loginWithShopifyCustomerAccount, loginWithShopifyStorefront, type membershipIncludes, mergeAddresses, processCharge, productSearch, removeDiscountsFromAddress, removeDiscountsFromCharge, rescheduleCharge, resetCDNCache, sendCustomerNotification, sendPasswordlessCode, sendPasswordlessCodeAppProxy, setApplyCreditsToNextCharge, skipCharge, skipFutureCharge, skipGiftSubscriptionCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateBundle, updateBundleSelection, updateCustomer, updateMetafield, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions, validateBundle, validateBundleSelection, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };