@paydock/client-sdk 1.11.13-beta → 1.77.3
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/README.md +760 -1018
- package/bundles/widget.umd.js +43 -44
- package/bundles/widget.umd.min.js +1 -1
- package/lib/api/api-base.d.ts +1 -1
- package/lib/api/api-base.js +2 -24
- package/lib/api/api-base.js.map +1 -1
- package/lib/canvas-3ds/services/standalone3ds-service.js +2 -2
- package/lib/canvas-3ds/services/standalone3ds-service.js.map +1 -1
- package/lib/checkout-button/checkout-button.js +1 -1
- package/lib/checkout-button/checkout-button.js.map +1 -1
- package/lib/checkout-button/index.d.ts +3 -1
- package/lib/checkout-button/index.js +3 -1
- package/lib/checkout-button/index.js.map +1 -1
- package/lib/checkout-button/runner.d.ts +1 -1
- package/lib/checkout-button/runner.js +2 -27
- package/lib/checkout-button/runner.js.map +1 -1
- package/lib/checkout-button/zipmoney.runner.d.ts +1 -1
- package/lib/checkout-button/zipmoney.runner.js +2 -27
- package/lib/checkout-button/zipmoney.runner.js.map +1 -1
- package/lib/components/dispatcher.d.ts +1 -1
- package/lib/components/dispatcher.js +2 -27
- package/lib/components/dispatcher.js.map +1 -1
- package/lib/components/http-core.js +2 -27
- package/lib/components/http-core.js.map +1 -1
- package/lib/components/link.d.ts +1 -1
- package/lib/components/link.js +2 -27
- package/lib/components/link.js.map +1 -1
- package/lib/components/param.d.ts +3 -1
- package/lib/components/param.js.map +1 -1
- package/lib/components/popup.js +1 -1
- package/lib/components/popup.js.map +1 -1
- package/lib/{components → configs/env}/env.d.ts +9 -0
- package/lib/configs/env/env.js +129 -0
- package/lib/configs/env/env.js.map +1 -0
- package/lib/payment-source-widget/payment-source-widget.d.ts +1 -1
- package/lib/payment-source-widget/payment-source-widget.js +1 -1
- package/lib/wallet-buttons/apple.wallet-service.js +2 -13
- package/lib/wallet-buttons/apple.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/google.wallet-service.js +7 -5
- package/lib/wallet-buttons/google.wallet-service.js.map +1 -1
- package/lib/wallet-buttons/wallet-service.js +2 -2
- package/lib/wallet-buttons/wallet-service.js.map +1 -1
- package/lib/widget/configuration.d.ts +3 -1
- package/lib/widget/configuration.js +5 -28
- package/lib/widget/configuration.js.map +1 -1
- package/lib/widget/html-multi-widget.d.ts +2 -1
- package/lib/widget/html-multi-widget.js +2 -1
- package/lib/widget/html-multi-widget.js.map +1 -1
- package/lib/widget/html-widget.d.ts +3 -1
- package/lib/widget/html-widget.js +3 -1
- package/lib/widget/html-widget.js.map +1 -1
- package/lib/widget/index.d.ts +0 -7
- package/lib/widget/index.js +0 -7
- package/lib/widget/index.js.map +1 -1
- package/lib/widget/meta.d.ts +7 -0
- package/lib/widget/meta.js +8 -0
- package/lib/widget/meta.js.map +1 -0
- package/package.json +3 -1
- package/slate.md +17 -16
- package/lib/components/env.js +0 -77
- package/lib/components/env.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../widget/meta.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paydock/client-sdk",
|
|
3
3
|
"description": "Paydock client sdk",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.77.3",
|
|
5
5
|
"homepage": "https://paydock.com",
|
|
6
6
|
"author": {},
|
|
7
7
|
"bugs": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"grunt-template-render": "0.0.1",
|
|
46
46
|
"grunt-ts": "^5.5.1",
|
|
47
47
|
"grunt-typedoc": "^0.2.4",
|
|
48
|
+
"highlight.js": "^11.5.1",
|
|
48
49
|
"ieee754": "^1.1.8",
|
|
49
50
|
"include-all": "^0.1.6",
|
|
50
51
|
"jasmine-ajax": "^3.3.1",
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
"karma-phantomjs-launcher": "^1.0.4",
|
|
64
65
|
"karma-typescript": "^2.1.7",
|
|
65
66
|
"lodash": "^4.17.4",
|
|
67
|
+
"marked": "^4.0.14",
|
|
66
68
|
"phantomjs-prebuilt": "2.1.15",
|
|
67
69
|
"process": "^0.11.9",
|
|
68
70
|
"rollup": "^1.32.1",
|
package/slate.md
CHANGED
|
@@ -375,7 +375,7 @@ As a result, you will be able to receive a one-time token for charges, subscript
|
|
|
375
375
|
|
|
376
376
|
|
|
377
377
|
## Checkout button simple example
|
|
378
|
-
|
|
378
|
+
|
|
379
379
|
### Container
|
|
380
380
|
|
|
381
381
|
```html
|
|
@@ -395,14 +395,14 @@ var button = new paydock.PaypalCheckoutButton('#button', 'publicKey', 'gatewayId
|
|
|
395
395
|
```javascript--es2015
|
|
396
396
|
// ES2015 | TypeScript
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
|
|
399
399
|
var button = new PaypalCheckoutButton('#button', 'publicKey');
|
|
400
400
|
```
|
|
401
401
|
|
|
402
402
|
Then write only need 1 line of code in js to initialize widget
|
|
403
403
|
|
|
404
404
|
|
|
405
|
-
### Full example
|
|
405
|
+
### Full example
|
|
406
406
|
|
|
407
407
|
```html
|
|
408
408
|
<!DOCTYPE html>
|
|
@@ -443,7 +443,7 @@ button.on('finish', function (data) { // Add handler of event
|
|
|
443
443
|
|
|
444
444
|
This example shows how you can use a lot of other methods to settings your button
|
|
445
445
|
|
|
446
|
-
### Full Paypal example
|
|
446
|
+
### Full Paypal example
|
|
447
447
|
|
|
448
448
|
```html
|
|
449
449
|
<!DOCTYPE html>
|
|
@@ -470,16 +470,16 @@ This example shows how you can use a lot of other methods to settings your butto
|
|
|
470
470
|
reference: '15',
|
|
471
471
|
first_name: 'Joshua',
|
|
472
472
|
last_name: 'Wood',
|
|
473
|
-
phone: '0231049872'});
|
|
474
|
-
|
|
475
|
-
button.on('finish', function (data) {
|
|
473
|
+
phone: '0231049872'});
|
|
474
|
+
|
|
475
|
+
button.on('finish', function (data) {
|
|
476
476
|
console.log('on:finish', data);
|
|
477
477
|
});
|
|
478
478
|
</script>
|
|
479
479
|
</body>
|
|
480
480
|
</html>
|
|
481
481
|
```
|
|
482
|
-
### Full ZipMoney example
|
|
482
|
+
### Full ZipMoney example
|
|
483
483
|
|
|
484
484
|
```html
|
|
485
485
|
<!DOCTYPE html>
|
|
@@ -509,6 +509,7 @@ This example shows how you can use a lot of other methods to settings your butto
|
|
|
509
509
|
"charge": {
|
|
510
510
|
"amount": "4",
|
|
511
511
|
"currency":"AUD",
|
|
512
|
+
"shipping_type": "delivery",
|
|
512
513
|
"shipping_address": {
|
|
513
514
|
"first_name": "Joshua",
|
|
514
515
|
"last_name": "Wood",
|
|
@@ -544,7 +545,7 @@ This example shows how you can use a lot of other methods to settings your butto
|
|
|
544
545
|
}
|
|
545
546
|
]
|
|
546
547
|
},
|
|
547
|
-
|
|
548
|
+
|
|
548
549
|
"statistics": {
|
|
549
550
|
"account_created": "2017-05-05",
|
|
550
551
|
"sales_total_number": "5",
|
|
@@ -555,9 +556,9 @@ This example shows how you can use a lot of other methods to settings your butto
|
|
|
555
556
|
"previous_chargeback": "true",
|
|
556
557
|
"currency": "AUD",
|
|
557
558
|
"last_login": "2017-06-01"
|
|
558
|
-
});
|
|
559
|
-
|
|
560
|
-
button.on('finish', function (data) {
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
button.on('finish', function (data) {
|
|
561
562
|
console.log('on:finish', data);
|
|
562
563
|
});
|
|
563
564
|
</script>
|
|
@@ -565,7 +566,7 @@ This example shows how you can use a lot of other methods to settings your butto
|
|
|
565
566
|
</html>
|
|
566
567
|
```
|
|
567
568
|
|
|
568
|
-
### Full Aftepay example
|
|
569
|
+
### Full Aftepay example
|
|
569
570
|
|
|
570
571
|
```html
|
|
571
572
|
<!DOCTYPE html>
|
|
@@ -584,7 +585,7 @@ This example shows how you can use a lot of other methods to settings your butto
|
|
|
584
585
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
|
|
585
586
|
<script>
|
|
586
587
|
var button = new paydock.AfterpayCheckoutButton('#button', 'publicKey', 'gatewayId');
|
|
587
|
-
|
|
588
|
+
|
|
588
589
|
button.onFinishInsert('input[name="pst"]', 'payment_source_token');
|
|
589
590
|
button.showEnhancedTrackingProtectionPopup(true);
|
|
590
591
|
button.setMeta({
|
|
@@ -602,8 +603,8 @@ This example shows how you can use a lot of other methods to settings your butto
|
|
|
602
603
|
address_country: 'Australia',
|
|
603
604
|
phone: '0412345678',
|
|
604
605
|
});
|
|
605
|
-
|
|
606
|
-
button.on('finish', function (data) {
|
|
606
|
+
|
|
607
|
+
button.on('finish', function (data) {
|
|
607
608
|
console.log('on:finish', data);
|
|
608
609
|
});
|
|
609
610
|
</script>
|
package/lib/components/env.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
export const ENV = {
|
|
2
|
-
SANDBOX: 'sandbox',
|
|
3
|
-
SANDBOX_KOVENA: 'sandbox-kovena',
|
|
4
|
-
SANDBOX_DEMO: 'sandbox-demo',
|
|
5
|
-
SANDBOX_DEMO_KOVENA: 'sandbox-demo-kovena',
|
|
6
|
-
PROD: 'production',
|
|
7
|
-
STAGING: 'staging',
|
|
8
|
-
STAGING_1: 'staging_1',
|
|
9
|
-
STAGING_2: 'staging_2',
|
|
10
|
-
STAGING_3: 'staging_3',
|
|
11
|
-
STAGING_4: 'staging_4',
|
|
12
|
-
STAGING_5: 'staging_5',
|
|
13
|
-
STAGING_6: 'staging_6',
|
|
14
|
-
STAGING_7: 'staging_7',
|
|
15
|
-
STAGING_8: 'staging_8',
|
|
16
|
-
STAGING_9: 'staging_9',
|
|
17
|
-
STAGING_10: 'staging_10',
|
|
18
|
-
STAGING_11: 'staging_11',
|
|
19
|
-
STAGING_12: 'staging_12',
|
|
20
|
-
STAGING_13: 'staging_13',
|
|
21
|
-
STAGING_14: 'staging_14',
|
|
22
|
-
STAGING_15: 'staging_15',
|
|
23
|
-
STAGING_CBA: 'staging_cba',
|
|
24
|
-
SANDBOX_CBA: 'sandbox_cba',
|
|
25
|
-
PROD_CBA: 'production_cba',
|
|
26
|
-
};
|
|
27
|
-
const KOVENA_ENV = [ENV.SANDBOX_KOVENA, ENV.SANDBOX_DEMO_KOVENA];
|
|
28
|
-
const REGEX_ALIAS = '^([a-zA-Z0-9](?:(?:[a-zA-Z0-9-.]*(?!-)\\.(?![-.]))*[a-zA-Z0-9]+)?)$';
|
|
29
|
-
export const DEFAULT_ENV = ENV.SANDBOX;
|
|
30
|
-
export const DEFAULT_ALIAS = {
|
|
31
|
-
PAYDOCK: 'paydock.com',
|
|
32
|
-
KOVENA: 'kovena.com',
|
|
33
|
-
};
|
|
34
|
-
export class Env {
|
|
35
|
-
constructor(configs, defaultEnv = DEFAULT_ENV) {
|
|
36
|
-
this.configs = configs;
|
|
37
|
-
this.setEnv(defaultEnv);
|
|
38
|
-
}
|
|
39
|
-
setEnv(env, alias) {
|
|
40
|
-
if (!this.isValidMode(this.configs, env))
|
|
41
|
-
throw new Error('unknown env: ' + env);
|
|
42
|
-
this.env = env;
|
|
43
|
-
if (alias && !alias.match(REGEX_ALIAS))
|
|
44
|
-
throw new Error('invalid: ' + alias);
|
|
45
|
-
if (alias)
|
|
46
|
-
this.alias = alias;
|
|
47
|
-
else if (KOVENA_ENV.indexOf(this.env) !== -1)
|
|
48
|
-
this.alias = DEFAULT_ALIAS.KOVENA;
|
|
49
|
-
else
|
|
50
|
-
this.alias = DEFAULT_ALIAS.PAYDOCK;
|
|
51
|
-
}
|
|
52
|
-
getEnv() {
|
|
53
|
-
return this.env;
|
|
54
|
-
}
|
|
55
|
-
getConf() {
|
|
56
|
-
for (let index in this.configs) {
|
|
57
|
-
if (!this.configs.hasOwnProperty(index))
|
|
58
|
-
continue;
|
|
59
|
-
if (this.configs[index].env === this.getEnv())
|
|
60
|
-
return {
|
|
61
|
-
url: (this.configs[index].url.indexOf('localhost') !== -1) ? this.configs[index].url : this.configs[index].url + this.alias,
|
|
62
|
-
env: this.configs[index].env,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
throw new Error('invalid env');
|
|
66
|
-
}
|
|
67
|
-
isValidMode(configs, env) {
|
|
68
|
-
for (let index in configs) {
|
|
69
|
-
if (!configs.hasOwnProperty(index))
|
|
70
|
-
continue;
|
|
71
|
-
if (configs[index].env === env)
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=../../src/lib/components/env.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../components/env.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,GAAG,GAAG;IACf,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,mBAAmB,EAAE,qBAAqB;IAC1C,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,gBAAgB;CAC7B,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACjE,MAAM,WAAW,GAAG,qEAAqE,CAAC;AAE1F,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,C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