@paydock/client-sdk 1.79.2 → 1.80.13-beta

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.
Files changed (119) hide show
  1. package/README.md +167 -25
  2. package/bundles/widget.umd.js +1103 -676
  3. package/bundles/widget.umd.min.js +1 -1
  4. package/lib/canvas-3ds/services/gpayments-service.d.ts +2 -3
  5. package/lib/canvas-3ds/services/gpayments-service.js +26 -13
  6. package/lib/canvas-3ds/services/gpayments-service.js.map +1 -1
  7. package/lib/canvas-3ds/services/standalone3ds-service.d.ts +1 -1
  8. package/lib/checkout-button/{afterpay-checkout-button.d.ts → afterpay/afterpay-checkout-button.d.ts} +2 -2
  9. package/lib/checkout-button/{afterpay-checkout-button.js → afterpay/afterpay-checkout-button.js} +4 -4
  10. package/lib/checkout-button/afterpay/afterpay-checkout-button.js.map +1 -0
  11. package/lib/checkout-button/{afterpay.runner.d.ts → afterpay/afterpay.runner.d.ts} +4 -5
  12. package/lib/checkout-button/{afterpay.runner.js → afterpay/afterpay.runner.js} +11 -10
  13. package/lib/checkout-button/afterpay/afterpay.runner.js.map +1 -0
  14. package/lib/checkout-button/checkout-button.d.ts +41 -50
  15. package/lib/checkout-button/checkout-button.interface.d.ts +48 -0
  16. package/lib/checkout-button/checkout-button.interface.js +45 -0
  17. package/lib/checkout-button/checkout-button.interface.js.map +1 -0
  18. package/lib/checkout-button/checkout-button.js +126 -127
  19. package/lib/checkout-button/checkout-button.js.map +1 -1
  20. package/lib/checkout-button/checkout-contextual-handler.d.ts +22 -0
  21. package/lib/checkout-button/checkout-contextual-handler.js +75 -0
  22. package/lib/checkout-button/checkout-contextual-handler.js.map +1 -0
  23. package/lib/checkout-button/index.d.ts +4 -4
  24. package/lib/checkout-button/index.js +4 -4
  25. package/lib/checkout-button/index.js.map +1 -1
  26. package/lib/checkout-button/{paypal-checkout-button.d.ts → paypal/paypal-checkout-button.d.ts} +1 -1
  27. package/lib/checkout-button/{paypal-checkout-button.js → paypal/paypal-checkout-button.js} +3 -3
  28. package/lib/checkout-button/paypal/paypal-checkout-button.js.map +1 -0
  29. package/lib/checkout-button/{paypal.runner.d.ts → paypal/paypal.runner.d.ts} +2 -3
  30. package/lib/checkout-button/paypal/paypal.runner.js +14 -0
  31. package/lib/checkout-button/paypal/paypal.runner.js.map +1 -0
  32. package/lib/checkout-button/runner/base.runner.d.ts +17 -0
  33. package/lib/checkout-button/runner/base.runner.js +13 -0
  34. package/lib/checkout-button/runner/base.runner.js.map +1 -0
  35. package/lib/checkout-button/runner/contextual.runner.d.ts +37 -0
  36. package/lib/checkout-button/runner/contextual.runner.js +40 -0
  37. package/lib/checkout-button/runner/contextual.runner.js.map +1 -0
  38. package/lib/checkout-button/runner/index.d.ts +8 -0
  39. package/lib/checkout-button/runner/index.js +11 -0
  40. package/lib/checkout-button/runner/index.js.map +1 -0
  41. package/lib/checkout-button/runner/popup.runner.d.ts +34 -0
  42. package/lib/checkout-button/{popup.runner.js → runner/popup.runner.js} +6 -7
  43. package/lib/checkout-button/runner/popup.runner.js.map +1 -0
  44. package/lib/checkout-button/runner/redirect.runner.d.ts +16 -0
  45. package/lib/checkout-button/runner/redirect.runner.js +15 -0
  46. package/lib/checkout-button/runner/redirect.runner.js.map +1 -0
  47. package/lib/checkout-button/{zipmoney-checkout-button.d.ts → zipmoney/zipmoney-checkout-button.d.ts} +20 -3
  48. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js +62 -0
  49. package/lib/checkout-button/zipmoney/zipmoney-checkout-button.js.map +1 -0
  50. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +38 -0
  51. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js +78 -0
  52. package/lib/checkout-button/zipmoney/zipmoney-contextual.runner.js.map +1 -0
  53. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.d.ts +25 -0
  54. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js +41 -0
  55. package/lib/checkout-button/zipmoney/zipmoney-redirect.runner.js.map +1 -0
  56. package/lib/checkout-button/zipmoney/zipmoney.config.d.ts +3 -0
  57. package/lib/checkout-button/zipmoney/zipmoney.config.js +4 -0
  58. package/lib/checkout-button/zipmoney/zipmoney.config.js.map +1 -0
  59. package/lib/checkout-button/zipmoney/zipmoney.runner.d.ts +9 -0
  60. package/lib/checkout-button/zipmoney/zipmoney.runner.js +23 -0
  61. package/lib/checkout-button/zipmoney/zipmoney.runner.js.map +1 -0
  62. package/lib/checkout-button/zipmoney/zipmoney.types.d.ts +11 -0
  63. package/lib/checkout-button/zipmoney/zipmoney.types.js +1 -0
  64. package/lib/checkout-button/zipmoney/zipmoney.types.js.map +1 -0
  65. package/lib/components/dispatcher.js +2 -2
  66. package/lib/components/dispatcher.js.map +1 -1
  67. package/lib/components/param.d.ts +9 -2
  68. package/lib/components/param.js +3 -0
  69. package/lib/components/param.js.map +1 -1
  70. package/lib/components/popup.js +1 -1
  71. package/lib/components/popup.js.map +1 -1
  72. package/lib/components/storage-dispatcher.d.ts +20 -0
  73. package/lib/components/storage-dispatcher.js +49 -0
  74. package/lib/components/storage-dispatcher.js.map +1 -0
  75. package/lib/external-checkout/builder.d.ts +2 -2
  76. package/lib/external-checkout/builder.js +3 -3
  77. package/lib/external-checkout/builder.js.map +1 -1
  78. package/lib/external-checkout/checker.d.ts +1 -1
  79. package/lib/external-checkout/checker.js +2 -2
  80. package/lib/external-checkout/checker.js.map +1 -1
  81. package/lib/helper/event-emitter.d.ts +1 -1
  82. package/lib/helper/event-emitter.js.map +1 -1
  83. package/lib/wallet-buttons/afterpay.wallet-service.d.ts +28 -0
  84. package/lib/wallet-buttons/afterpay.wallet-service.js +137 -0
  85. package/lib/wallet-buttons/afterpay.wallet-service.js.map +1 -0
  86. package/lib/wallet-buttons/interfaces.d.ts +16 -1
  87. package/lib/wallet-buttons/wallet-buttons.d.ts +8 -5
  88. package/lib/wallet-buttons/wallet-buttons.js +12 -5
  89. package/lib/wallet-buttons/wallet-buttons.js.map +1 -1
  90. package/package.json +3 -2
  91. package/slate.md +31 -1
  92. package/vendors/zipmoney.d.ts +11 -4
  93. package/lib/checkout-button/afterpay-checkout-button.js.map +0 -1
  94. package/lib/checkout-button/afterpay.runner.js.map +0 -1
  95. package/lib/checkout-button/paypal-checkout-button.js.map +0 -1
  96. package/lib/checkout-button/paypal.runner.js +0 -13
  97. package/lib/checkout-button/paypal.runner.js.map +0 -1
  98. package/lib/checkout-button/popup.runner.d.ts +0 -19
  99. package/lib/checkout-button/popup.runner.js.map +0 -1
  100. package/lib/checkout-button/runner.d.ts +0 -43
  101. package/lib/checkout-button/runner.js +0 -44
  102. package/lib/checkout-button/runner.js.map +0 -1
  103. package/lib/checkout-button/zipmoney-checkout-button.js +0 -36
  104. package/lib/checkout-button/zipmoney-checkout-button.js.map +0 -1
  105. package/lib/checkout-button/zipmoney.runner.d.ts +0 -25
  106. package/lib/checkout-button/zipmoney.runner.js +0 -94
  107. package/lib/checkout-button/zipmoney.runner.js.map +0 -1
  108. package/lib/gateway/index.d.ts +0 -6
  109. package/lib/gateway/index.js +0 -7
  110. package/lib/gateway/index.js.map +0 -1
  111. package/lib/gateway/info.d.ts +0 -17
  112. package/lib/gateway/info.js +0 -27
  113. package/lib/gateway/info.js.map +0 -1
  114. package/lib/widget/external-checkout.d.ts +0 -0
  115. package/lib/widget/external-checkout.js +0 -1
  116. package/lib/widget/external-checkout.js.map +0 -1
  117. package/lib/widget/payment-source-token.d.ts +0 -0
  118. package/lib/widget/payment-source-token.js +0 -1
  119. package/lib/widget/payment-source-token.js.map +0 -1
