@payrails/web-sdk 4.1.0-rc.1 → 5.0.0-RC.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": "4.1.0-rc.1",
3
+ "version": "5.0.0-RC.0",
4
4
  "description": "SDK providing tokenization options on the client for merchants",
5
5
  "main": "index.js",
6
6
  "types": "payrails.d.ts",
@@ -158,32 +158,144 @@
158
158
  }
159
159
 
160
160
  #payrails-dropin-component {
161
- background: #ffffff;
162
- box-shadow:
163
- 0px 0px 1px rgba(66, 71, 76, 0.32),
164
- 0px 4px 8px rgba(66, 71, 76, 0.06),
165
- 0px 8px 48px #eeeeee;
166
- border-radius: 16px;
167
- border: 1px solid #eae8ee;
168
- width: 100%;
161
+ border-radius: 0;
162
+ box-shadow: none;
163
+ background-color: rgba(246, 247, 248, 1);
169
164
 
170
165
  display: flex;
171
166
  flex-direction: column;
172
167
  align-items: flex-start;
173
168
  padding: 24px;
174
169
  position: relative;
170
+ border: 1px solid rgb(223, 224, 225);
171
+ }
172
+
173
+ .payrails-dropin-item {
174
+ border-radius: 0;
175
+ background-color: white;
176
+ padding: 20px;
177
+ transition: border 500ms ease-out;
178
+ width: 100%;
179
+ border: 1px solid rgb(223, 224, 225);
180
+ }
181
+
182
+ .payrails-dropin-item:hover {
183
+ border-color: black;
184
+ }
185
+
186
+ .payrails-dropin-item.active {
187
+ border-color: black;
188
+ }
189
+
190
+ .payrails-dropin-item button {
191
+ background-color: rgba(25, 25, 25, 1);
192
+ width: 100%;
193
+ border-radius: 0;
194
+ color: white;
195
+ text-transform: uppercase;
196
+ font-weight: medium;
197
+ padding: 20px;
198
+ height: auto;
199
+ cursor: pointer;
200
+ }
201
+
202
+ .payrails-dropin-item button:hover:not([disabled], .black) {
203
+ background-color: rgba(59, 64, 71, 1);
175
204
  }
176
205
 
177
206
  .payrails-dropin-item input[type='radio'] {
178
- width: auto;
207
+ appearance: none;
208
+ -webkit-appearance: none;
209
+ -moz-appearance: none;
210
+ width: 20px !important;
211
+ height: 20px !important;
212
+ border: 2px solid rgba(140, 145, 152, 0.5);
213
+ border-radius: 50%;
214
+ padding: 2px;
215
+ cursor: pointer;
216
+ background-clip: padding-box;
217
+ position: relative;
179
218
  margin-right: 8px;
180
219
  }
181
220
 
