@getopenpay/openpay-js 0.1.7 → 0.1.8-alpha.8cf0044

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/dist/index.d.ts CHANGED
@@ -46,6 +46,25 @@ declare class ConnectionManager {
46
46
  getAllConnections(): Map<ElementType, CdeConnection>;
47
47
  }
48
48
 
49
+ declare type CustomInitParams = {
50
+ stripeLink?: {
51
+ /**
52
+ * The height of the Stripe Link button. By default, the height of the buttons are 44px.
53
+ * You can override this to specify a custom button height in the range of 40px-55px.
54
+ *
55
+ * See more: https://docs.stripe.com/js/elements_object/create_express_checkout_element#express_checkout_element_create-options-buttonHeight
56
+ */
57
+ buttonHeight?: number;
58
+
59
+ /**
60
+ * If this function returns false, the stripe link submit process is aborted.
61
+ * This can be used for additional pre-submit checks (e.g. additional form validation).
62
+ * Note that this function must complete within 1 second, or the submission will fail.
63
+ */
64
+ overrideLinkSubmit?: () => Promise<boolean>;
65
+ };
66
+ };
67
+
49
68
  declare type ElementProps<PlaceholderType extends z.ZodTypeAny = z.ZodString> = {
50
69
  styles?: ElementsStyle<z.ZodOptional<PlaceholderType>>;
51
70
  };
@@ -66,6 +85,7 @@ export declare type ElementsFormProps = {
66
85
  baseUrl?: string;
67
86
  formTarget?: string;
68
87
  onPaymentRequestLoad?: (paymentRequests: Record<PaymentRequestProvider, PaymentRequestStatus>) => void;
88
+ customInitParams?: CustomInitParams;
69
89
  };
70
90
 
71
91
  declare const ElementsStyle = <T extends z.ZodTypeAny>(placeholderType: T) =>
@@ -124,6 +144,11 @@ declare type InitOjsFlowParams = {
124
144
  * Ideally this only contains "background" context (OJS-level objects), and not flow-level objects.
125
145
  */
126
146
  context: OjsContext;
147
+
148
+ /**
149
+ * Lifecycle callbacks for OJS flows.
150
+ */
151
+ flowCallbacks: OjsFlowCallbacks;
127
152
  };
128
153
 
129
154
  declare type InitOjsFlowResult = {
@@ -192,6 +217,11 @@ declare type OjsContext = {
192
217
  */
193
218
  cdeConnections: Map<ElementType, CdeConnection>;
194
219
 
220
+ /**
221
+ * Custom init params for init flows.
222
+ */
223
+ customInitParams: CustomInitParams;
224
+
195
225
  /**
196
226
  * The base URL of the CDE iframe.
197
227
  */
@@ -247,14 +277,20 @@ declare type OjsFlowParams<T_PARAMS = void, T_INIT_RESULT = void> = {
247
277
  declare const OjsFlows = {
248
278
  // ✋ Note: For flows that require initialization, please add them to `init-flows.ts`
249
279
 
250
- // Stripe
280
+ // Common
251
281
  commonCC: {
252
282
  run: runCommonCcFlow,
253
283
  },
284
+
285
+ // Stripe
254
286
  stripePR: {
255
287
  init: initStripePrFlow,
256
288
  run: runStripePrFlow,
257
289
  },
290
+ stripeLink: {
291
+ init: initStripeLinkFlow,
292
+ run: runStripeLinkFlow,
293
+ },
258
294
 
259
295
  // 👉 Add more flows here
260
296
 
@@ -277,6 +313,7 @@ export declare class OpenPayForm {
277
313
  formTarget: string;
278
314
  checkoutFired: boolean;
279
315
  ojsVersion: string;
316
+ ojsReleaseVersion: string;
280
317
  private referer;
281
318
  private eventHandler;
282
319
  private formProperties;
@@ -310,7 +347,6 @@ export declare class OpenPayForm {
310
347
  private connectToElement;
311
348
  private getFormDiv;
312
349
  private createOjsFlowContext;
313
- private getNonCdeFormInputs;
314
350
  private createOjsFlowCallbacks;
315
351
  submit(): void;
316
352
  submitPaymentRequest: (provider: PaymentRequestProvider, initResult: InitStripePrFlowSuccess, params?: PaymentRequestStartParams) => Promise<void>;