@xsolla/payment-client-core 0.2.15 → 0.2.16
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/countries-api/countries-api.service.mjs +38 -0
- package/esm2020/lib/core/countries-api/country-response.interface.mjs +2 -0
- package/esm2020/lib/core/countries-api/country.interface.mjs +2 -0
- package/esm2020/lib/core/sdk-payment-systems/apple-pay/apple-pay.service.mjs +3 -7
- package/esm2020/lib/core-library.service.mjs +9 -4
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/xsolla-payment-client-core.mjs +44 -9
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +40 -9
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/countries-api/countries-api.service.d.ts +15 -0
- package/lib/core/countries-api/country-response.interface.d.ts +4 -0
- package/lib/core/countries-api/country.interface.d.ts +5 -0
- package/lib/core-library.service.d.ts +5 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/xsolla-payment-client-core-0.2.16.tgz +0 -0
- package/xsolla-payment-client-core-0.2.15.tgz +0 -0
|
@@ -7002,8 +7002,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
7002
7002
|
}]
|
|
7003
7003
|
}], ctorParameters: function () { return [{ type: PaymentMethodsService }, { type: SavedMethodsService }]; } });
|
|
7004
7004
|
|
|
7005
|
+
class CountriesApiService {
|
|
7006
|
+
constructor(secureApi, settingsService) {
|
|
7007
|
+
this.secureApi = secureApi;
|
|
7008
|
+
this.settingsService = settingsService;
|
|
7009
|
+
this.countries$ = new BehaviorSubject(null);
|
|
7010
|
+
this.apiRoute = 'country';
|
|
7011
|
+
}
|
|
7012
|
+
async request() {
|
|
7013
|
+
const token = this.settingsService.token;
|
|
7014
|
+
return lastValueFrom(this.secureApi
|
|
7015
|
+
.post(this.apiRoute, { access_token: token }, {
|
|
7016
|
+
headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8'),
|
|
7017
|
+
responseType: 'json',
|
|
7018
|
+
})
|
|
7019
|
+
.pipe(map$1((response) => {
|
|
7020
|
+
return response.countryList;
|
|
7021
|
+
}), tap((value) => {
|
|
7022
|
+
this.countries$.next(value);
|
|
7023
|
+
return value;
|
|
7024
|
+
})));
|
|
7025
|
+
}
|
|
7026
|
+
}
|
|
7027
|
+
CountriesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CountriesApiService, deps: [{ token: SecureApiClient }, { token: SettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7028
|
+
CountriesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CountriesApiService, providedIn: 'root' });
|
|
7029
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CountriesApiService, decorators: [{
|
|
7030
|
+
type: Injectable,
|
|
7031
|
+
args: [{
|
|
7032
|
+
providedIn: 'root',
|
|
7033
|
+
}]
|
|
7034
|
+
}], ctorParameters: function () { return [{ type: SecureApiClient }, { type: SettingsService }]; } });
|
|
7035
|
+
|
|
7005
7036
|
class CoreLibraryService {
|
|
7006
|
-
constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService, creditCardService, creditCardStateService, formMessagesService, editSavedMethodsService, userBehaviourAnalyticsService, performanceService, combinedPaymentMethodsService) {
|
|
7037
|
+
constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService, creditCardService, creditCardStateService, formMessagesService, editSavedMethodsService, userBehaviourAnalyticsService, performanceService, combinedPaymentMethodsService, countriesApiService) {
|
|
7007
7038
|
this.settingsService = settingsService;
|
|
7008
7039
|
this.countryService = countryService;
|
|
7009
7040
|
this.paymentMethodsService = paymentMethodsService;
|
|
@@ -7023,6 +7054,7 @@ class CoreLibraryService {
|
|
|
7023
7054
|
this.userBehaviourAnalyticsService = userBehaviourAnalyticsService;
|
|
7024
7055
|
this.performanceService = performanceService;
|
|
7025
7056
|
this.combinedPaymentMethodsService = combinedPaymentMethodsService;
|
|
7057
|
+
this.countriesApiService = countriesApiService;
|
|
7026
7058
|
this.paymentMethods = {
|
|
7027
7059
|
getList: async (isSaveMethodMode) => this.paymentMethodsService.getList(isSaveMethodMode),
|
|
7028
7060
|
getQuickMethods: async () => this.paymentMethodsService.getQuickMethods(),
|
|
@@ -7053,6 +7085,9 @@ class CoreLibraryService {
|
|
|
7053
7085
|
pid: this.paymentService.getPid(),
|
|
7054
7086
|
};
|
|
7055
7087
|
}
|
|
7088
|
+
async getCountries() {
|
|
7089
|
+
return this.countriesApiService.request();
|
|
7090
|
+
}
|
|
7056
7091
|
setCountry(country) {
|
|
7057
7092
|
this.countryService.setCountry(country);
|
|
7058
7093
|
}
|
|
@@ -7118,14 +7153,14 @@ class CoreLibraryService {
|
|
|
7118
7153
|
return this.paymentService.formResponseValue;
|
|
7119
7154
|
}
|
|
7120
7155
|
}
|
|
7121
|
-
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 }, { token: FormMessagesService }, { token: EditSavedMethodsService }, { token: UserBehaviourAnalyticsService }, { token: PerformanceService }, { token: CombinedPaymentMethodsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7156
|
+
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 }, { token: FormMessagesService }, { token: EditSavedMethodsService }, { token: UserBehaviourAnalyticsService }, { token: PerformanceService }, { token: CombinedPaymentMethodsService }, { token: CountriesApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7122
7157
|
CoreLibraryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, providedIn: 'root' });
|
|
7123
7158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, decorators: [{
|
|
7124
7159
|
type: Injectable,
|
|
7125
7160
|
args: [{
|
|
7126
7161
|
providedIn: 'root',
|
|
7127
7162
|
}]
|
|
7128
|
-
}], 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 }, { type: FormMessagesService }, { type: EditSavedMethodsService }, { type: UserBehaviourAnalyticsService }, { type: PerformanceService }, { type: CombinedPaymentMethodsService }]; } });
|
|
7163
|
+
}], 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 }, { type: FormMessagesService }, { type: EditSavedMethodsService }, { type: UserBehaviourAnalyticsService }, { type: PerformanceService }, { type: CombinedPaymentMethodsService }, { type: CountriesApiService }]; } });
|
|
7129
7164
|
|
|
7130
7165
|
class HttpError extends AppError {
|
|
7131
7166
|
constructor(error, req) {
|
|
@@ -7688,8 +7723,7 @@ class ApplePayService {
|
|
|
7688
7723
|
console.error('apple pay: initialize failed', error);
|
|
7689
7724
|
}
|
|
7690
7725
|
this.emitIntegrationType();
|
|
7691
|
-
if (!this.paymentClient ||
|
|
7692
|
-
(!this.isDeviceCapable() && !this.userAgentService.isSafari)) {
|
|
7726
|
+
if (!this.paymentClient || !this.isDeviceCapable()) {
|
|
7693
7727
|
this.emitError(ApplePayErrors.deviceIsNotCapableError);
|
|
7694
7728
|
}
|
|
7695
7729
|
}
|
|
@@ -7849,10 +7883,7 @@ class ApplePayService {
|
|
|
7849
7883
|
}
|
|
7850
7884
|
emitIntegrationType() {
|
|
7851
7885
|
let integrationType;
|
|
7852
|
-
if (this.paymentClient && this.isDeviceCapable()
|
|
7853
|
-
integrationType = 'sdk';
|
|
7854
|
-
}
|
|
7855
|
-
else if (this.userAgentService.isSafari) {
|
|
7886
|
+
if (this.paymentClient && this.isDeviceCapable()) {
|
|
7856
7887
|
integrationType = 'redirect';
|
|
7857
7888
|
}
|
|
7858
7889
|
else {
|