@payrails/web-sdk 5.35.0-RC.0 → 5.36.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payrails/web-sdk",
3
- "version": "5.35.0-RC.0",
3
+ "version": "5.36.0",
4
4
  "description": "SDK providing tokenization options on the client for merchants",
5
5
  "main": "index.js",
6
6
  "types": "payrails.d.ts",
@@ -84,69 +84,6 @@
84
84
  }
85
85
  }
86
86
 
87
- #payrails-popup {
88
- background-color: #fefefe;
89
- margin: auto;
90
- padding: 0;
91
- overflow: hidden;
92
- border: 1px solid #888;
93
- border-radius: 4px;
94
- position: relative;
95
- }
96
-
97
- #payrails-popup-background {
98
- position: fixed;
99
- z-index: 10000;
100
- left: 0;
101
- top: 0;
102
- width: 100%;
103
- height: 100%;
104
- overflow: auto;
105
- background-color: rgb(0, 0, 0);
106
- background-color: rgba(0, 0, 0, 0.4);
107
- display: flex;
108
- align-content: center;
109
- }
110
-
111
- #payrails-popup-cancel-button {
112
- position: absolute;
113
- top: 8px;
114
- right: 8px;
115
- width: 32px;
116
- height: 32px;
117
- background: none;
118
- border: none;
119
- cursor: pointer;
120
- z-index: 1;
121
- display: flex;
122
- align-items: center;
123
- justify-content: center;
124
- border-radius: 50%;
125
- transition: background-color 0.2s ease;
126
- }
127
-
128
- #payrails-popup-cancel-button::before,
129
- #payrails-popup-cancel-button::after {
130
- content: '';
131
- position: absolute;
132
- width: 14px;
133
- height: 2px;
134
- transition: background-color 0.2s ease;
135
- background-color: #667da6;
136
- }
137
-
138
- #payrails-popup-cancel-button::before {
139
- transform: rotate(45deg);
140
- }
141
-
142
- #payrails-popup-cancel-button::after {
143
- transform: rotate(-45deg);
144
- }
145
-
146
- #payrails-frame {
147
- border: 0;
148
- }
149
-
150
87
  .payrails-store-instrument-checkbox {
151
88
  margin-right: 4px;
152
89
  }
@@ -756,6 +693,69 @@ button.payrails-generic-button {
756
693
  }
757
694
  }
758
695
 
696
+ #payrails-popup {
697
+ background-color: #fefefe;
698
+ margin: auto;
699
+ padding: 0;
700
+ overflow: hidden;
701
+ border: 1px solid #888;
702
+ border-radius: 4px;
703
+ position: relative;
704
+ }
705
+
706
+ #payrails-popup-background {
707
+ position: fixed;
708
+ z-index: 10000;
709
+ left: 0;
710
+ top: 0;
711
+ width: 100%;
712
+ height: 100%;
713
+ overflow: auto;
714
+ background-color: rgb(0, 0, 0);
715
+ background-color: rgba(0, 0, 0, 0.4);
716
+ display: flex;
717
+ align-content: center;
718
+ }
719
+
720
+ #payrails-popup-cancel-button {
721
+ position: absolute;
722
+ top: 8px;
723
+ right: 8px;
724
+ width: 32px;
725
+ height: 32px;
726
+ background: none;
727
+ border: none;
728
+ cursor: pointer;
729
+ z-index: 1;
730
+ display: flex;
731
+ align-items: center;
732
+ justify-content: center;
733
+ border-radius: 50%;
734
+ transition: background-color 0.2s ease;
735
+ }
736
+
737
+ #payrails-popup-cancel-button::before,
738
+ #payrails-popup-cancel-button::after {
739
+ content: '';
740
+ position: absolute;
741
+ width: 14px;
742
+ height: 2px;
743
+ transition: background-color 0.2s ease;
744
+ background-color: #667da6;
745
+ }
746
+
747
+ #payrails-popup-cancel-button::before {
748
+ transform: rotate(45deg);
749
+ }
750
+
751
+ #payrails-popup-cancel-button::after {
752
+ transform: rotate(-45deg);
753
+ }
754
+
755
+ #payrails-frame {
756
+ border: 0;
757
+ }
758
+
759
759
  #payrails-paypal-button-wrapper {
760
760
  min-height: 44px;
761
761
  }
package/payrails.d.ts CHANGED
@@ -120,6 +120,7 @@ declare class WorkflowExecution {
120
120
  payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
121
121
  };
122
122
  links: {
123
+ execution: string;
123
124
  authorize?: {
124
125
  href: string;
125
126
  method: "POST";
@@ -128,7 +129,14 @@ declare class WorkflowExecution {
128
129
  href: string;
129
130
  method: "POST";
130
131
  };
131
- execution: string;
132
+ startPaymentSession?: {
133
+ href: string;
134
+ method: "POST";
135
+ };
136
+ createInstrument?: {
137
+ href: string;
138
+ method: "POST";
139
+ };
132
140
  };
133
141
  name: "lookup";
134
142
  };
