@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.
- package/.vscode/launch.json +25 -0
- package/babel.config.js +6 -0
- package/index.html +454 -0
- package/jest.config.js +5 -0
- package/lib/base/Helpers.d.ts +17 -0
- package/lib/base/Helpers.js +43 -4
- package/lib/base/Helpers.js.map +1 -1
- package/lib/base/RequestBehaviour.d.ts +1 -1
- package/lib/base/RequestBehaviour.js +16 -0
- package/lib/base/RequestBehaviour.js.map +1 -1
- package/lib/base/Response.d.ts +1 -1
- package/lib/base/Response.js +20 -0
- package/lib/base/Response.js.map +1 -1
- package/lib/base/ServiceBehaviour.d.ts +16 -42
- package/lib/base/ServiceBehaviour.js +64 -73
- package/lib/base/ServiceBehaviour.js.map +1 -1
- package/lib/browser/index.js +18 -0
- package/lib/entities/CardResult.d.ts +74 -0
- package/lib/entities/CardResult.js +90 -0
- package/lib/entities/CardResult.js.map +1 -0
- package/lib/entities/TransactionResult.d.ts +97 -0
- package/lib/entities/TransactionResult.js +120 -0
- package/lib/entities/TransactionResult.js.map +1 -0
- package/lib/index.d.ts +41 -27
- package/lib/index.js +40 -28
- package/lib/index.js.map +1 -1
- package/lib/libraries/CardinalManager.d.ts +47 -0
- package/lib/libraries/CardinalManager.js +254 -0
- package/lib/libraries/CardinalManager.js.map +1 -0
- package/lib/libraries/PayloadManager.d.ts +26 -0
- package/lib/libraries/PayloadManager.js +106 -0
- package/lib/libraries/PayloadManager.js.map +1 -0
- package/lib/libraries/PixelPayLoading.d.ts +7 -0
- package/lib/libraries/PixelPayLoading.js +44 -0
- package/lib/libraries/PixelPayLoading.js.map +1 -0
- package/lib/libraries/PixelPayModal.d.ts +12 -0
- package/lib/libraries/PixelPayModal.js +72 -0
- package/lib/libraries/PixelPayModal.js.map +1 -0
- package/lib/models/Billing.js +24 -0
- package/lib/models/Billing.js.map +1 -1
- package/lib/models/Card.js +23 -0
- package/lib/models/Card.js.map +1 -1
- package/lib/models/Item.js +24 -0
- package/lib/models/Item.js.map +1 -1
- package/lib/models/Order.js +47 -0
- package/lib/models/Order.js.map +1 -1
- package/lib/models/Settings.d.ts +65 -0
- package/lib/models/Settings.js +90 -0
- package/lib/models/Settings.js.map +1 -0
- package/lib/requests/AuthTransaction.d.ts +3 -0
- package/lib/{mappings/VoidTransaction.js → requests/AuthTransaction.js} +7 -7
- package/lib/requests/AuthTransaction.js.map +1 -0
- package/lib/{mappings → requests}/CaptureTransaction.d.ts +2 -2
- package/lib/{mappings → requests}/CaptureTransaction.js +12 -3
- package/lib/requests/CaptureTransaction.js.map +1 -0
- package/lib/{mappings → requests}/CardTokenization.d.ts +0 -4
- package/lib/{mappings → requests}/CardTokenization.js +51 -2
- package/lib/requests/CardTokenization.js.map +1 -0
- package/lib/requests/LookupContinueTransaction.d.ts +11 -0
- package/lib/{mappings/CustomerTokenization.js → requests/LookupContinueTransaction.js} +18 -9
- package/lib/requests/LookupContinueTransaction.js.map +1 -0
- package/lib/requests/LookupTransaction.d.ts +68 -0
- package/lib/requests/LookupTransaction.js +107 -0
- package/lib/requests/LookupTransaction.js.map +1 -0
- package/lib/{mappings/AuthTransaction.d.ts → requests/PaymentTransaction.d.ts} +20 -5
- package/lib/requests/PaymentTransaction.js +190 -0
- package/lib/requests/PaymentTransaction.js.map +1 -0
- package/lib/requests/SaleTransaction.d.ts +3 -0
- package/lib/{mappings → requests}/SaleTransaction.js +2 -2
- package/lib/requests/SaleTransaction.js.map +1 -0
- package/lib/requests/StatusTransaction.d.ts +7 -0
- package/lib/{mappings → requests}/StatusTransaction.js +8 -3
- package/lib/requests/StatusTransaction.js.map +1 -0
- package/lib/{mappings → requests}/VoidTransaction.d.ts +2 -2
- package/lib/{base/PaymentTransaction.js → requests/VoidTransaction.js} +17 -8
- package/lib/requests/VoidTransaction.js.map +1 -0
- package/lib/resources/Environment.d.ts +6 -0
- package/lib/resources/Environment.js +13 -0
- package/lib/resources/Environment.js.map +1 -0
- package/lib/resources/Locations.d.ts +16 -0
- package/lib/resources/Locations.js +27 -0
- package/lib/resources/Locations.js.map +1 -0
- package/lib/{resources → responses}/ErrorResponse.d.ts +0 -0
- package/lib/{resources → responses}/ErrorResponse.js +0 -0
- package/lib/{resources → responses}/ErrorResponse.js.map +1 -1
- package/lib/{resources → responses}/FailureResponse.d.ts +0 -0
- package/lib/{resources → responses}/FailureResponse.js +0 -0
- package/lib/{resources → responses}/FailureResponse.js.map +1 -1
- package/lib/{resources → responses}/InputErrorResponse.d.ts +0 -0
- package/lib/{resources → responses}/InputErrorResponse.js +0 -0
- package/lib/{resources → responses}/InputErrorResponse.js.map +1 -1
- package/lib/{resources → responses}/NetworkFailureResponse.d.ts +0 -0
- package/lib/{resources → responses}/NetworkFailureResponse.js +0 -0
- package/lib/{resources → responses}/NetworkFailureResponse.js.map +1 -1
- package/lib/{resources → responses}/NoAccessResponse.d.ts +0 -0
- package/lib/{resources → responses}/NoAccessResponse.js +0 -0
- package/lib/{resources → responses}/NoAccessResponse.js.map +1 -1
- package/lib/{resources → responses}/NotFoundResponse.d.ts +0 -0
- package/lib/{resources → responses}/NotFoundResponse.js +0 -0
- package/lib/{resources → responses}/NotFoundResponse.js.map +1 -1
- package/lib/{resources → responses}/PayloadResponse.d.ts +0 -0
- package/lib/{resources → responses}/PayloadResponse.js +0 -0
- package/lib/{resources → responses}/PayloadResponse.js.map +1 -1
- package/lib/{resources → responses}/PaymentDeclinedResponse.d.ts +0 -0
- package/lib/{resources → responses}/PaymentDeclinedResponse.js +0 -0
- package/lib/{resources → responses}/PaymentDeclinedResponse.js.map +1 -1
- package/lib/{resources → responses}/PreconditionalResponse.d.ts +0 -0
- package/lib/{resources → responses}/PreconditionalResponse.js +0 -0
- package/lib/{resources → responses}/PreconditionalResponse.js.map +1 -1
- package/lib/{resources → responses}/SuccessResponse.d.ts +0 -0
- package/lib/{resources → responses}/SuccessResponse.js +0 -0
- package/lib/{resources → responses}/SuccessResponse.js.map +1 -1
- package/lib/responses/TimeoutResponse.d.ts +3 -0
- package/lib/responses/TimeoutResponse.js +27 -0
- package/lib/responses/TimeoutResponse.js.map +1 -0
- package/lib/services/CardinalAuthentication.d.ts +19 -0
- package/lib/services/CardinalAuthentication.js +56 -0
- package/lib/services/CardinalAuthentication.js.map +1 -0
- package/lib/services/Tokenization.d.ts +5 -14
- package/lib/services/Tokenization.js +87 -20
- package/lib/services/Tokenization.js.map +1 -1
- package/lib/services/Transaction.d.ts +54 -5
- package/lib/services/Transaction.js +193 -25
- package/lib/services/Transaction.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/web.d.ts +28 -0
- package/package.json +16 -5
- package/{test.js → test-node.js} +0 -0
- package/tests/Locations.test.ts +9 -0
- package/tests/Models/Card.test.ts +33 -0
- package/tests/Models/Order.test.ts +64 -0
- package/tests/Models/Settings.test.ts +65 -0
- package/tests/Tokenization.test.ts +229 -0
- package/tests/Transaction.test.ts +342 -0
- package/webpack.mix.js +12 -0
- package/lib/base/PaymentTransaction.d.ts +0 -3
- package/lib/base/PaymentTransaction.js.map +0 -1
- package/lib/mappings/AuthTransaction.js +0 -78
- package/lib/mappings/AuthTransaction.js.map +0 -1
- package/lib/mappings/CaptureTransaction.js.map +0 -1
- package/lib/mappings/CardTokenization.js.map +0 -1
- package/lib/mappings/CustomerTokenization.d.ts +0 -7
- package/lib/mappings/CustomerTokenization.js.map +0 -1
- package/lib/mappings/SaleTransaction.d.ts +0 -3
- package/lib/mappings/SaleTransaction.js.map +0 -1
- package/lib/mappings/StatusTransaction.d.ts +0 -7
- package/lib/mappings/StatusTransaction.js.map +0 -1
- package/lib/mappings/VoidTransaction.js.map +0 -1
- package/lib/models/CardToken.d.ts +0 -14
- package/lib/models/CardToken.js +0 -9
- 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
|
|
7
|
-
export default class
|
|
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
|
|
120
|
+
* @param token
|
|
110
121
|
*/
|
|
111
|
-
|
|
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/Pa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D,IAAI,CAAC,gBAAgB,GAAG,iBAAO,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,CAAC,qBAAqB,GAAG,iBAAO,CAAC,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC,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"}
|
|
@@ -15,13 +15,13 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var
|
|
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
|
-
}(
|
|
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"}
|
|
@@ -15,13 +15,18 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var
|
|
18
|
+
var RequestBehaviour_1 = require("../base/RequestBehaviour");
|
|
19
19
|
var StatusTransaction = /** @class */ (function (_super) {
|
|
20
20
|
__extends(StatusTransaction, _super);
|
|
21
21
|
function StatusTransaction() {
|
|
22
|
-
|
|
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
|
-
}(
|
|
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
|
|
2
|
-
export default class VoidTransaction extends
|
|
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("
|
|
19
|
-
var
|
|
20
|
-
__extends(
|
|
21
|
-
function
|
|
22
|
-
|
|
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
|
|
33
|
+
return VoidTransaction;
|
|
25
34
|
}(RequestBehaviour_1.default));
|
|
26
|
-
exports.default =
|
|
27
|
-
//# sourceMappingURL=
|
|
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,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/
|
|
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
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FailureResponse.js","sourceRoot":"","sources":["../../src/
|
|
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"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputErrorResponse.js","sourceRoot":"","sources":["../../src/
|
|
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"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkFailureResponse.js","sourceRoot":"","sources":["../../src/
|
|
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
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoAccessResponse.js","sourceRoot":"","sources":["../../src/
|
|
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
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotFoundResponse.js","sourceRoot":"","sources":["../../src/
|
|
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
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadResponse.js","sourceRoot":"","sources":["../../src/
|
|
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"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentDeclinedResponse.js","sourceRoot":"","sources":["../../src/
|
|
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"}
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreconditionalResponse.js","sourceRoot":"","sources":["../../src/
|
|
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
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuccessResponse.js","sourceRoot":"","sources":["../../src/
|
|
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,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
|
+
}
|