package/slate.md CHANGED
@@ -1055,7 +1055,7 @@ This example shows how you can use a lot of other methods to settings your form
1055
1055
  You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#wallet-buttons-simple-example)
1056
1056
 
1057
1057
  Wallet Buttons allow you to easily integrate different E-Wallets into your checkout.
1058
- Currently supports ApplePay, Google Pay and Apple Pay via Stripe, Flypay checkout and Paypal Smart Buttons Checkout.
1058
+ Currently supports ApplePay, Google Pay, Google Pay and Apple Pay via Stripe, Flypay checkout, Paypal Smart Buttons Checkout and Afterpay.
1059
1059
 
1060
1060
  If available in your client environment, you will display a simple button that upon clicking it the user will follow the standard flow for the appropriate Wallet. If not available an event will be raised and no button will be displayed.
1061
1061
 
@@ -1121,6 +1121,33 @@ var button = new WalletButtons(
1121
1121
  );
1122
1122
  button.load();
1123
1123
  ```
1124
+
1125
+ For Afterpay wallet, the country code is required:
1126
+ ```javascript
1127
+ let button = new paydock.WalletButtons(
1128
+ "#widget",
1129
+ token,
1130
+ {
1131
+ country: "AU",
1132
+ }
1133
+ );
1134
+ button.load();
1135
+ ```
1136
+
1137
+ ```javascript--es2015
1138
+ // ES2015 | TypeScript
1139
+ import { WalletButtons } from '@paydock/client-sdk';
1140
+
1141
+ var button = new WalletButtons(
1142
+ '#widget',
1143
+ token,
1144
+ {
1145
+ country: 'AU',
1146
+ }
1147
+ );
1148
+ button.load();
1149
+ ```
1150
+
1124
1151
  ### Setting environment
1125
1152
 
1126
1153
  Current method can change environment. By default environment = sandbox.
@@ -1226,6 +1253,8 @@ button.onUpdate((data) => {
1226
1253
  After the payment is completed, the onPaymentSuccessful(data) will be called if the payment was successful. If the payment was not successful, the function onPaymentError(data) will be called. If fraud check is active for the gateway, a fraud body was sent in the wallet charge initialize call and the fraud service left the charge in review, then the onPaymentInReview(data) will be called.
1227
1254
  All three callbacks return relevant data according to each one of the scenarios.
1228
1255
 
1256
+ Note that these callbacks will not trigger for Afterpay wallet since the payment completion for it is done via Redirect method, and therefore this SDK won't be loaded once the payment is completed at checkout.
1257
+
1229
1258
  ```javascript
