@pixelpay/sdk-core 1.0.0-beta.0 → 2.0.0-beta.2

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 (152) hide show
  1. package/.vscode/launch.json +25 -0
  2. package/babel.config.js +6 -0
  3. package/index.html +454 -0
  4. package/jest.config.js +5 -0
  5. package/lib/base/Helpers.d.ts +17 -0
  6. package/lib/base/Helpers.js +43 -4
  7. package/lib/base/Helpers.js.map +1 -1
  8. package/lib/base/RequestBehaviour.d.ts +1 -1
  9. package/lib/base/RequestBehaviour.js +16 -0
  10. package/lib/base/RequestBehaviour.js.map +1 -1
  11. package/lib/base/Response.d.ts +1 -1
  12. package/lib/base/Response.js +20 -0
  13. package/lib/base/Response.js.map +1 -1
  14. package/lib/base/ServiceBehaviour.d.ts +16 -42
  15. package/lib/base/ServiceBehaviour.js +64 -73
  16. package/lib/base/ServiceBehaviour.js.map +1 -1
  17. package/lib/browser/index.js +18 -0
  18. package/lib/entities/CardResult.d.ts +74 -0
  19. package/lib/entities/CardResult.js +90 -0
  20. package/lib/entities/CardResult.js.map +1 -0
  21. package/lib/entities/TransactionResult.d.ts +97 -0
  22. package/lib/entities/TransactionResult.js +120 -0
  23. package/lib/entities/TransactionResult.js.map +1 -0
  24. package/lib/index.d.ts +41 -27
  25. package/lib/index.js +40 -28
  26. package/lib/index.js.map +1 -1
  27. package/lib/libraries/CardinalManager.d.ts +47 -0
  28. package/lib/libraries/CardinalManager.js +254 -0
  29. package/lib/libraries/CardinalManager.js.map +1 -0
  30. package/lib/libraries/PayloadManager.d.ts +26 -0
  31. package/lib/libraries/PayloadManager.js +106 -0
  32. package/lib/libraries/PayloadManager.js.map +1 -0
  33. package/lib/libraries/PixelPayLoading.d.ts +7 -0
  34. package/lib/libraries/PixelPayLoading.js +44 -0
  35. package/lib/libraries/PixelPayLoading.js.map +1 -0
  36. package/lib/libraries/PixelPayModal.d.ts +12 -0
  37. package/lib/libraries/PixelPayModal.js +72 -0
  38. package/lib/libraries/PixelPayModal.js.map +1 -0
  39. package/lib/models/Billing.js +24 -0
  40. package/lib/models/Billing.js.map +1 -1
  41. package/lib/models/Card.js +23 -0
  42. package/lib/models/Card.js.map +1 -1
  43. package/lib/models/Item.js +24 -0
  44. package/lib/models/Item.js.map +1 -1
  45. package/lib/models/Order.js +47 -0
  46. package/lib/models/Order.js.map +1 -1
  47. package/lib/models/Settings.d.ts +65 -0
  48. package/lib/models/Settings.js +90 -0
  49. package/lib/models/Settings.js.map +1 -0
  50. package/lib/requests/AuthTransaction.d.ts +3 -0
  51. package/lib/{mappings/VoidTransaction.js → requests/AuthTransaction.js} +7 -7
  52. package/lib/requests/AuthTransaction.js.map +1 -0
  53. package/lib/{mappings → requests}/CaptureTransaction.d.ts +2 -2
  54. package/lib/{mappings → requests}/CaptureTransaction.js +12 -3
  55. package/lib/requests/CaptureTransaction.js.map +1 -0
  56. package/lib/{mappings → requests}/CardTokenization.d.ts +0 -4
  57. package/lib/{mappings → requests}/CardTokenization.js +51 -2
  58. package/lib/requests/CardTokenization.js.map +1 -0
  59. package/lib/requests/LookupContinueTransaction.d.ts +11 -0
  60. package/lib/{mappings/CustomerTokenization.js → requests/LookupContinueTransaction.js} +18 -9
  61. package/lib/requests/LookupContinueTransaction.js.map +1 -0
  62. package/lib/requests/LookupTransaction.d.ts +68 -0
  63. package/lib/requests/LookupTransaction.js +107 -0
  64. package/lib/requests/LookupTransaction.js.map +1 -0
  65. package/lib/{mappings/AuthTransaction.d.ts → requests/PaymentTransaction.d.ts} +20 -5
  66. package/lib/requests/PaymentTransaction.js +190 -0
  67. package/lib/requests/PaymentTransaction.js.map +1 -0
  68. package/lib/requests/SaleTransaction.d.ts +3 -0
  69. package/lib/{mappings → requests}/SaleTransaction.js +2 -2
  70. package/lib/requests/SaleTransaction.js.map +1 -0
  71. package/lib/requests/StatusTransaction.d.ts +7 -0
  72. package/lib/{mappings → requests}/StatusTransaction.js +8 -3
  73. package/lib/requests/StatusTransaction.js.map +1 -0
  74. package/lib/{mappings → requests}/VoidTransaction.d.ts +2 -2
  75. package/lib/{base/PaymentTransaction.js → requests/VoidTransaction.js} +17 -8
  76. package/lib/requests/VoidTransaction.js.map +1 -0
  77. package/lib/resources/Environment.d.ts +6 -0
  78. package/lib/resources/Environment.js +13 -0
  79. package/lib/resources/Environment.js.map +1 -0
  80. package/lib/resources/Locations.d.ts +16 -0
  81. package/lib/resources/Locations.js +27 -0
  82. package/lib/resources/Locations.js.map +1 -0
  83. package/lib/{resources → responses}/ErrorResponse.d.ts +0 -0
  84. package/lib/{resources → responses}/ErrorResponse.js +0 -0
  85. package/lib/{resources → responses}/ErrorResponse.js.map +1 -1
  86. package/lib/{resources → responses}/FailureResponse.d.ts +0 -0
  87. package/lib/{resources → responses}/FailureResponse.js +0 -0
  88. package/lib/{resources → responses}/FailureResponse.js.map +1 -1
  89. package/lib/{resources → responses}/InputErrorResponse.d.ts +0 -0
  90. package/lib/{resources → responses}/InputErrorResponse.js +0 -0
  91. package/lib/{resources → responses}/InputErrorResponse.js.map +1 -1
  92. package/lib/{resources → responses}/NetworkFailureResponse.d.ts +0 -0
  93. package/lib/{resources → responses}/NetworkFailureResponse.js +0 -0
  94. package/lib/{resources → responses}/NetworkFailureResponse.js.map +1 -1
  95. package/lib/{resources → responses}/NoAccessResponse.d.ts +0 -0
  96. package/lib/{resources → responses}/NoAccessResponse.js +0 -0
  97. package/lib/{resources → responses}/NoAccessResponse.js.map +1 -1
  98. package/lib/{resources → responses}/NotFoundResponse.d.ts +0 -0
  99. package/lib/{resources → responses}/NotFoundResponse.js +0 -0
  100. package/lib/{resources → responses}/NotFoundResponse.js.map +1 -1
  101. package/lib/{resources → responses}/PayloadResponse.d.ts +0 -0
  102. package/lib/{resources → responses}/PayloadResponse.js +0 -0
  103. package/lib/{resources → responses}/PayloadResponse.js.map +1 -1
  104. package/lib/{resources → responses}/PaymentDeclinedResponse.d.ts +0 -0
  105. package/lib/{resources → responses}/PaymentDeclinedResponse.js +0 -0
  106. package/lib/{resources → responses}/PaymentDeclinedResponse.js.map +1 -1
  107. package/lib/{resources → responses}/PreconditionalResponse.d.ts +0 -0
  108. package/lib/{resources → responses}/PreconditionalResponse.js +0 -0
  109. package/lib/{resources → responses}/PreconditionalResponse.js.map +1 -1
  110. package/lib/{resources → responses}/SuccessResponse.d.ts +0 -0
  111. package/lib/{resources → responses}/SuccessResponse.js +0 -0
  112. package/lib/{resources → responses}/SuccessResponse.js.map +1 -1
  113. package/lib/responses/TimeoutResponse.d.ts +3 -0
  114. package/lib/responses/TimeoutResponse.js +27 -0
  115. package/lib/responses/TimeoutResponse.js.map +1 -0
  116. package/lib/services/CardinalAuthentication.d.ts +19 -0
  117. package/lib/services/CardinalAuthentication.js +56 -0
  118. package/lib/services/CardinalAuthentication.js.map +1 -0
  119. package/lib/services/Tokenization.d.ts +5 -14
  120. package/lib/services/Tokenization.js +87 -20
  121. package/lib/services/Tokenization.js.map +1 -1
  122. package/lib/services/Transaction.d.ts +54 -5
  123. package/lib/services/Transaction.js +193 -25
  124. package/lib/services/Transaction.js.map +1 -1
  125. package/lib/version.d.ts +1 -1
  126. package/lib/version.js +1 -1
  127. package/lib/web.d.ts +28 -0
  128. package/package.json +16 -5
  129. package/{test.js → test-node.js} +0 -0
  130. package/tests/Locations.test.ts +9 -0
  131. package/tests/Models/Card.test.ts +33 -0
  132. package/tests/Models/Order.test.ts +64 -0
  133. package/tests/Models/Settings.test.ts +65 -0
  134. package/tests/Tokenization.test.ts +229 -0
  135. package/tests/Transaction.test.ts +342 -0
  136. package/webpack.mix.js +12 -0
  137. package/lib/base/PaymentTransaction.d.ts +0 -3
  138. package/lib/base/PaymentTransaction.js.map +0 -1
  139. package/lib/mappings/AuthTransaction.js +0 -78
  140. package/lib/mappings/AuthTransaction.js.map +0 -1
  141. package/lib/mappings/CaptureTransaction.js.map +0 -1
  142. package/lib/mappings/CardTokenization.js.map +0 -1
  143. package/lib/mappings/CustomerTokenization.d.ts +0 -7
  144. package/lib/mappings/CustomerTokenization.js.map +0 -1
  145. package/lib/mappings/SaleTransaction.d.ts +0 -3
  146. package/lib/mappings/SaleTransaction.js.map +0 -1
  147. package/lib/mappings/StatusTransaction.d.ts +0 -7
  148. package/lib/mappings/StatusTransaction.js.map +0 -1
  149. package/lib/mappings/VoidTransaction.js.map +0 -1
  150. package/lib/models/CardToken.d.ts +0 -14
  151. package/lib/models/CardToken.js +0 -9
  152. package/lib/models/CardToken.js.map +0 -1