182
- .payrails-dropin-item {
183
- border: 1px solid #eae8ee;
221
+ .payrails-dropin-item input[type='radio']:checked:after {
222
+ content: '';
223
+ display: block;
224
+ width: 10px;
225
+ height: 10px;
226
+ background-color: rgba(25, 25, 25, 1);
227
+ border-radius: 50%;
228
+ position: absolute;
229
+ top: 50%;
230
+ left: 50%;
231
+ transform: translate(-50%, -50%);
232
+ }
233
+
234
+ .payrails-dropin-item input[type='radio']:checked {
235
+ border-color: rgba(103, 109, 117, 1);
236
+ }
237
+
238
+ .payrails-dropin-item input[type='radio']:focus {
239
+ box-shadow: 0 0 0 2px rgba(140, 145, 152, 0.5);
240
+ }
241
+
242
+ .payrails-dropin-item input[type='radio']:hover,
243
+ .payrails-dropin-item:hover input[type='radio'] {
244
+ border-color: rgba(140, 145, 152, 0.8);
245
+ }
246
+
247
+ .payrails-dropin-item label {
248
+ display: flex;
249
+ flex-direction: row;
250
+ align-items: center;
251
+ }
252
+
253
+ .payrails-dropin-item.payrails-store-instrument {
254
+ display: block;
255
+ margin-top: 20px !important;
256
+ }
257
+
258
+ .payrails-dropin-item .payrails-store-instrument input[type='checkbox'] {
259
+ appearance: none;
260
+ -webkit-appearance: none;
261
+ -moz-appearance: none;
262
+ width: 20px !important;
263
+ height: 20px !important;
264
+ border: 2px solid rgba(140, 145, 152, 0.5);
184
265
  border-radius: 4px;
185
- padding: 16px;
186
- width: 100%;
266
+ padding: 2px;
267
+ cursor: pointer;
268
+ background-clip: padding-box;
269
+ position: relative;
270
+ }
271
+
272
+ .payrails-dropin-item
273
+ .payrails-store-instrument
274
+ input[type='checkbox']:checked:after {
275
+ content: '\2714';
276
+ display: block;
277
+ color: white;
278
+ position: absolute;
279
+ font-size: 10px;
280
+ top: 50%;
281
+ left: 50%;
282
+ transform: translate(-50%, -50%);
283
+ }
284
+
285
+ .payrails-dropin-item
286
+ .payrails-store-instrument
287
+ input[type='checkbox']:checked {
288
+ border-color: rgba(103, 109, 117, 1);
289
+ background-color: rgba(25, 25, 25, 1);
290
+ }
291
+
292
+ .payrails-dropin-item .payrails-store-instrument input[type='checkbox']:focus {
293
+ box-shadow: 0 0 0 2px rgba(140, 145, 152, 0.5);
294
+ }
295
+
296
+ .payrails-dropin-item .payrails-store-instrument input[type='checkbox']:hover,
297
+ .payrails-dropin-item .payrails-store-instrument:hover input[type='checkbox'] {
298
+ border-color: rgba(140, 145, 152, 0.8);
187
299
  }
188
300
 
189
301
  #payrails-dropin-component * {
package/payrails.d.ts CHANGED
@@ -475,7 +475,7 @@ interface Mountable {
475
475
  }
476
476
  interface ElementOptions {
477
477
  id?: string;
478
- className?: string;
478
+ className?: string | string[];
479
479
  styles?: Partial<CSSStyleDeclaration>;
480
480
  }
481
481
  declare class PayrailsElement implements Mountable {
@@ -591,7 +591,6 @@ interface CardFormOptions extends StoreInstrumentElementOptions {
591
591
  wrapper?: Partial<CSSStyleDeclaration>;
592
592
  base?: Partial<CSSStyleDeclaration>;
593
593
  storeCardCheckbox?: Partial<CSSStyleDeclaration>;
594
- storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
595
594
  errorTextStyles?: {
596
595
  base: Partial<CSSStyleDeclaration>;
597
596
  };
@@ -601,7 +600,7 @@ interface CardFormOptions extends StoreInstrumentElementOptions {
601
600
  labels?: {
602
601
  [key in ElementType | 'all']?: Partial<CSSStyleDeclaration>;
603
602
  };
604
- };
603
+ } & StoreInstrumentElementOptions['styles'];
605
604
  }
606
605
  declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
607
606
  private readonly collectContainer;
@@ -647,7 +646,7 @@ declare class CardList extends PayrailsElement {
647
646
  reset(): void;
648
647
  }
649
648
 
650
- interface RedirectReturnLinks {
649
+ interface ReturnInfo {
651
650
  success?: string;
652
651
  cancel?: string;
653
652
  error?: string;
@@ -671,12 +670,12 @@ declare class CardPaymentButton extends PayrailsElement {
671
670
  private readonly sdkConfig;
672
671
  private readonly execution;
673
672
  private readonly options;
674
- private readonly returnLinks;
673
+ private readonly returnInfo?;
675
674
  selectedInstrument: StoredPaymentInstrument | null;
676
675
  get bin(): string | undefined;
677
676
  private paymentExecutor;
678
677
  private cardForm;
679
- constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: CardPaymentButtonOptions, returnLinks: RedirectReturnLinks);
678
+ constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: CardPaymentButtonOptions, returnInfo?: ReturnInfo | undefined);
680
679
  setDisabled(isDisabled: boolean): void;
681
680
  setSavedCreditCard(savedCard: StoredPaymentInstrument<CardMetadata>): void;
682
681
  setSavedInstrument(savedInstrument: StoredPaymentInstrument): void;
@@ -712,8 +711,7 @@ interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
712
711
  buttonType?: google.payments.api.ButtonType;
713
712
  buttonSizeMode?: google.payments.api.ButtonSizeMode;
714
713
  buttonLocale?: string;
715
- storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
716
- };
714
+ } & StoreInstrumentElementOptions['styles'];
717
715
  }
