@xsolla/payment-client-core 0.1.13-test1 → 0.1.13
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/core/payment/payment.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.service.mjs +4 -12
- package/esm2020/lib/core-library.service.mjs +4 -7
- package/fesm2015/xsolla-payment-client-core.mjs +7 -38
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +6 -37
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/payment/payment.interface.d.ts +0 -1
- package/lib/core/payment/payment.service.d.ts +1 -4
- package/lib/core-library.service.d.ts +1 -3
- package/package.json +1 -1
- package/xsolla-payment-client-core-0.1.13.tgz +0 -0
- package/esm2020/lib/core/payment/form-messages/form-messages.service.mjs +0 -26
- package/lib/core/payment/form-messages/form-messages.service.d.ts +0 -11
- package/xsolla-payment-client-core-0.1.13-test1.tgz +0 -0
|
@@ -5023,33 +5023,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
5023
5023
|
}]
|
|
5024
5024
|
}], ctorParameters: function () { return [{ type: ThreeDs20Service }, { type: NextActionService }]; } });
|
|
5025
5025
|
|
|
5026
|
-
class FormMessagesService extends EmitDataService {
|
|
5027
|
-
constructor(unescapeHtmlPipe) {
|
|
5028
|
-
super();
|
|
5029
|
-
this.unescapeHtmlPipe = unescapeHtmlPipe;
|
|
5030
|
-
}
|
|
5031
|
-
emitOnResponse(messages) {
|
|
5032
|
-
if (!messages) {
|
|
5033
|
-
return;
|
|
5034
|
-
}
|
|
5035
|
-
const mapInfoMessages = (infoMessage) => this.unescapeHtmlPipe.transform(infoMessage.message);
|
|
5036
|
-
super.emit(messages.map(mapInfoMessages));
|
|
5037
|
-
}
|
|
5038
|
-
}
|
|
5039
|
-
FormMessagesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormMessagesService, deps: [{ token: UnescapeHtmlPipe }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5040
|
-
FormMessagesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormMessagesService, providedIn: 'root' });
|
|
5041
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormMessagesService, decorators: [{
|
|
5042
|
-
type: Injectable,
|
|
5043
|
-
args: [{
|
|
5044
|
-
providedIn: 'root',
|
|
5045
|
-
}]
|
|
5046
|
-
}], ctorParameters: function () { return [{ type: UnescapeHtmlPipe }]; } });
|
|
5047
|
-
|
|
5048
5026
|
class PaymentService {
|
|
5049
5027
|
get formFieldsStatus$() {
|
|
5050
5028
|
return this.formFieldsStatusSubject.asObservable().pipe(filter$1(Boolean));
|
|
5051
5029
|
}
|
|
5052
|
-
constructor(initializeService, submitService, syncService, formService, statusService, financeDetailsService, creditCardStateService, nextActionService, controlConfigService, threeDsService
|
|
5030
|
+
constructor(initializeService, submitService, syncService, formService, statusService, financeDetailsService, creditCardStateService, nextActionService, controlConfigService, threeDsService) {
|
|
5053
5031
|
this.initializeService = initializeService;
|
|
5054
5032
|
this.submitService = submitService;
|
|
5055
5033
|
this.syncService = syncService;
|
|
@@ -5060,7 +5038,6 @@ class PaymentService {
|
|
|
5060
5038
|
this.nextActionService = nextActionService;
|
|
5061
5039
|
this.controlConfigService = controlConfigService;
|
|
5062
5040
|
this.threeDsService = threeDsService;
|
|
5063
|
-
this.formMessagesService = formMessagesService;
|
|
5064
5041
|
this.form = null;
|
|
5065
5042
|
this.data = null;
|
|
5066
5043
|
this.financeDetails = null;
|
|
@@ -5082,7 +5059,6 @@ class PaymentService {
|
|
|
5082
5059
|
this.listenFormStatusChanges(this.form);
|
|
5083
5060
|
this.emitFinanceDetails(this.data.paymentForm?.summary);
|
|
5084
5061
|
this.emitFormFieldsStatus(this.form);
|
|
5085
|
-
this.emitFormMessages(this.data.paymentForm?.messages);
|
|
5086
5062
|
return this.fields.filter((field) => field?.isVisible === "1" /* XpsBoolean.true */);
|
|
5087
5063
|
}
|
|
5088
5064
|
async submit() {
|
|
@@ -5097,7 +5073,6 @@ class PaymentService {
|
|
|
5097
5073
|
const submitResponse = await this.submitService.request(this.fields, this.form);
|
|
5098
5074
|
this.data = submitResponse;
|
|
5099
5075
|
this.emitFinanceDetails(submitResponse.summary);
|
|
5100
|
-
this.emitFormMessages(submitResponse.messages);
|
|
5101
5076
|
// Handle 3ds flow
|
|
5102
5077
|
if (submitResponse.currentCommand === XpsCommand.create) {
|
|
5103
5078
|
this.runThreeDs();
|
|
@@ -5203,16 +5178,12 @@ class PaymentService {
|
|
|
5203
5178
|
});
|
|
5204
5179
|
this.formFieldsStatusSubject.next(formFieldsStatus);
|
|
5205
5180
|
}
|
|
5206
|
-
emitFormMessages(messages) {
|
|
5207
|
-
this.formMessagesService.emitOnResponse(messages);
|
|
5208
|
-
}
|
|
5209
5181
|
setupSyncService(form, fields) {
|
|
5210
5182
|
this.syncService.setup(form, fields);
|
|
5211
5183
|
this.syncService.data$
|
|
5212
5184
|
.pipe(takeUntil(this.destroy$))
|
|
5213
5185
|
.subscribe((response) => {
|
|
5214
5186
|
this.emitFinanceDetails(response.summary);
|
|
5215
|
-
this.emitFormMessages(response.messages);
|
|
5216
5187
|
});
|
|
5217
5188
|
this.syncService.fieldAsyncValidation$
|
|
5218
5189
|
.pipe(takeUntil(this.destroy$))
|
|
@@ -5234,14 +5205,14 @@ class PaymentService {
|
|
|
5234
5205
|
.subscribe(() => this.emitFormFieldsStatus(form));
|
|
5235
5206
|
}
|
|
5236
5207
|
}
|
|
5237
|
-
PaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, deps: [{ token: InitializeService }, { token: SubmitService }, { token: SyncService }, { token: FormService }, { token: StatusService }, { token: FinanceDetailsService }, { token: CreditCardStateService }, { token: NextActionService }, { token: ControlConfigService }, { token: ThreeDsService }
|
|
5208
|
+
PaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, deps: [{ token: InitializeService }, { token: SubmitService }, { token: SyncService }, { token: FormService }, { token: StatusService }, { token: FinanceDetailsService }, { token: CreditCardStateService }, { token: NextActionService }, { token: ControlConfigService }, { token: ThreeDsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5238
5209
|
PaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, providedIn: 'root' });
|
|
5239
5210
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, decorators: [{
|
|
5240
5211
|
type: Injectable,
|
|
5241
5212
|
args: [{
|
|
5242
5213
|
providedIn: 'root',
|
|
5243
5214
|
}]
|
|
5244
|
-
}], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: FinanceDetailsService }, { type: CreditCardStateService }, { type: NextActionService }, { type: ControlConfigService }, { type: ThreeDsService }
|
|
5215
|
+
}], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: FinanceDetailsService }, { type: CreditCardStateService }, { type: NextActionService }, { type: ControlConfigService }, { type: ThreeDsService }]; } });
|
|
5245
5216
|
|
|
5246
5217
|
class RefundPolicyService {
|
|
5247
5218
|
constructor(settingsService) {
|
|
@@ -5346,7 +5317,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
5346
5317
|
}], ctorParameters: function () { return [{ type: SettingsService }, { type: RefundPolicyService }, { type: SecureConnectionService }, { type: DisclaimerService }]; } });
|
|
5347
5318
|
|
|
5348
5319
|
class CoreLibraryService {
|
|
5349
|
-
constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService, creditCardService, creditCardStateService
|
|
5320
|
+
constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService, creditCardService, creditCardStateService) {
|
|
5350
5321
|
this.settingsService = settingsService;
|
|
5351
5322
|
this.countryService = countryService;
|
|
5352
5323
|
this.paymentMethodsService = paymentMethodsService;
|
|
@@ -5361,7 +5332,6 @@ class CoreLibraryService {
|
|
|
5361
5332
|
this.nextActionService = nextActionService;
|
|
5362
5333
|
this.creditCardService = creditCardService;
|
|
5363
5334
|
this.creditCardStateService = creditCardStateService;
|
|
5364
|
-
this.formMessagesService = formMessagesService;
|
|
5365
5335
|
this.paymentMethods = {
|
|
5366
5336
|
getList: async () => this.paymentMethodsService.getList(),
|
|
5367
5337
|
getQuickMethods: async () => this.paymentMethodsService.getQuickMethods(),
|
|
@@ -5399,7 +5369,6 @@ class CoreLibraryService {
|
|
|
5399
5369
|
changeFieldValue: (name, value) => this.paymentService.changeFieldValue(name, value),
|
|
5400
5370
|
changeFieldState: (name, state) => this.paymentService.changeFieldState(name, state),
|
|
5401
5371
|
updateFieldFormState: (fieldName, formState) => this.paymentService.updateFieldFormState(fieldName, formState),
|
|
5402
|
-
formMessages$: this.formMessagesService.data$,
|
|
5403
5372
|
},
|
|
5404
5373
|
};
|
|
5405
5374
|
}
|
|
@@ -5430,14 +5399,14 @@ class CoreLibraryService {
|
|
|
5430
5399
|
return this.userBalanceService.getUserBalanceValue();
|
|
5431
5400
|
}
|
|
5432
5401
|
}
|
|
5433
|
-
CoreLibraryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, deps: [{ token: SettingsService }, { token: CountryService }, { token: PaymentMethodsService }, { token: SavedMethodsService }, { token: UserBalanceService }, { token: PaymentConfigService }, { token: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: StatusService }, { token: NextActionService }, { token: CreditCardService }, { token: CreditCardStateService }
|
|
5402
|
+
CoreLibraryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, deps: [{ token: SettingsService }, { token: CountryService }, { token: PaymentMethodsService }, { token: SavedMethodsService }, { token: UserBalanceService }, { token: PaymentConfigService }, { token: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: StatusService }, { token: NextActionService }, { token: CreditCardService }, { token: CreditCardStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5434
5403
|
CoreLibraryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, providedIn: 'root' });
|
|
5435
5404
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, decorators: [{
|
|
5436
5405
|
type: Injectable,
|
|
5437
5406
|
args: [{
|
|
5438
5407
|
providedIn: 'root',
|
|
5439
5408
|
}]
|
|
5440
|
-
}], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentConfigService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: FinanceDetailsService }, { type: LegalService }, { type: StatusService }, { type: NextActionService }, { type: CreditCardService }, { type: CreditCardStateService }
|
|
5409
|
+
}], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentConfigService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: FinanceDetailsService }, { type: LegalService }, { type: StatusService }, { type: NextActionService }, { type: CreditCardService }, { type: CreditCardStateService }]; } });
|
|
5441
5410
|
|
|
5442
5411
|
class HttpError extends AppError {
|
|
5443
5412
|
constructor(error, req) {
|