@@ -1,10 +1,9 @@
1
1
  import Item from "../models/Item";
2
2
  import Order from "../models/Order";
3
3
  import Card from "../models/Card";
4
- import CardToken from "../models/CardToken";
5
4
  import Billing from "../models/Billing";
6
- import PaymentTransaction from '../base/PaymentTransaction';
7
- export default class AuthTransaction extends PaymentTransaction {
5
+ import RequestBehaviour from "../base/RequestBehaviour";
6
+ export default class PaymentTransaction extends RequestBehaviour {
8
7
  /**
9
8
  * Payment UUID
10
9
  */
@@ -61,6 +60,10 @@ export default class AuthTransaction extends PaymentTransaction {
61
60
  * Order customer email
62
61
  */
63
62
  customer_email: string;
63
+ /**
64
+ * Order customer device fingerprint
65
+ */
66
+ customer_fingerprint: string;
64
67
  /**
65
68
  * Order ID
66
69
  */
@@ -97,6 +100,14 @@ export default class AuthTransaction extends PaymentTransaction {
97
100
  * Order calback webhook URL
98
101
  */
99
102
  order_callback: string;
103
+ /**
104
+ * Activate authentication request (3DS/EMV)
105
+ */
106
+ authentication_request: boolean;
107
+ /**
108
+ * Authentication transaction identifier
109
+ */
110
+ authentication_identifier: string;
100
111
  /**
101
112
  * Associate and mapping Card model properties to transaction
102
113
  *
@@ -106,9 +117,9 @@ export default class AuthTransaction extends PaymentTransaction {
106
117
  /**
107
118
  * Associate and mapping CardToken model properties to transaction
108
119
  *
109
- * @param card
120
+ * @param token
110
121
  */
111
- serCardToken(card: CardToken): void;
122
+ setCardToken(token?: string): void;
112
123
  /**
113
124
  * Associate and mapping Billing model properties to transaction
114
125
  *
@@ -121,4 +132,8 @@ export default class AuthTransaction extends PaymentTransaction {
121
132
  * @param order
122
133
  */
123
134
  setOrder(order: Order): void;
135
+ /**
136
+ * Enable 3DS/EMV authentication request
137
+ */
138
+ withAuthenticationRequest(): void;
124
139
  }
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ var Helpers_1 = require("../base/Helpers");
19
+ var RequestBehaviour_1 = require("../base/RequestBehaviour");
20
+ var PaymentTransaction = /** @class */ (function (_super) {
21
+ __extends(PaymentTransaction, _super);
22
+ function PaymentTransaction() {
23
+ var _this = _super !== null && _super.apply(this, arguments) || this;
24
+ /**
25
+ * Payment UUID
26
+ */
27
+ _this.payment_uuid = null;
28
+ /**
29
+ * Tokenized card identifier (T-* format)
30
+ */
31
+ _this.card_token = null;
32
+ /**
33
+ * Card number or PAN
34
+ */
35
+ _this.card_number = null;
36
+ /**
37
+ * Card security code
38
+ */
39
+ _this.card_cvv = null;
40
+ /**
41
+ * Card expire year/month date (YYMM)
42
+ */
43
+ _this.card_expire = null;
44
+ /**
45
+ * Cardholder name
46
+ */
47
+ _this.card_holder = null;
48
+ /**
49
+ * Customer billing address
50
+ */
51
+ _this.billing_address = null;
52
+ /**
53
+ * Customer billing country alpha-2 code (ISO 3166-1)
54
+ */
55
+ _this.billing_country = null;
56
+ /**
57
+ * Customer billing state alpha code (ISO 3166-2)
58
+ */
59
+ _this.billing_state = null;
60
+ /**
61
+ * Customer billing city
62
+ */
63
+ _this.billing_city = null;
64
+ /**
65
+ * Customer billing postal code
66
+ */
67
+ _this.billing_zip = null;
68
+ /**
69
+ * Customer billing phone
70
+ */
71
+ _this.billing_phone = null;
72
+ /**
73
+ * Order customer name
74
+ */
75
+ _this.customer_name = null;
76
+ /**
77
+ * Order customer email
78
+ */
79
+ _this.customer_email = null;
80
+ /**
81
+ * Order customer device fingerprint
82
+ */
83
+ _this.customer_fingerprint = null;
84
+ /**
85
+ * Order ID
86
+ */
87
+ _this.order_id = null;
88
+ /**
89
+ * Order currency code alpha-3
90
+ */
91
+ _this.order_currency = null;
92
+ /**
93
+ * Order total amount
94
+ */
95
+ _this.order_amount = null;
96
+ /**
97
+ * Order total tax amount
98
+ */
99
+ _this.order_tax_amount = null;
100
+ /**
101
+ * Order total shipping amount
102
+ */
103
+ _this.order_shipping_amount = null;
104
+ /**
105
+ * Order summary of items or products
106
+ */
107
+ _this.order_content = [];
108
+ /**
109
+ * Order extra properties
110
+ */
111
+ _this.order_extras = {};
112
+ /**
113
+ * Order note or aditional instructions
114
+ */
115
+ _this.order_note = null;
116
+ /**
117
+ * Order calback webhook URL
118
+ */
119
+ _this.order_callback = null;
120
+ /**
121
+ * Activate authentication request (3DS/EMV)
122
+ */
123
+ _this.authentication_request = false;
124
+ /**
125
+ * Authentication transaction identifier
126
+ */
127
+ _this.authentication_identifier = null;
128
+ return _this;
129
+ }
130
+ /**
131
+ * Associate and mapping Card model properties to transaction
132
+ *
133
+ * @param card
134
+ */
135
+ PaymentTransaction.prototype.setCard = function (card) {
136
+ this.card_number = Helpers_1.default.cleanString(card.number);
137
+ this.card_cvv = card.cvv2;
138
+ this.card_expire = card.getExpireFormat();
139
+ this.card_holder = Helpers_1.default.trimValue(card.cardholder);
140
+ };
141
+ /**
142
+ * Associate and mapping CardToken model properties to transaction
143
+ *
144
+ * @param token
145
+ */
146
+ PaymentTransaction.prototype.setCardToken = function (token) {
147
+ if (token === void 0) { token = null; }
148
+ this.card_token = token;
149
+ };
150
+ /**
151
+ * Associate and mapping Billing model properties to transaction
152
+ *
153
+ * @param billing
154
+ */
155
+ PaymentTransaction.prototype.setBilling = function (billing) {
156
+ this.billing_address = Helpers_1.default.trimValue(billing.address);
157
+ this.billing_country = billing.country;
158
+ this.billing_state = billing.state;
159
+ this.billing_city = Helpers_1.default.trimValue(billing.city);
160
+ this.billing_zip = billing.zip;
161
+ this.billing_phone = billing.phone;
162
+ };
163
+ /**
164
+ * Associate and mapping Order model properties to transaction
165
+ *
166
+ * @param order
167
+ */
168
+ PaymentTransaction.prototype.setOrder = function (order) {
169
+ this.order_id = order.id;
170
+ this.order_currency = order.currency;
171
+ this.order_amount = Helpers_1.default.parseAmount(order.amount);
172
+ this.order_tax_amount = Helpers_1.default.parseAmount(order.tax_amount);
173
+ this.order_shipping_amount = Helpers_1.default.parseAmount(order.shipping_amount);
174
+ this.order_content = order.content;
175
+ this.order_extras = order.extras;
176
+ this.order_note = Helpers_1.default.trimValue(order.note);
177
+ this.order_callback = order.callback_url;
178
+ this.customer_name = Helpers_1.default.trimValue(order.customer_name);
179
+ this.customer_email = order.customer_email;
180
+ };
181
+ /**
182
+ * Enable 3DS/EMV authentication request
183
+ */
184
+ PaymentTransaction.prototype.withAuthenticationRequest = function () {
185
+ this.authentication_request = true;
186
+ };
187
+ return PaymentTransaction;
188
+ }(RequestBehaviour_1.default));
189
+ exports.default = PaymentTransaction;
190
+ //# sourceMappingURL=PaymentTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentTransaction.js","sourceRoot":"","sources":["../../src/requests/PaymentTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,2CAAsC;AACtC,6DAAwD;AAExD;IAAgD,sCAAgB;IAAhE;QAAA,qEAgMC;QA/LA;;WAEG;QACH,kBAAY,GAAW,IAAI,CAAC;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AAC,CAAC;QACxE,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,iBAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,YAAY,CAAC;QAEzC,IAAI,CAAC,aAAa,GAAG,iBAAO,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAC5D,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,sDAAyB,GAAzB;QACC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;IACpC,CAAC;IACF,yBAAC;AAAD,CAAC,AAhMD,CAAgD,0BAAgB,GAgM/D"}
@@ -0,0 +1,3 @@
1
+ import PaymentTransaction from './PaymentTransaction';
2
+ export default class SaleTransaction extends PaymentTransaction {
3
+ }
@@ -15,13 +15,13 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- var AuthTransaction_1 = require("./AuthTransaction");
18
+ var PaymentTransaction_1 = require("./PaymentTransaction");
19
19
  var SaleTransaction = /** @class */ (function (_super) {
20
20
  __extends(SaleTransaction, _super);
21
21
  function SaleTransaction() {
22
22
  return _super !== null && _super.apply(this, arguments) || this;
23
23
  }
24
24
  return SaleTransaction;
25
- }(AuthTransaction_1.default));
25
+ }(PaymentTransaction_1.default));
26
26
  exports.default = SaleTransaction;
27
27
  //# sourceMappingURL=SaleTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaleTransaction.js","sourceRoot":"","sources":["../../src/requests/SaleTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAAsD;AAEtD;IAA6C,mCAAkB;IAA/D;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,4BAAkB,GAE9D"}
@@ -0,0 +1,7 @@
1
+ import RequestBehaviour from '../base/RequestBehaviour';
2
+ export default class StatusTransaction extends RequestBehaviour {
3
+ /**
4
+ * Payment UUID
5
+ */
6
+ payment_uuid: string;
7
+ }
@@ -15,13 +15,18 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- var PaymentTransaction_1 = require("../base/PaymentTransaction");
18
+ var RequestBehaviour_1 = require("../base/RequestBehaviour");
19
19
  var StatusTransaction = /** @class */ (function (_super) {
20
20
  __extends(StatusTransaction, _super);
21
21
  function StatusTransaction() {
22
- return _super !== null && _super.apply(this, arguments) || this;
22
+ var _this = _super !== null && _super.apply(this, arguments) || this;
23
+ /**
24
+ * Payment UUID
25
+ */
26
+ _this.payment_uuid = null;
27
+ return _this;
23
28
  }
24
29
  return StatusTransaction;
25
- }(PaymentTransaction_1.default));
30
+ }(RequestBehaviour_1.default));
26
31
  exports.default = StatusTransaction;