718
716
  declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
719
717
  private sdkConfig;
@@ -764,8 +762,9 @@ declare class GenericRedirectButton extends PayrailsElement {
764
762
  private sdkConfig;
765
763
  private execution;
766
764
  protected options: GenericRedirectButtonOptions;
765
+ private readonly returnInfo?;
767
766
  private button;
768
- constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: GenericRedirectButtonOptions);
767
+ constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: GenericRedirectButtonOptions, returnInfo?: ReturnInfo | undefined);
769
768
  private paymentExecutor;
770
769
  private onClick;
771
770
  private configureButton;
@@ -785,8 +784,9 @@ interface GenericRedirectDropinOptions {
785
784
  declare class GenericRedirectDropin extends DropinElement {
786
785
  private sdkConfig;
787
786
  private execution;
787
+ private readonly returnInfo?;
788
788
  protected component: GenericRedirectButton;
789
- constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options?: GenericRedirectDropinOptions);
789
+ constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options?: GenericRedirectDropinOptions, returnInfo?: ReturnInfo | undefined);
790
790
  }
791
791
 
792
792
  interface GooglePayDropinOptions extends GooglePayButtonOptions {
@@ -810,8 +810,7 @@ interface PaypalButtonOptions extends StoreInstrumentElementOptions {
810
810
  label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment' | 'subscribe' | 'donate';
811
811
  shape?: 'rect' | 'pill';
812
812
  tagline?: boolean;
813
- storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
814
- };
813
+ } & StoreInstrumentElementOptions['styles'];
815
814
  }
816
815
  declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
817
816
  private sdkConfig;
@@ -853,7 +852,6 @@ declare class Dropin extends PayrailsElement {
853
852
  private readonly dropinConfig;
854
853
  private readonly execution;
855
854
  private readonly sdkConfig;
856
- private readonly returnLinks;
857
855
  private cardPaymentButton;
858
856
  private creditCard;
859
857
  private googlePay;
@@ -861,7 +859,7 @@ declare class Dropin extends PayrailsElement {
861
859
  private cardForm;
862
860
  private paypal;
863
861
  private genericRedirect;
864
- constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions, execution: WorkflowExecution, sdkConfig: SdkConfiguration, returnLinks: RedirectReturnLinks);
862
+ constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions, execution: WorkflowExecution, sdkConfig: SdkConfiguration);
865
863
  private createStoredInstrumentElement;
866
864
  private createGenericRedirectButton;
867
865
  private createCreditCardButton;
@@ -873,6 +871,7 @@ declare class Dropin extends PayrailsElement {
873
871
  private onAuthorizeSuccess;
874
872
  private onAuthorizeFailed;
875
873
  private isStoredInstrumentEnabled;
874
+ private applyStyles;
876
875
  }
877
876
  interface StorablePaymentMethodConfiguration extends StoreInstrumentElementOptions {
878
877
  showStoredInstruments?: boolean;
@@ -891,10 +890,7 @@ interface DropinOptions {
891
890
  clientDomain?: string;
892
891
  } & StorablePaymentMethodConfiguration;
893
892
  };
894
- returnInfo?: {
895
- success: string;
896
- error: string;
897
- };
893
+ returnInfo?: ReturnInfo;
898
894
  events?: PayrailsSDKEvents;
899
895
  translations?: {
900
896
  googlePayButton?: GooglePayDropinOptions['translations'];
@@ -908,6 +904,9 @@ interface DropinOptions {
908
904
  genericRedirect?: GenericRedirectDropinOptions['translations'];
909
905
  };
910
906
  styles?: {
907
+ container?: {
908
+ styles?: Partial<CSSStyleDeclaration>;
909
+ };
911
910
  element?: DropinElementStyles;
912
911
  googlePayButton?: GooglePayButtonOptions['styles'];
913
912
  paypalButton?: PaypalDropinOptions['styles'];
@@ -941,7 +940,7 @@ interface PayrailsClientOptions {
941
940
  events?: {
942
941
  onClientInitialized: (execution: WorkflowExecution) => void;
943
942
  };
944
- returnLinks?: RedirectReturnLinks;
943
+ returnInfo?: ReturnInfo;
945
944
  telemetry?: {
946
945
  enabled?: boolean;
947
946
  logLevel?: 'debug' | 'error';