@esolve/ng-esolve-connect 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/auth/esolve-auth.service.mjs +15 -10
- package/esm2020/lib/payment/classes/esolve-banking-details.model.mjs +11 -0
- package/esm2020/lib/payment/classes/esolve-payment-method.model.mjs +36 -0
- package/esm2020/lib/payment/classes/esolve-payment-result.model.mjs +37 -0
- package/esm2020/lib/payment/classes/esolve-vault-item-result.model.mjs +20 -0
- package/esm2020/lib/payment/classes/esolve-vault-item.model.mjs +20 -0
- package/esm2020/lib/payment/classes/index.mjs +6 -0
- package/esm2020/lib/payment/esolve-payment.service.mjs +44 -5
- package/esm2020/lib/payment/index.mjs +4 -14
- package/esm2020/lib/payment/interfaces/esolve-card-data.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-payment-form-input.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-payment-method-options.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-payment-method-record.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-payment-response.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-payment-set-body.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-payment-status.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-vault-record.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/esolve-vault-response.interface.mjs +2 -0
- package/esm2020/lib/payment/interfaces/index.mjs +9 -0
- package/esm2020/lib/payment/types/esolve-integration-type.type.mjs +2 -0
- package/esm2020/lib/payment/types/esolve-service-provider.type.mjs +2 -0
- package/esm2020/lib/payment/types/index.mjs +3 -0
- package/fesm2015/esolve-ng-esolve-connect.mjs +134 -66
- package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect.mjs +129 -65
- package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/payment/{esolve-banking-details.model.d.ts → classes/esolve-banking-details.model.d.ts} +0 -0
- package/lib/payment/{esolve-payment-method.model.d.ts → classes/esolve-payment-method.model.d.ts} +2 -2
- package/lib/payment/classes/esolve-payment-result.model.d.ts +28 -0
- package/lib/payment/{esolve-vault-item-result.model.d.ts → classes/esolve-vault-item-result.model.d.ts} +2 -2
- package/lib/payment/{esolve-vault-item.model.d.ts → classes/esolve-vault-item.model.d.ts} +0 -0
- package/lib/payment/classes/index.d.ts +5 -0
- package/lib/payment/esolve-payment.service.d.ts +35 -6
- package/lib/payment/index.d.ts +3 -13
- package/lib/payment/{esolve-card-data.interface.d.ts → interfaces/esolve-card-data.interface.d.ts} +0 -0
- package/lib/payment/interfaces/esolve-payment-form-input.interface.d.ts +4 -0
- package/lib/payment/{esolve-payment-method-options.interface.d.ts → interfaces/esolve-payment-method-options.interface.d.ts} +0 -0
- package/lib/payment/{esolve-payment-method-record.interface.d.ts → interfaces/esolve-payment-method-record.interface.d.ts} +1 -1
- package/lib/payment/interfaces/esolve-payment-response.interface.d.ts +28 -0
- package/lib/payment/{esolve-payment-set-body.interface.d.ts → interfaces/esolve-payment-set-body.interface.d.ts} +0 -0
- package/lib/payment/interfaces/esolve-payment-status.interface.d.ts +3 -0
- package/lib/payment/{esolve-vault-record.interface.d.ts → interfaces/esolve-vault-record.interface.d.ts} +0 -0
- package/lib/payment/{esolve-vault-response.interface.d.ts → interfaces/esolve-vault-response.interface.d.ts} +1 -1
- package/lib/payment/interfaces/index.d.ts +7 -0
- package/lib/payment/{esolve-integration-type.type.d.ts → types/esolve-integration-type.type.d.ts} +0 -0
- package/lib/payment/types/esolve-service-provider.type.d.ts +1 -0
- package/lib/payment/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/esm2020/lib/payment/esolve-banking-details.model.mjs +0 -11
- package/esm2020/lib/payment/esolve-card-data.interface.mjs +0 -2
- package/esm2020/lib/payment/esolve-integration-type.type.mjs +0 -2
- package/esm2020/lib/payment/esolve-paygate-form-input.interface.mjs +0 -2
- package/esm2020/lib/payment/esolve-payment-method-options.interface.mjs +0 -2
- package/esm2020/lib/payment/esolve-payment-method-record.interface.mjs +0 -2
- package/esm2020/lib/payment/esolve-payment-method.model.mjs +0 -36
- package/esm2020/lib/payment/esolve-payment-response.interface.mjs +0 -2
- package/esm2020/lib/payment/esolve-payment-result.model.mjs +0 -22
- package/esm2020/lib/payment/esolve-payment-set-body.interface.mjs +0 -2
- package/esm2020/lib/payment/esolve-vault-item-result.model.mjs +0 -20
- package/esm2020/lib/payment/esolve-vault-item.model.mjs +0 -20
- package/esm2020/lib/payment/esolve-vault-record.interface.mjs +0 -2
- package/esm2020/lib/payment/esolve-vault-response.interface.mjs +0 -2
- package/lib/payment/esolve-paygate-form-input.interface.d.ts +0 -4
- package/lib/payment/esolve-payment-response.interface.d.ts +0 -10
- package/lib/payment/esolve-payment-result.model.d.ts +0 -11
|
@@ -1519,10 +1519,14 @@ class EsolveAuthService {
|
|
|
1519
1519
|
return this.errorHandler.handleHttpPostError('set-login', errorRes);
|
|
1520
1520
|
}));
|
|
1521
1521
|
}
|
|
1522
|
-
logout() {
|
|
1522
|
+
async logout() {
|
|
1523
1523
|
this.session.clearTimer();
|
|
1524
1524
|
this.cookieService.delete('_ws_id');
|
|
1525
|
-
|
|
1525
|
+
const response = await this.getAccessToken('', '', true).toPromise();
|
|
1526
|
+
if (response) {
|
|
1527
|
+
return response;
|
|
1528
|
+
}
|
|
1529
|
+
throw new Error('Invalid response');
|
|
1526
1530
|
}
|
|
1527
1531
|
checkAccessToken(session) {
|
|
1528
1532
|
session = session || this.session.currentSession;
|
|
@@ -1531,7 +1535,7 @@ class EsolveAuthService {
|
|
|
1531
1535
|
.get(`${this.config.api_url}/get-access-token.php`, {
|
|
1532
1536
|
params: { key: token },
|
|
1533
1537
|
headers: new HttpHeaders({
|
|
1534
|
-
'Accept-Language': '*'
|
|
1538
|
+
'Accept-Language': '*',
|
|
1535
1539
|
}),
|
|
1536
1540
|
})
|
|
1537
1541
|
.pipe(map((responseData) => {
|
|
@@ -1549,14 +1553,15 @@ class EsolveAuthService {
|
|
|
1549
1553
|
user_id: additional_data.user_id,
|
|
1550
1554
|
};
|
|
1551
1555
|
return result;
|
|
1552
|
-
}))
|
|
1553
|
-
.toPromise();
|
|
1556
|
+
}));
|
|
1554
1557
|
}
|
|
1555
1558
|
// Handlers
|
|
1556
1559
|
handleExpiration() {
|
|
1557
1560
|
return (session) => {
|
|
1558
|
-
this.checkAccessToken(session).then((response) => {
|
|
1559
|
-
|
|
1561
|
+
this.checkAccessToken(session).toPromise().then((response) => {
|
|
1562
|
+
if (response) {
|
|
1563
|
+
this.handleAuthentication(response);
|
|
1564
|
+
}
|
|
1560
1565
|
}, () => {
|
|
1561
1566
|
this.logout();
|
|
1562
1567
|
});
|
|
@@ -1576,7 +1581,7 @@ class EsolveAuthService {
|
|
|
1576
1581
|
if ((!errorRes.type) ||
|
|
1577
1582
|
(!errorRes.service_type) ||
|
|
1578
1583
|
(!errorRes.message)) {
|
|
1579
|
-
return throwError(error);
|
|
1584
|
+
return throwError(() => error);
|
|
1580
1585
|
}
|
|
1581
1586
|
if (errorRes.message.trim() !== '') {
|
|
1582
1587
|
error.message = errorRes.message;
|
|
@@ -1584,7 +1589,7 @@ class EsolveAuthService {
|
|
|
1584
1589
|
if (errorRes.additional_data) {
|
|
1585
1590
|
error.data = errorRes.additional_data;
|
|
1586
1591
|
}
|
|
1587
|
-
return throwError(error);
|
|
1592
|
+
return throwError(() => error);
|
|
1588
1593
|
}
|
|
1589
1594
|
}
|
|
1590
1595
|
EsolveAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EsolveAuthService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -3989,6 +3994,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
3989
3994
|
args: [ESOLVE_CONNECT_CONFIG]
|
|
3990
3995
|
}] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
|
|
3991
3996
|
|
|
3997
|
+
// Only export the types that are accessible to the public API
|
|
3998
|
+
|
|
3992
3999
|
class EsolveBankingDetails {
|
|
3993
4000
|
constructor(bank_name, account_holder, account, account_type, swift_number, branch_code) {
|
|
3994
4001
|
this.bank_name = bank_name;
|
|
@@ -4000,6 +4007,77 @@ class EsolveBankingDetails {
|
|
|
4000
4007
|
}
|
|
4001
4008
|
}
|
|
4002
4009
|
|
|
4010
|
+
class EsolvePaymentMethod {
|
|
4011
|
+
constructor(record) {
|
|
4012
|
+
this.id = +record.id;
|
|
4013
|
+
this.location_id = +record.location_id;
|
|
4014
|
+
this.paymethod_name = record.paymethod_name;
|
|
4015
|
+
this.description = record.description;
|
|
4016
|
+
this.display_banking_details = record.display_banking_details;
|
|
4017
|
+
this.currency_code = record.currency_code;
|
|
4018
|
+
this.merchant_id = record.merchant_id;
|
|
4019
|
+
this.application_id = record.application_id;
|
|
4020
|
+
this.api_signature = record.api_signature;
|
|
4021
|
+
this.is_gateway = record.is_gateway;
|
|
4022
|
+
this.must_store_card_details = record.must_store_card_details;
|
|
4023
|
+
this.allow_budget = record.allow_budget;
|
|
4024
|
+
this.integration_type = record.integration_type;
|
|
4025
|
+
this.bank_gateway_id = record.bank_gateway_id;
|
|
4026
|
+
this.accepted_card_types = record.accepted_card_types;
|
|
4027
|
+
this.post_transactions_to_gateway = record.post_transactions_to_gateway;
|
|
4028
|
+
this.three_d_secure_url = record.three_d_secure_url;
|
|
4029
|
+
this.gateway_url = record.gateway_url;
|
|
4030
|
+
this.generate_token_url = record.generate_token_url;
|
|
4031
|
+
this.widget_url = record.widget_url;
|
|
4032
|
+
this.successful_url = record.successful_url;
|
|
4033
|
+
this.failed_url = record.failed_url;
|
|
4034
|
+
this.enable_callback = record.enable_callback;
|
|
4035
|
+
this.live = record.live;
|
|
4036
|
+
this.default_module_id = +record.default_module_id;
|
|
4037
|
+
this.service_provider = record.service_provider;
|
|
4038
|
+
this.on_account = record.on_account;
|
|
4039
|
+
this.sort_priority = +record.sort_priority;
|
|
4040
|
+
this.image_url = record.image_url;
|
|
4041
|
+
this.banking_details = new EsolveBankingDetails(record.bank_name, record.account_holder, record.account, record.account_type, record.swift_number, record.branch_code);
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
class EsolvePaymentResult extends EsolveResponseResult {
|
|
4046
|
+
constructor(response) {
|
|
4047
|
+
super(response);
|
|
4048
|
+
this.redirect_required = false;
|
|
4049
|
+
if (typeof response.service_provider !== 'undefined') {
|
|
4050
|
+
this.service_provider = response.service_provider;
|
|
4051
|
+
}
|
|
4052
|
+
if (typeof response.redirect_required !== 'undefined') {
|
|
4053
|
+
this.redirect_required = response.redirect_required;
|
|
4054
|
+
}
|
|
4055
|
+
this.gateway_error_message = response.gateway_error_message ?? '';
|
|
4056
|
+
// Check if redirect settings need to be set
|
|
4057
|
+
if (this.redirect_required && this.service_provider) {
|
|
4058
|
+
if (typeof response.redirect_url !== 'undefined') {
|
|
4059
|
+
this.redirect_url = response.redirect_url;
|
|
4060
|
+
}
|
|
4061
|
+
// Check integration specific settings
|
|
4062
|
+
if (this.service_provider === 'snapscan') {
|
|
4063
|
+
// QR code scan is required
|
|
4064
|
+
if (typeof response.qr_code_url !== 'undefined') {
|
|
4065
|
+
this.qr_code_url = response.qr_code_url;
|
|
4066
|
+
}
|
|
4067
|
+
}
|
|
4068
|
+
else {
|
|
4069
|
+
// Normal form posting redirect
|
|
4070
|
+
if (typeof response.form_inputs !== 'undefined') {
|
|
4071
|
+
this.form_inputs = response.form_inputs;
|
|
4072
|
+
}
|
|
4073
|
+
if (typeof response.form_enctype !== 'undefined') {
|
|
4074
|
+
this.form_enctype = response.form_enctype;
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4078
|
+
}
|
|
4079
|
+
}
|
|
4080
|
+
|
|
4003
4081
|
class EsolveVaultItemResult extends EsolveResponseResult {
|
|
4004
4082
|
constructor(response) {
|
|
4005
4083
|
super(response);
|
|
@@ -4039,62 +4117,6 @@ class EsolveVaultItem {
|
|
|
4039
4117
|
}
|
|
4040
4118
|
}
|
|
4041
4119
|
|
|
4042
|
-
class EsolvePaymentResult extends EsolveResponseResult {
|
|
4043
|
-
constructor(response) {
|
|
4044
|
-
super(response);
|
|
4045
|
-
if (typeof response.gateway_error_message !== 'undefined') {
|
|
4046
|
-
this.gateway_error_message = response.gateway_error_message;
|
|
4047
|
-
}
|
|
4048
|
-
if (typeof response.three_d_secure !== 'undefined') {
|
|
4049
|
-
this.three_d_secure = response.three_d_secure;
|
|
4050
|
-
}
|
|
4051
|
-
if (typeof response.redirect_url !== 'undefined') {
|
|
4052
|
-
this.redirect_url = response.redirect_url;
|
|
4053
|
-
}
|
|
4054
|
-
if (typeof response.form_inputs !== 'undefined') {
|
|
4055
|
-
this.form_inputs = response.form_inputs;
|
|
4056
|
-
}
|
|
4057
|
-
if (typeof response.form_html !== 'undefined') {
|
|
4058
|
-
this.form_html = response.form_html;
|
|
4059
|
-
}
|
|
4060
|
-
}
|
|
4061
|
-
}
|
|
4062
|
-
|
|
4063
|
-
class EsolvePaymentMethod {
|
|
4064
|
-
constructor(record) {
|
|
4065
|
-
this.id = +record.id;
|
|
4066
|
-
this.location_id = +record.location_id;
|
|
4067
|
-
this.paymethod_name = record.paymethod_name;
|
|
4068
|
-
this.description = record.description;
|
|
4069
|
-
this.display_banking_details = record.display_banking_details;
|
|
4070
|
-
this.currency_code = record.currency_code;
|
|
4071
|
-
this.merchant_id = record.merchant_id;
|
|
4072
|
-
this.application_id = record.application_id;
|
|
4073
|
-
this.api_signature = record.api_signature;
|
|
4074
|
-
this.is_gateway = record.is_gateway;
|
|
4075
|
-
this.must_store_card_details = record.must_store_card_details;
|
|
4076
|
-
this.allow_budget = record.allow_budget;
|
|
4077
|
-
this.integration_type = record.integration_type;
|
|
4078
|
-
this.bank_gateway_id = record.bank_gateway_id;
|
|
4079
|
-
this.accepted_card_types = record.accepted_card_types;
|
|
4080
|
-
this.post_transactions_to_gateway = record.post_transactions_to_gateway;
|
|
4081
|
-
this.three_d_secure_url = record.three_d_secure_url;
|
|
4082
|
-
this.gateway_url = record.gateway_url;
|
|
4083
|
-
this.generate_token_url = record.generate_token_url;
|
|
4084
|
-
this.widget_url = record.widget_url;
|
|
4085
|
-
this.successful_url = record.successful_url;
|
|
4086
|
-
this.failed_url = record.failed_url;
|
|
4087
|
-
this.enable_callback = record.enable_callback;
|
|
4088
|
-
this.live = record.live;
|
|
4089
|
-
this.default_module_id = +record.default_module_id;
|
|
4090
|
-
this.service_provider = record.service_provider;
|
|
4091
|
-
this.on_account = record.on_account;
|
|
4092
|
-
this.sort_priority = +record.sort_priority;
|
|
4093
|
-
this.image_url = record.image_url;
|
|
4094
|
-
this.banking_details = new EsolveBankingDetails(record.bank_name, record.account_holder, record.account, record.account_type, record.swift_number, record.branch_code);
|
|
4095
|
-
}
|
|
4096
|
-
}
|
|
4097
|
-
|
|
4098
4120
|
class EsolvePaymentService {
|
|
4099
4121
|
constructor(config, http, errorHandler, responseHandler) {
|
|
4100
4122
|
this.config = config;
|
|
@@ -4104,7 +4126,9 @@ class EsolvePaymentService {
|
|
|
4104
4126
|
}
|
|
4105
4127
|
/**
|
|
4106
4128
|
* Retrieves a list of payment methods.
|
|
4129
|
+
*
|
|
4107
4130
|
* @param options Filter options
|
|
4131
|
+
*
|
|
4108
4132
|
* @returns An `Observable` with an array of payment methods
|
|
4109
4133
|
*/
|
|
4110
4134
|
getPaymentMethods(options) {
|
|
@@ -4117,9 +4141,28 @@ class EsolvePaymentService {
|
|
|
4117
4141
|
return this.processPaymentMethods(response.records);
|
|
4118
4142
|
}));
|
|
4119
4143
|
}
|
|
4144
|
+
/**
|
|
4145
|
+
* Retrieve the payment status of the specified transaction
|
|
4146
|
+
*
|
|
4147
|
+
* @param transaction_id ID of the transaction
|
|
4148
|
+
*
|
|
4149
|
+
* @returns An `Observable` with the success status of the payment
|
|
4150
|
+
*/
|
|
4151
|
+
getPaymentStatus(transaction_id) {
|
|
4152
|
+
return this.http
|
|
4153
|
+
.get(`${this.config.api_url}/get-payment-status.php`, { params: { cart_id: transaction_id } })
|
|
4154
|
+
.pipe(map((response) => {
|
|
4155
|
+
if (response.records === undefined) {
|
|
4156
|
+
throw response;
|
|
4157
|
+
}
|
|
4158
|
+
return response.records.success;
|
|
4159
|
+
}));
|
|
4160
|
+
}
|
|
4120
4161
|
/**
|
|
4121
4162
|
* Retrieves a list of saved cards from the vault.
|
|
4163
|
+
*
|
|
4122
4164
|
* @param payment_methods_id eSolve ID of a payment method
|
|
4165
|
+
*
|
|
4123
4166
|
* @returns An `Observable` with an array of saved bank cards
|
|
4124
4167
|
*/
|
|
4125
4168
|
getVault(payment_methods_id) {
|
|
@@ -4138,8 +4181,10 @@ class EsolvePaymentService {
|
|
|
4138
4181
|
}
|
|
4139
4182
|
/**
|
|
4140
4183
|
* Sets a new card in the vault OR updates an existing one.
|
|
4184
|
+
*
|
|
4141
4185
|
* @param payment_methods_id Selected payment method
|
|
4142
4186
|
* @param card_data Information of bank card
|
|
4187
|
+
*
|
|
4143
4188
|
* @returns An `Observable` with the result of the vault set.
|
|
4144
4189
|
*/
|
|
4145
4190
|
setVaultItem(payment_methods_id, card_data) {
|
|
@@ -4164,6 +4209,13 @@ class EsolvePaymentService {
|
|
|
4164
4209
|
return this.errorHandler.handleHttpPostError('set-vault', errorRes);
|
|
4165
4210
|
}));
|
|
4166
4211
|
}
|
|
4212
|
+
/**
|
|
4213
|
+
* Delete a card in the vault
|
|
4214
|
+
*
|
|
4215
|
+
* @param id ID of the vault item
|
|
4216
|
+
*
|
|
4217
|
+
* @returns An `Observable` with the result of the vault delete.
|
|
4218
|
+
*/
|
|
4167
4219
|
deleteVaultItem(id) {
|
|
4168
4220
|
return this.http
|
|
4169
4221
|
.delete(`${this.config.api_url}/delete-vault.php`, {
|
|
@@ -4189,6 +4241,7 @@ class EsolvePaymentService {
|
|
|
4189
4241
|
* @param transaction_id eSolve ID to the transaction
|
|
4190
4242
|
* @param payment_methods_id eSolve ID to the selected payment method
|
|
4191
4243
|
* @param card ID of selected card from the vault or information to a brand new card
|
|
4244
|
+
*
|
|
4192
4245
|
* @returns An `Observable` with the result of the payment
|
|
4193
4246
|
*/
|
|
4194
4247
|
setPayment(transaction_id, payment_methods_id, card) {
|
|
@@ -4223,7 +4276,9 @@ class EsolvePaymentService {
|
|
|
4223
4276
|
}
|
|
4224
4277
|
/**
|
|
4225
4278
|
* Processes the eSolve payment method records.
|
|
4279
|
+
*
|
|
4226
4280
|
* @param records Records to process
|
|
4281
|
+
*
|
|
4227
4282
|
* @returns An array of processed payment methods.
|
|
4228
4283
|
*/
|
|
4229
4284
|
processPaymentMethods(records) {
|
|
@@ -4238,7 +4293,9 @@ class EsolvePaymentService {
|
|
|
4238
4293
|
}
|
|
4239
4294
|
/**
|
|
4240
4295
|
* Processes the eSolve vault records.
|
|
4296
|
+
*
|
|
4241
4297
|
* @param records Records to process
|
|
4298
|
+
*
|
|
4242
4299
|
* @returns An array of processed vault items (a.k.a. cards)
|
|
4243
4300
|
*/
|
|
4244
4301
|
processVaultItems(records) {
|
|
@@ -4251,6 +4308,13 @@ class EsolvePaymentService {
|
|
|
4251
4308
|
}
|
|
4252
4309
|
return vault;
|
|
4253
4310
|
}
|
|
4311
|
+
/**
|
|
4312
|
+
* Generate a concatenated string with the expiry month and year
|
|
4313
|
+
*
|
|
4314
|
+
* @param card_data Credit card data
|
|
4315
|
+
*
|
|
4316
|
+
* @returns Expiry string
|
|
4317
|
+
*/
|
|
4254
4318
|
generateExpiry(card_data) {
|
|
4255
4319
|
const month_string = card_data.expiry_month.padStart(2, '0');
|
|
4256
4320
|
const year_string = card_data.expiry_year.padStart(4, '0');
|