27
32
  //# sourceMappingURL=StatusTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusTransaction.js","sourceRoot":"","sources":["../../src/requests/StatusTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6DAAwD;AAExD;IAA+C,qCAAgB;IAA/D;QAAA,qEAKC;QAJA;;WAEG;QACH,kBAAY,GAAW,IAAI,CAAC;;IAC7B,CAAC;IAAD,wBAAC;AAAD,CAAC,AALD,CAA+C,0BAAgB,GAK9D"}
@@ -1,5 +1,5 @@
1
- import PaymentTransaction from "../base/PaymentTransaction";
2
- export default class VoidTransaction extends PaymentTransaction {
1
+ import RequestBehaviour from '../base/RequestBehaviour';
2
+ export default class VoidTransaction extends RequestBehaviour {
3
3
  /**
4
4
  * Payment UUID
5
5
  */
@@ -15,13 +15,22 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- var RequestBehaviour_1 = require("./RequestBehaviour");
19
- var PaymentTransaction = /** @class */ (function (_super) {
20
- __extends(PaymentTransaction, _super);
21
- function PaymentTransaction() {
22
- return _super !== null && _super.apply(this, arguments) || this;
18
+ var RequestBehaviour_1 = require("../base/RequestBehaviour");
19
+ var VoidTransaction = /** @class */ (function (_super) {
20
+ __extends(VoidTransaction, _super);
21
+ function VoidTransaction() {
22
+ var _this = _super !== null && _super.apply(this, arguments) || this;
23
+ /**
24
+ * Payment UUID
25
+ */
26
+ _this.payment_uuid = null;
27
+ /**
28
+ * Reason for void the order
29
+ */
30
+ _this.void_reason = null;
31
+ return _this;
23
32
  }
24
- return PaymentTransaction;
33
+ return VoidTransaction;
25
34
  }(RequestBehaviour_1.default));
26
- exports.default = PaymentTransaction;
27
- //# sourceMappingURL=PaymentTransaction.js.map
35
+ exports.default = VoidTransaction;
36
+ //# sourceMappingURL=VoidTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoidTransaction.js","sourceRoot":"","sources":["../../src/requests/VoidTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6DAAwD;AAExD;IAA6C,mCAAgB;IAA7D;QAAA,qEAUC;QATA;;WAEG;QACH,kBAAY,GAAW,IAAI,CAAC;QAE5B;;WAEG;QACH,iBAAW,GAAW,IAAI,CAAC;;IAC5B,CAAC;IAAD,sBAAC;AAAD,CAAC,AAVD,CAA6C,0BAAgB,GAU5D"}
@@ -0,0 +1,6 @@
1
+ export default class Environment {
2
+ static readonly LIVE = "live";
3
+ static readonly TEST = "test";
4
+ static readonly SANDBOX = "sandbox";
5
+ static readonly STAGING = "staging";
6
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Environment = /** @class */ (function () {
4
+ function Environment() {
5
+ }
6
+ Environment.LIVE = "live";
7
+ Environment.TEST = "test";
8
+ Environment.SANDBOX = "sandbox";
9
+ Environment.STAGING = "staging";
10
+ return Environment;
11
+ }());
12
+ exports.default = Environment;
13
+ //# sourceMappingURL=Environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../src/resources/Environment.ts"],"names":[],"mappings":";;AAAA;IAAA;IAKA,CAAC;IAJgB,gBAAI,GAAG,MAAM,CAAC;IACd,gBAAI,GAAG,MAAM,CAAC;IACd,mBAAO,GAAG,SAAS,CAAC;IACpB,mBAAO,GAAG,SAAS,CAAC;IACrC,kBAAC;CAAA,AALD,IAKC;kBALoB,WAAW"}
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ /**
3
+ * Return a list of countries
4
+ *
5
+ * @return
6
+ */
7
+ countriesList: () => {};
8
+ /**
9
+ * Get states list by country ISO code
10
+ *
11
+ * @param country_code
12
+ * @return
13
+ */
14
+ statesList: (country_code: string) => any;
15
+ };
16
+ export default _default;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var countriesRepository = require("../assets/countries.json");
4
+ var statesRepository = require("../assets/states.json");
5
+ exports.default = {
6
+ /**
7
+ * Return a list of countries
8
+ *
9
+ * @return
10
+ */
11
+ countriesList: function () {
12
+ return countriesRepository || {};
13
+ },
14
+ /**
15
+ * Get states list by country ISO code
16
+ *
17
+ * @param country_code
18
+ * @return
19
+ */
20
+ statesList: function (country_code) {
21
+ if (!Object.prototype.hasOwnProperty.call(statesRepository || {}, country_code)) {
22
+ return {};
23
+ }
24
+ return statesRepository[country_code] || {};
25
+ },
26
+ };
27
+ //# sourceMappingURL=Locations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Locations.js","sourceRoot":"","sources":["../../src/resources/Locations.ts"],"names":[],"mappings":";;AAAA,8DAAgE;AAChE,wDAA0D;AAE1D,kBAAe;IACd;;;;OAIG;IACH,aAAa,EAAE;QACd,OAAO,mBAAmB,IAAI,EAAE,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACH,UAAU,EAAE,UAAC,YAAoB;QAChC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,IAAI,EAAE,EAAE,YAAY,CAAC,EAAE;YAChF,OAAO,EAAE,CAAC;SACV;QAED,OAAO,gBAAgB,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7C,CAAC;CACD,CAAA"}
File without changes
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorResponse.js","sourceRoot":"","sources":["../../src/resources/ErrorResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA2C,iCAAQ;IAAnD;;IAEA,CAAC;IAAD,oBAAC;AAAD,CAAC,AAFD,CAA2C,kBAAQ,GAElD"}
1
+ {"version":3,"file":"ErrorResponse.js","sourceRoot":"","sources":["../../src/responses/ErrorResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA2C,iCAAQ;IAAnD;;IAEA,CAAC;IAAD,oBAAC;AAAD,CAAC,AAFD,CAA2C,kBAAQ,GAElD"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"FailureResponse.js","sourceRoot":"","sources":["../../src/resources/FailureResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
1
+ {"version":3,"file":"FailureResponse.js","sourceRoot":"","sources":["../../src/responses/FailureResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputErrorResponse.js","sourceRoot":"","sources":["../../src/resources/InputErrorResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAgD,sCAAQ;IAAxD;;IAEA,CAAC;IAAD,yBAAC;AAAD,CAAC,AAFD,CAAgD,kBAAQ,GAEvD"}
1
+ {"version":3,"file":"InputErrorResponse.js","sourceRoot":"","sources":["../../src/responses/InputErrorResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAgD,sCAAQ;IAAxD;;IAEA,CAAC;IAAD,yBAAC;AAAD,CAAC,AAFD,CAAgD,kBAAQ,GAEvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkFailureResponse.js","sourceRoot":"","sources":["../../src/resources/NetworkFailureResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAoD,0CAAQ;IAA5D;;IAEA,CAAC;IAAD,6BAAC;AAAD,CAAC,AAFD,CAAoD,kBAAQ,GAE3D"}
1
+ {"version":3,"file":"NetworkFailureResponse.js","sourceRoot":"","sources":["../../src/responses/NetworkFailureResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAoD,0CAAQ;IAA5D;;IAEA,CAAC;IAAD,6BAAC;AAAD,CAAC,AAFD,CAAoD,kBAAQ,GAE3D"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"NoAccessResponse.js","sourceRoot":"","sources":["../../src/resources/NoAccessResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA8C,oCAAQ;IAAtD;;IAEA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAFD,CAA8C,kBAAQ,GAErD"}
1
+ {"version":3,"file":"NoAccessResponse.js","sourceRoot":"","sources":["../../src/responses/NoAccessResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA8C,oCAAQ;IAAtD;;IAEA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAFD,CAA8C,kBAAQ,GAErD"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"NotFoundResponse.js","sourceRoot":"","sources":["../../src/resources/NotFoundResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA8C,oCAAQ;IAAtD;;IAEA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAFD,CAA8C,kBAAQ,GAErD"}
1
+ {"version":3,"file":"NotFoundResponse.js","sourceRoot":"","sources":["../../src/responses/NotFoundResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA8C,oCAAQ;IAAtD;;IAEA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAFD,CAA8C,kBAAQ,GAErD"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"PayloadResponse.js","sourceRoot":"","sources":["../../src/resources/PayloadResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
1
+ {"version":3,"file":"PayloadResponse.js","sourceRoot":"","sources":["../../src/responses/PayloadResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentDeclinedResponse.js","sourceRoot":"","sources":["../../src/resources/PaymentDeclinedResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAqD,2CAAQ;IAA7D;;IAEA,CAAC;IAAD,8BAAC;AAAD,CAAC,AAFD,CAAqD,kBAAQ,GAE5D"}
1
+ {"version":3,"file":"PaymentDeclinedResponse.js","sourceRoot":"","sources":["../../src/responses/PaymentDeclinedResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAqD,2CAAQ;IAA7D;;IAEA,CAAC;IAAD,8BAAC;AAAD,CAAC,AAFD,CAAqD,kBAAQ,GAE5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"PreconditionalResponse.js","sourceRoot":"","sources":["../../src/resources/PreconditionalResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAoD,0CAAQ;IAA5D;;IAEA,CAAC;IAAD,6BAAC;AAAD,CAAC,AAFD,CAAoD,kBAAQ,GAE3D"}
1
+ {"version":3,"file":"PreconditionalResponse.js","sourceRoot":"","sources":["../../src/responses/PreconditionalResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAAoD,0CAAQ;IAA5D;;IAEA,CAAC;IAAD,6BAAC;AAAD,CAAC,AAFD,CAAoD,kBAAQ,GAE3D"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"SuccessResponse.js","sourceRoot":"","sources":["../../src/resources/SuccessResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
1
+ {"version":3,"file":"SuccessResponse.js","sourceRoot":"","sources":["../../src/responses/SuccessResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
@@ -0,0 +1,3 @@
1
+ import Response from '../base/Response';
2
+ export default class TimeoutResponse extends Response {
3
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ var Response_1 = require("../base/Response");
19
+ var TimeoutResponse = /** @class */ (function (_super) {
20
+ __extends(TimeoutResponse, _super);
21
+ function TimeoutResponse() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ return TimeoutResponse;
25
+ }(Response_1.default));
26
+ exports.default = TimeoutResponse;
27
+ //# sourceMappingURL=TimeoutResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeoutResponse.js","sourceRoot":"","sources":["../../src/responses/TimeoutResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
@@ -0,0 +1,19 @@
1
+ import Response from "../base/Response";
2
+ import ServiceBehaviour from "../base/ServiceBehaviour";
3
+ import LookupTransaction from "../requests/LookupTransaction";
4
+ import LookupContinueTransaction from '../requests/LookupContinueTransaction';
5
+ import PaymentTransaction from "../requests/PaymentTransaction";
6
+ export default class CardinalAuthentication extends ServiceBehaviour {
7
+ /**
8
+ * Send an authentication lookup transaction
9
+ */
10
+ authenticationLookup(transaction: LookupTransaction): Promise<Response>;
11
+ /**
12
+ * Send and validate authentication continue transaction
13
+ */
14
+ authenticationContinue(transaction: LookupContinueTransaction): Promise<Response>;
15
+ /**
16
+ * Send payment transaction by type (Sale/Auth)
17
+ */
18
+ retryTransaction(transaction: PaymentTransaction): Promise<Response>;
19
+ }