1230
1259
  button.onPaymentSuccessful((data) => console.log("The payment was successful"));
1231
1260
  ```
@@ -1483,6 +1512,7 @@ Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest`
1483
1512
  </script>
1484
1513
  </html>
1485
1514
  ```
1515
+
1486
1516
  ## Secure Remote Commerce
1487
1517
  You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#SRC).
1488
1518
 
@@ -1,11 +1,18 @@
1
-
2
1
  declare module Zip {
2
+ export const enum ZIPMONEY_STATE {
3
+ APPROVED = 'approved',
4
+ DECLINED = 'declined',
5
+ CANCELLED = 'cancelled',
6
+ REFERRED = 'referred',
7
+ }
8
+
3
9
  export const Checkout: {
4
10
  init(t: {
5
11
  checkoutUri: string,
6
12
  redirectUri?: string,
7
- onComplete: (args: {state: string, checkoutId: string}) => void
8
- onError: (args: {state: string}) => void
13
+ onComplete?: (args: { state: ZIPMONEY_STATE, checkoutId: string }) => void,
14
+ onError?: (args: { state: ZIPMONEY_STATE }) => void,
15
+ redirect?: boolean;
9
16
  }): void
10
17
  }
11
- }
18
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"afterpay-checkout-button.js","sourceRoot":"","sources":["../../checkout-button/afterpay-checkout-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAG1C;;;;;;;;;;;;IAYI;AACJ,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IAGtD,YAAY,QAAgB,EAAY,WAAmB,EAAY,YAAoB,SAAS;QAChG,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;QAD1B,gBAAW,GAAX,WAAW,CAAQ;QAAY,cAAS,GAAT,SAAS,CAAoB;QAF1F,YAAO,GAAG,KAAK,CAAC;IAI1B,CAAC;IAED;;;;;;;;;;OAUG;IACI,mCAAmC,CAAC,MAAe;QACtD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QACnD,IAAI,MAAM,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,OAAO,IAAI,GAAG;Y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"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAMjD;;;;;;;;;;;;IAYI;AACJ,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAEpD,YAAY,QAAgB,EAAY,SAAiB,EAAY,YAAoB,SAAS;QAC9F,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;QADtB,cAAS,GAAT,SAAS,CAAQ;QAAY,cAAS,GAAT,SAAS,CAAoB;IAElG,CAAC;CACJ"}
@@ -1,13 +0,0 @@
1
- import { PopupRunner } from "./popup.runner";
2
- import { Url } from "../helper/url";
3
- const REDIRECT_URI_SUCCESS = '/checkout/success';
4
- const REDIRECT_URI_ERROR = '/checkout/error';
5
- export class PaypalRunner extends PopupRunner {
6
- getSuccessRedirectUri() {
7
- return this.widgetEnv.getConf().url + Url.extendSearchParams(REDIRECT_URI_SUCCESS, 'merchant', encodeURIComponent(window.location.href));
8
- }
9
- getErrorRedirectUri() {
10
- return this.widgetEnv.getConf().url + Url.extendSearchParams(REDIRECT_URI_ERROR, 'merchant', encodeURIComponent(window.location.href));
11
- }
12
- }
13
- //# sourceMappingURL=../../src/lib/checkout-button/paypal.runner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paypal.runner.js","sourceRoot":"","sources":["../../checkout-button/paypal.runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAElC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACjD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAClC,qBAAqB;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,kBAAkB,CAAC,oBAAoB,EAAE,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7I,CAAC;IAEM,mBAAmB;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3I,CAAC;CACJ"}
@@ -1,19 +0,0 @@
1
- import { Runner } from "./runner";
2
- import { ICheckout } from "../external-checkout/builder";
3
- import { Dispatcher } from "../components/dispatcher";
4
- import { Popup } from "../components/popup";
5
- export declare abstract class PopupRunner extends Runner {
6
- protected publicKey: string;
7
- protected dispatcher: Dispatcher;
8
- protected popup: Popup;
9
- protected checkout: ICheckout;
10
- constructor(publicKey: string);
11
- run(): void;
12
- isRunning(): boolean;
13
- next(checkoutData: ICheckout): void;
14
- continue(): void;
15
- stop(): void;
16
- onStop(cb: () => void): void;
17
- onCheckout(event: string, cb: (checkout: ICheckout) => void): void;
18
- setEnv(env: string, alias?: string): void;
19
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"popup.runner.js","sourceRoot":"","sources":["../../checkout-button/popup.runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAC,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAkB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAC,KAAK,EAAC,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAEsC,CAAC;AAEjF,MAAM,OAAgB,WAAY,SAAQ,MAAM;IAM5C,YAA6B,SAAiB;QAC1C,KAAK,EAAE,CAAC;QADiB,cAAS,GAAT,SAAS,CAAQ;QAFpC,aAAQ,GAAc,IAAI,CAAC;QAIjC,IAAI,CAAC,UAAU,GAAG,IAAI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AAK,EAAE,CAAC,IAAI,EAAE,EAAE;YACxD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAC,YAAY,EAAE;gBACnE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBACxB,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACrB;iBAAM,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE;gBAClC,IAAI,IAAI,GAAkB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;gBAChF,IAAI,CAAC,IAAI;oBACL,OAAO;gBAEX,IAAI,QAAQ,GAAc,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC3C,IAAI,QAAQ,IAAI,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAC,YAAY,EAAE;oBACzD,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;oBACzD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBACzB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;oBACxB,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACrB;aACJ;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC1B,CAAC;CACJ"}
@@ -1,43 +0,0 @@
1
- import { ICheckout } from '../external-checkout';
2
- import { Background } from "../components/background";
3
- import { Env } from '../configs/env/env';
4
- export declare const EVENT: {
5
- SUCCESS: string;
6
- DECLINED: string;
7
- CLOSE: string;
8
- REFERRED: string;
9
- ERROR: string;
10
- };
11
- export declare type AdditionalParams = Record<string, string | number | boolean>;
12
- export interface IRunner {
13
- run(): void;
14
- isRunning(): boolean;
15
- continue(): void;
16
- next(checkoutData: ICheckout, params?: AdditionalParams): void;
17
- error(error: string, code: string, cb: (close: boolean) => void): void;
18
- stop(): void;
19
- onStop(cb: () => void): void;
20
- onCheckout(event: string, cb: (checkout: ICheckout) => void): void;
21
- setCustomRedirectUri(uri: string): void;
22
- setBackgroundTitle(text: string): void;
23
- setBackgroundDescription(text: string): void;
24
- getSuccessRedirectUri(): string;
25
- getErrorRedirectUri(): string;
26
- setEnv(env: string, alias?: string): void;
27
- turnOffBackdrop(): void;
28
- }
29
- export declare abstract class Runner {
30
- protected background: Background;
31
- protected widgetEnv: Env;
32
- protected customRedirectUti: string;
33
- constructor();
34
- continue(): void;
35
- next(checkoutData: ICheckout, params?: AdditionalParams): void;
36
- stop(): void;
37
- error(error: string, code: string, callback: any): void;
38
- setCustomRedirectUri(uri: string): void;
39
- setEnv(env: string, alias?: string): void;
40
- setBackgroundTitle(text: string): void;
41
- setBackgroundDescription(text: string): void;
42
- turnOffBackdrop(): void;
43
- }
@@ -1,44 +0,0 @@
1
- import { Background, TRIGGER as BACKGROUND_TRIGGER } from "../components/background";
2
- import { Env, WIDGET_URL } from '../configs/env/env';
3
- export const EVENT = {
4
- SUCCESS: 'success',
5
- DECLINED: 'declined',
6
- CLOSE: 'close',
7
- REFERRED: 'referred',
8
- ERROR: 'error',
9
- };
10
- export class Runner {
11
- constructor() {
12
- this.customRedirectUti = null;
13
- this.background = new Background();
14
- this.background.onTrigger(BACKGROUND_TRIGGER.FOCUS, () => this.continue());
15
- this.background.onTrigger(BACKGROUND_TRIGGER.CLOSE, () => this.stop());
16
- this.widgetEnv = new Env(WIDGET_URL);
17
- }
18
- continue() {
19
- }
20
- next(checkoutData, params) {
21
- }
22
- stop() {
23
- }
24
- error(error, code, callback) {
25
- callback(true);
26
- }
27
- setCustomRedirectUri(uri) {
28
- this.customRedirectUti = uri;
29
- }
30
- setEnv(env, alias) {
31
- this.widgetEnv.setEnv(env, alias);
32
- }
33
- setBackgroundTitle(text) {
34
- this.background.setBackdropTitle(text);
35
- }
36
- setBackgroundDescription(text) {
37
- this.background.setBackdropDescription(text);
38
- }
39
- turnOffBackdrop() {
40
- this.background.turnOffControl();
41
- this.background.turnOffLoader();
42
- }
43
- }
44
- //# sourceMappingURL=../../src/lib/checkout-button/runner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../checkout-button/runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAE,OAAO,IAAI,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAO,GAAG,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,OAAO,EAAG,SAAS;IACnB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;CACjB,CAAC;AAqCF,MAAM,OAAgB,MAAM;IAMxB;QAFU,sBAAiB,GAAW,IAAI,CAAC;QAGvC,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAEvE,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAEM,QAAQ;IAEf,CAAC;IAEM,IAAI,CAAC,YAAuB,EAAE,MAAyB;IAE9D,CAAC;IAEM,IAAI;IAEX,CAAC;IAEM,KAAK,CAAC,KAAa,EAAE,IAAY,EAAE,QAAQ;QAC9C,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAEM,oBAAoB,CAAC,GAAW;QACnC,IAAI,CAAC,iBAAiB,GAAG,GAAG,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IAEM,kBAAkB,CAAC,IAAY;QAClC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEM,wBAAwB,CAAC,IAAY;QACxC,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,eAAe;QAClB,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;IACpC,CAAC;CACJ"}
@@ -1,36 +0,0 @@
1
- import { GATEWAY_TYPE } from "../gateway/index";
2
- import { CheckoutButton } from "./checkout-button";
3
- /**
4
- * Class ZipmoneyCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
5
- *
6
- * @extends CheckoutButton
7
- *
8
- * @constructor
9
- *
10
- * @param {string} selector - Selector of html element.
11
- * @param {string} publicKey - PayDock users public key
12
- * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
13
- * @example
14
- * var widget = new ZipmoneyCheckoutButton('#button', 'publicKey','gatewayId');
15
- **/
16
- export class ZipmoneyCheckoutButton extends CheckoutButton {
17
- constructor(selector, publicKey, gatewayId = 'default') {
18
- super(selector, publicKey, gatewayId, GATEWAY_TYPE.ZIPMONEY);
19
- this.publicKey = publicKey;
20
- this.gatewayId = gatewayId;
21
- }
22
- /**
23
- * Method for setting suspended redirect uri. Redirect after referred checkout
24
- *
25
- * The URI is used for a redirect after the checkout is complete.
26
- * This can be provided, even if using in-context checkout (sdk). By default, the standard styled page will be used.
27
- * If using in-context (sdk) we will not automatically redirect to this URI.
28
- *
29
-
30
- * @param {uri} string - uri for redirect (by default)
31
- */
32
- setSuspendedRedirectUri(uri) {
33
- super.setSuspendedRedirectUri(uri);
34
- }
35
- }
36
- //# sourceMappingURL=../../src/lib/checkout-button/zipmoney-checkout-button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zipmoney-checkout-button.js","sourceRoot":"","sources":["../../checkout-button/zipmoney-checkout-button.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAMjD;;;;;;;;;;;;IAYI;AACJ,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IAEtD,YAAY,QAAgB,EAAY,SAAiB,EAAY,YAAoB,SAAS;QAC9F,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;QADxB,cAAS,GAAT,SAAS,CAAQ;QAAY,cAAS,GAAT,SAAS,CAAoB;IAElG,CAAC;IAED;;;;;;;;;OASG;IACI,uBAAuB,CAAC,GAAW;QACtC,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;CAEJ"}
@@ -1,25 +0,0 @@
1
- import "../../vendors/zipmoney";
2
- import { IRunner, Runner } from "./runner";
3
- import { ICheckout } from "../external-checkout/builder";
4
- import { Env } from '../configs/env/env';
5
- import { EventEmitter } from "../helper/event-emitter";
6
- export declare class ZipmoneyRunner extends Runner implements IRunner {
7
- protected publicKey: string;
8
- protected checkout: ICheckout;
9
- protected runs: boolean;
10
- protected echoEnv: Env;
11
- protected eventEmitter: EventEmitter;
12
- constructor(publicKey: string);
13
- run(): void;
14
- isRunning(): boolean;
15
- next(checkoutData: ICheckout): void;
16
- stop(): void;
17
- onStop(cb: () => void): void;
18
- onCheckout(event: string, cb: (checkout: ICheckout) => void): void;
19
- protected eventHandler(args: {
20
- state: string;
21
- }): void;
22
- getSuccessRedirectUri(): string;
23
- getErrorRedirectUri(): string;
24
- setEnv(env: string, alias?: string): void;
25
- }
@@ -1,94 +0,0 @@
1
- import { AccessToken } from './../helper/access-token';
2
- import "../../vendors/zipmoney";
3
- import { EVENT, Runner } from "./runner";
4
- import { API_URL, Env } from '../configs/env/env';
5
- import { Url } from "../helper/url";
6
- import { EventEmitter } from "../helper/event-emitter";
7
- const ECHO_LINK = '/v1/echo';
8
- const REDIRECT_URL_SUSPENDED = '/checkout/zipmoney';
9
- export class ZipmoneyRunner extends Runner {
10
- constructor(publicKey) {
11
- super();
12
- this.publicKey = publicKey;
13
- this.checkout = null;
14
- this.runs = false;
15
- this.eventEmitter = new EventEmitter();
16
- this.echoEnv = new Env(API_URL);
17
- }
18
- run() {
19
- this.runs = true;
20
- this.background.initLoader();
21
- }
22
- isRunning() {
23
- return this.runs;
24
- }
25
- next(checkoutData) {
26
- this.background.clear();
27
- this.checkout = checkoutData;
28
- let checkoutLink = String(ECHO_LINK);
29
- checkoutLink = Url.extendSearchParams(checkoutLink, AccessToken.validateJWT(this.publicKey) ? 'access_token' : 'public_key', this.publicKey);
30
- checkoutLink = Url.extendSearchParams(checkoutLink, 'json_body', encodeURIComponent(JSON.stringify({
31
- redirect_uri: this.checkout.link,
32
- })));
33
- Zip.Checkout.init({
34
- checkoutUri: this.echoEnv.getConf().url + checkoutLink,
35
- onComplete: (args) => this.eventHandler(args),
36
- onError: (args) => this.eventHandler(args),
37
- });
38
- }
39
- stop() {
40
- super.stop();
41
- this.runs = false;
42
- const element = document.querySelector('.zipmoney-overlay');
43
- if (element)
44
- element.remove();
45
- this.eventEmitter.emit(EVENT.CLOSE, {});
46
- }
47
- onStop(cb) {
48
- this.eventEmitter.subscribe(EVENT.CLOSE, () => {
49
- this.background.clear();
50
- cb();
51
- });
52
- }
53
- onCheckout(event, cb) {
54
- this.eventEmitter.subscribe(event, () => {
55
- cb(this.checkout);
56
- });
57
- }
58
- eventHandler(args) {
59
- this.runs = false;
60
- switch (args.state) {
61
- case 'approved':
62
- this.eventEmitter.emit(EVENT.CLOSE, {});
63
- this.eventEmitter.emit(EVENT.SUCCESS, {});
64
- break;
65
- case 'declined':
66
- this.eventEmitter.emit(EVENT.CLOSE, {});
67
- this.eventEmitter.emit(EVENT.DECLINED, {});
68
- break;
69
- case 'cancelled':
70
- this.eventEmitter.emit(EVENT.CLOSE, {});
71
- break;
72
- case 'referred':
73
- this.eventEmitter.emit(EVENT.CLOSE, {});
74
- this.eventEmitter.emit(EVENT.REFERRED, {});
75
- break;
76
- default:
77
- console.warn('Unknown gateway status');
78
- break;
79
- }
80
- }
81
- getSuccessRedirectUri() {
82
- return (this.customRedirectUti)
83
- ? this.customRedirectUti
84
- : this.widgetEnv.getConf().url + String(REDIRECT_URL_SUSPENDED);
85
- }
86
- getErrorRedirectUri() {
87
- return this.getSuccessRedirectUri();
88
- }
89
- setEnv(env, alias) {
90
- super.setEnv(env, alias);
91
- this.echoEnv.setEnv(env, alias);
92
- }
93
- }
94
- //# sourceMappingURL=../../src/lib/checkout-button/zipmoney.runner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zipmoney.runner.js","sourceRoot":"","sources":["../../checkout-button/zipmoney.runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,wBAAwB,CAAA;AAC/B,OAAO,EAAC,KAAK,EAAW,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAO,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAGrD,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAEpD,MAAM,OA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,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAC3C,MAAM;YAEV,KAAK,WAAW;gBACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACxC,MAAM;YAEV,KAAK,UAAU;gBACX,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACxC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAC3C,MAAM;YAEV;gBACI,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;gBACtC,MAAM;SAEb;IACL,CAAC;IAEM,qBAAqB;QACxB,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC;YAC3B,CAAC,CAAC,IAAI,CAAC,iBAAiB;YACxB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACxE,CAAC;IAEM,mBAAmB;QACtB,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACxC,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ"}
@@ -1,6 +0,0 @@
1
- export { IGatewayInfo, Info as GatewayInfo } from "./info";
2
- export declare const GATEWAY_TYPE: {
3
- ZIPMONEY: string;
4
- PAYPAL: string;
5
- AFTERPAY: string;
6
- };
@@ -1,7 +0,0 @@
1
- export { Info as GatewayInfo } from "./info";
2
- export const GATEWAY_TYPE = {
3
- ZIPMONEY: 'Zipmoney',
4
- PAYPAL: 'PaypalClassic',
5
- AFTERPAY: 'Afterpay',
6
- };
7
- //# sourceMappingURL=../../src/lib/gateway/index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../gateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,IAAI,WAAW,EAAC,MAAM,QAAQ,CAAC;AAE1D,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,eAAe;IACvB,QAAQ,EAAE,UAAU;CACvB,CAAC"}
@@ -1,17 +0,0 @@
1
- import { HttpCore } from "../components/http-core";
2
- export interface IGatewayInfo {
3
- id: string;
4
- created_at: string;
5
- name: string;
6
- type: string;
7
- updated_at: string;
8
- default: boolean;
9
- mode: string;
10
- }
11
- export declare class Info extends HttpCore {
12
- protected gatewayID: string;
13
- constructor(gatewayID: string);
14
- static sendRequest(gatewayID: string, publicKey: string, env: string, cb: (gatewayInfo: IGatewayInfo) => void, errorCb?: (error: any) => void): void;
15
- protected getLink(): string;
16
- sendRequest(publicKey: string, cb: (gatewayInfo: IGatewayInfo) => void, errorCb?: (error: any) => void): void;
17
- }
@@ -1,27 +0,0 @@
1
- import { HttpCore } from "../components/http-core";
2
- const EXTERNAL_CHECKOUT_LINK = '/v1/gateways/:gateway_id';
3
- export class Info extends HttpCore {
4
- constructor(gatewayID) {
5
- super();
6
- this.gatewayID = gatewayID;
7
- }
8
- static sendRequest(gatewayID, publicKey, env, cb, errorCb = (err) => { }) {
9
- let info = new this(gatewayID);
10
- info.setEnv(env);
11
- info.sendRequest(publicKey, cb, errorCb);
12
- }
13
- getLink() {
14
- return String(EXTERNAL_CHECKOUT_LINK).replace(':gateway_id', this.gatewayID);
15
- }
16
- sendRequest(publicKey, cb, errorCb = (err) => { }) {
17
- this.get(publicKey, (data, status) => {
18
- cb(data);
19
- }, (err, status) => {
20
- if (typeof err.message === "undefined")
21
- errorCb(`${status}: unknown error`);
22
- else
23
- errorCb(err.message);
24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;IACX,CAAC;CACJ"}
File without changes
@@ -1 +0,0 @@
1
- //# sourceMappingURL=../../src/lib/widget/external-checkout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"external-checkout.js","sourceRoot":"","sources":["../../widget/external-checkout.ts"],"names":[],"mappings":""}
File without changes
@@ -1 +0,0 @@
1
- //# sourceMappingURL=../../src/lib/widget/payment-source-token.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-source-token.js","sourceRoot":"","sources":["../../widget/payment-source-token.ts"],"names":[],"mappings":""}