@@ -168,6 +176,7 @@ declare class WorkflowExecution {
168
176
  static get authorizeLink(): string | undefined;
169
177
  static get payoutLink(): string | undefined;
170
178
  static get createSessionLink(): string | undefined;
179
+ static get createInstrumentLink(): string | undefined;
171
180
  static get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
172
181
  static get storedDropinInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
173
182
  static getFullPaymentMethodConfig(paymentMethod: PAYMENT_METHOD_CODES): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined> | undefined;
@@ -247,6 +256,7 @@ interface WorkflowExecutionResponse {
247
256
  payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
248
257
  };
249
258
  links: {
259
+ execution: string;
250
260
  authorize?: {
251
261
  href: string;
252
262
  method: 'POST';
@@ -255,7 +265,14 @@ interface WorkflowExecutionResponse {
255
265
  href: string;
256
266
  method: 'POST';
257
267
  };
258
- execution: string;
268
+ startPaymentSession?: {
269
+ href: string;
270
+ method: 'POST';
271
+ };
272
+ createInstrument?: {
273
+ href: string;
274
+ method: 'POST';
275
+ };
259
276
  };
260
277
  name: 'lookup';
261
278
  };
@@ -265,6 +282,10 @@ interface WorkflowExecutionResponse {
265
282
  href: string;
266
283
  method: 'POST';
267
284
  };
285
+ createInstrument?: {
286
+ href: string;
287
+ method: 'POST';
288
+ };
268
289
  confirm?: {
269
290
  href: string;
270
291
  action?: {
@@ -1222,6 +1243,7 @@ interface SdkConfiguration {
1222
1243
  instrumentDelete?: Links;
1223
1244
  instrumentUpdate?: Links;
1224
1245
  };
1246
+ type?: 'tokenization' | 'dropIn' | 'secureFields';
1225
1247
  vaultConfiguration: {
1226
1248
  cardTableName: string;
1227
1249
  token: string;
@@ -1451,6 +1473,7 @@ interface GenericRedirectButtonOptions {
1451
1473
  events?: PaymentEvents;
1452
1474
  paymentMethod: BasePaymentMethodConfig;
1453
1475
  openInNewTab?: boolean;
1476
+ returnInfo?: ReturnInfo;
1454
1477
  }
1455
1478
  declare class GenericRedirectButton extends PayrailsElement {
1456
1479
  protected options: GenericRedirectButtonOptions;
@@ -1879,7 +1902,7 @@ declare class Payrails {
1879
1902
  getAvailablePaymentMethods(): PAYMENT_METHOD_CODES[];
1880
1903
  paymentButton(options: CardPaymentButtonOptions): CardPaymentButton;
1881
1904
  paypalButton(options?: PaypalButtonOptions): PaypalButton;
1882
- genericRedirectButton(options: GenericRedirectButtonOptions, returnInfo?: ReturnInfo): GenericRedirectButton;
1905
+ genericRedirectButton(options: GenericRedirectButtonOptions): GenericRedirectButton;
1883
1906
  dynamicElement(options: DynamicElementOptions): DynamicElementForm;
1884
1907
  getSavedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
1885
1908
  private logIntegrationMode;
@@ -1891,14 +1914,44 @@ interface ClientEvents {
1891
1914
  onClientInitialized?: (execution?: typeof WorkflowExecution) => void;
1892
1915
  onSessionExpired?: () => Promise<InitOptions>;
1893
1916
  }
1894
- interface PaymentEvents {
1917
+ declare enum PayrailsElementAction {
1918
+ AUTHORIZE = "AUTHORIZE",
1919
+ TOKENIZE = "TOKENIZE"
1920
+ }
1921
+ interface GenericElementActionEvents {
1922
+ onPending?: (action: PayrailsElementAction, e?: any) => void;
1923
+ onRequestStart?: (action: PayrailsElementAction) => Promise<boolean>;
1924
+ onSuccess?: (action: PayrailsElementAction, e?: any) => void;
1925
+ onFailed?: (action: PayrailsElementAction, e?: any) => void;
1926
+ onButtonClicked?: (action: PayrailsElementAction, e?: {
1927
+ bin?: string;
1928
+ }) => Promise<boolean>;
1929
+ }
1930
+ interface PaymentAuthorizeEvents {
1931
+ /**
1932
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onPending` instead.
1933
+ */
1934
+ onAuthorizePending?: (e?: any) => void;
1935
+ /**
1936
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onRequestStart` instead.
1937
+ */
1938
+ onAuthorizeRequestStart?: () => Promise<boolean>;
1939
+ /**
1940
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onSuccess` instead.
1941
+ */
1895
1942
  onAuthorizeSuccess?: (e?: any) => void;
1943
+ /**
1944
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onFailed` instead.
1945
+ */
1896
1946
  onAuthorizeFailed?: (e?: any) => void;
1897
- onAuthorizePending?: (e?: any) => void;
1947
+ }
1948
+ interface PaymentEvents extends PaymentAuthorizeEvents, GenericElementActionEvents {
1949
+ /**
1950
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onButtonClicked` instead.
1951
+ */
1898
1952
  onPaymentButtonClicked?: (e?: {
1899
1953
  bin?: string;
1900
1954
  }) => Promise<boolean>;
1901
- onAuthorizeRequestStart?: () => Promise<boolean>;
1902
1955
  onPaymentSessionExpired?: () => void;
1903
1956
  onThreeDSecureChallenge?: () => void;
1904
1957
  }
@@ -1978,14 +2031,17 @@ declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox
1978
2031
  protected options: ApplePayButtonOptions;
1979
2032
  private appleButton;
1980
2033
  private paymentExecutor;
2034
+ private action;
1981
2035
  static isApplePayAvailable(): Promise<boolean>;
1982
2036
  constructor(options: ApplePayButtonOptions);
1983
2037
  mount(location: string): void;
1984
2038
  unmount(): void;
1985
2039
  private mountApplePayButton;
1986
- private createOnAuthorizeFailedHandler;
2040
+ private onAuthorizeFailedHandler;
1987
2041
  private createApplePaySession;
1988
2042
  private onApplePayAuthorized;
2043
+ private doAuthorizedPayment;
2044
+ private doTokenize;
1989
2045
  }
1990
2046
 
1991
2047
  export { AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsEnvironment };