@xsolla/payment-client-core 0.2.40 → 0.2.42

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.
@@ -324,6 +324,7 @@ class SavedMethodsResponse {
324
324
  dateCreate: method.date_create,
325
325
  dateLastCharge: method.date_last_charge,
326
326
  iconName: method.switch_icon_name,
327
+ userEmail: method.user_email,
327
328
  partner: method.partner,
328
329
  };
329
330
  }
@@ -6743,10 +6744,10 @@ class PaymentService {
6743
6744
  }
6744
6745
  getPid() {
6745
6746
  if (this.data instanceof SubmitResponse) {
6746
- return (Number(this.data.fields.find((field) => field.name === 'fix_pid')?.value) || null);
6747
+ return this.data.parameters.pid;
6747
6748
  }
6748
6749
  if (this.data instanceof InitializeResponse) {
6749
- return (Number(this.data.paymentForm?.fields.find((field) => field.name === 'fix_pid')?.value) || null);
6750
+ return this.data.paymentForm?.pid ?? null;
6750
6751
  }
6751
6752
  return null;
6752
6753
  }
@@ -7010,6 +7011,32 @@ const euCountries = new Set([
7010
7011
  'SE',
7011
7012
  ]);
7012
7013
 
7014
+ const payPayId = 3669;
7015
+ const linePayId = 3677;
7016
+ const auPayId = 3686;
7017
+ const docomoId = 3692;
7018
+ const softbankId = 3693;
7019
+ const auEasyPaymentId = 3694;
7020
+ const yMobileId = 3697;
7021
+
7022
+ const sctlLinkUsa = 'https://xsolla.com/ja/sctl/xsolla-usa';
7023
+ const sctlLinkJapan = 'https://xsolla.com/ja/sctl/xsolla-japan';
7024
+ const sctlLinkMap = new Map([
7025
+ [payPayId, sctlLinkJapan],
7026
+ [linePayId, sctlLinkJapan],
7027
+ [auPayId, sctlLinkJapan],
7028
+ [docomoId, sctlLinkJapan],
7029
+ [softbankId, sctlLinkJapan],
7030
+ [auEasyPaymentId, sctlLinkJapan],
7031
+ [yMobileId, sctlLinkJapan],
7032
+ ]);
7033
+ const getSctlLink = (pid) => {
7034
+ if (!pid) {
7035
+ return sctlLinkUsa;
7036
+ }
7037
+ return sctlLinkMap.get(pid) ?? sctlLinkUsa;
7038
+ };
7039
+
7013
7040
  class RefundPolicyService {
7014
7041
  constructor(settingsService) {
7015
7042
  this.settingsService = settingsService;
@@ -7037,34 +7064,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
7037
7064
  }]
7038
7065
  }], ctorParameters: () => [{ type: SettingsService }] });
7039
7066
 
7040
- class SecureConnectionService {
7041
- get isWhiteLabel() {
7042
- return !!this.settingsService.settings?.white_label;
7043
- }
7044
- get secureConnectionUrl() {
7045
- this.setSecureConnectionUrl();
7046
- return this._secureConnectionUrl;
7047
- }
7048
- constructor(settingsService) {
7049
- this.settingsService = settingsService;
7050
- this.secureConnectionApi = 'https://verify.xsolla.com/?url=';
7051
- }
7052
- setSecureConnectionUrl() {
7053
- const projectUrl = this.settingsService.project?.projectUrl;
7054
- if (projectUrl) {
7055
- this._secureConnectionUrl = `${this.secureConnectionApi}${encodeURIComponent(projectUrl)}`;
7056
- }
7057
- }
7058
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SecureConnectionService, deps: [{ token: SettingsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
7059
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SecureConnectionService, providedIn: 'root' }); }
7060
- }
7061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SecureConnectionService, decorators: [{
7062
- type: Injectable,
7063
- args: [{
7064
- providedIn: 'root',
7065
- }]
7066
- }], ctorParameters: () => [{ type: SettingsService }] });
7067
-
7068
7067
  class DisclaimerService {
7069
7068
  constructor() {
7070
7069
  this.disclaimer = 'disclaimer';
@@ -7091,28 +7090,22 @@ class LegalService {
7091
7090
  return 'EU';
7092
7091
  return 'other';
7093
7092
  }
7094
- constructor(countryService, settingsService, refundPolicyService, secureConnectionService, disclaimerService) {
7093
+ constructor(countryService, settingsService, refundPolicyService, disclaimerService) {
7095
7094
  this.countryService = countryService;
7096
7095
  this.settingsService = settingsService;
7097
7096
  this.refundPolicyService = refundPolicyService;
7098
- this.secureConnectionService = secureConnectionService;
7099
7097
  this.disclaimerService = disclaimerService;
7100
- this.sctlPolicyUrl = 'https://xsolla.com/sctl';
7101
7098
  }
7102
- getLegalComponentConfig() {
7099
+ getLegalComponentConfig(pid) {
7103
7100
  return {
7104
7101
  legalArea: this.legalArea,
7105
7102
  isJapanUser: this.isJapanUser,
7106
7103
  refundPolicyUrl: this.refundPolicyService.url,
7107
- sctlPolicyUrl: this.sctlPolicyUrl,
7108
- secureConnection: {
7109
- secureConnectionUrl: this.secureConnectionService.secureConnectionUrl,
7110
- isWhiteLabel: this.secureConnectionService.isWhiteLabel,
7111
- },
7104
+ sctlPolicyUrl: getSctlLink(pid),
7112
7105
  disclaimer: this.disclaimerService.disclaimer,
7113
7106
  };
7114
7107
  }
7115
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: LegalService, deps: [{ token: CountryService }, { token: SettingsService }, { token: RefundPolicyService }, { token: SecureConnectionService }, { token: DisclaimerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
7108
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: LegalService, deps: [{ token: CountryService }, { token: SettingsService }, { token: RefundPolicyService }, { token: DisclaimerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
7116
7109
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: LegalService, providedIn: 'root' }); }
7117
7110
  }
7118
7111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: LegalService, decorators: [{
@@ -7120,7 +7113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
7120
7113
  args: [{
7121
7114
  providedIn: 'root',
7122
7115
  }]
7123
- }], ctorParameters: () => [{ type: CountryService }, { type: SettingsService }, { type: RefundPolicyService }, { type: SecureConnectionService }, { type: DisclaimerService }] });
7116
+ }], ctorParameters: () => [{ type: CountryService }, { type: SettingsService }, { type: RefundPolicyService }, { type: DisclaimerService }] });
7124
7117
 
7125
7118
  class EditSavedMethodsService {
7126
7119
  constructor(savedMethodsService, settingsService, secureApi) {
@@ -7658,8 +7651,8 @@ class CoreLibraryService {
7658
7651
  get cardTypeUpdates$() {
7659
7652
  return this.creditCardStateService.data$;
7660
7653
  }
7661
- getLegalComponentConfig() {
7662
- return this.legalService.getLegalComponentConfig();
7654
+ getLegalComponentConfig(pid) {
7655
+ return this.legalService.getLegalComponentConfig(pid);
7663
7656
  }
7664
7657
  getUserBalanceValue() {
7665
7658
  return this.userBalanceService.getUserBalanceValue();