@xsolla/payment-client-core 0.2.17 → 0.2.18

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.
@@ -6354,7 +6354,7 @@ class PaymentService {
6354
6354
  this.listenFormStatusChanges(this.form);
6355
6355
  this.emitFinanceDetails(this.data.paymentForm?.summary);
6356
6356
  this.emitFormFieldsStatus(this.form);
6357
- this.emitFormMessages(this.data.paymentForm?.messages);
6357
+ this.emitFormMessages(this.getInitializeMessages());
6358
6358
  return this.fields.filter((field) => field?.isVisible === "1" /* XpsBoolean.true */);
6359
6359
  }
6360
6360
  async submit() {
@@ -6429,6 +6429,15 @@ class PaymentService {
6429
6429
  }
6430
6430
  return null;
6431
6431
  }
6432
+ getSubmitButtonText() {
6433
+ if (this.data instanceof SubmitResponse) {
6434
+ return this.data.parameters.buyData.value;
6435
+ }
6436
+ if (this.data instanceof InitializeResponse) {
6437
+ return this.data.paymentForm?.buyData.value ?? null;
6438
+ }
6439
+ return null;
6440
+ }
6432
6441
  async validate(field) {
6433
6442
  const syncErrors = this.syncService.getSyncValidationErrors(field);
6434
6443
  if (syncErrors) {
@@ -6618,6 +6627,15 @@ class PaymentService {
6618
6627
  isSandbox: this.settingsService.isSandboxMode(),
6619
6628
  });
6620
6629
  }
6630
+ getInitializeMessages() {
6631
+ const messages = this.data.paymentForm?.messages;
6632
+ const koreaNotification = this.data.paymentForm
6633
+ ?.koreaNotification;
6634
+ if (koreaNotification) {
6635
+ messages?.push({ code: '0', message: koreaNotification?.title });
6636
+ }
6637
+ return messages ?? [];
6638
+ }
6621
6639
  }
6622
6640
  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 }, { token: FormMessagesService }, { token: SettingsService }, { token: CountryService }, { token: CheckStatusActionCreator }], target: i0.ɵɵFactoryTarget.Injectable });
6623
6641
  PaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, providedIn: 'root' });
@@ -7104,6 +7122,7 @@ class CoreLibraryService {
7104
7122
  submit: async () => this.paymentService.submit(),
7105
7123
  getFields: () => this.paymentService.getFields(),
7106
7124
  getPid: () => this.paymentService.getPid(),
7125
+ getSubmitButtonText: () => this.paymentService.getSubmitButtonText(),
7107
7126
  validate: async (field) => this.paymentService.validate(field),
7108
7127
  getFinanceDetails: () => this.paymentService.getFinanceDetails(),
7109
7128
  runThreeDs: () => this.paymentService.runThreeDs(),
@@ -7577,7 +7596,7 @@ class GooglePayService {
7577
7596
  return checkStatusAction;
7578
7597
  }
7579
7598
  }
7580
- createButton(onClickHandler) {
7599
+ createButton(onClickHandler, buttonColor = 'default') {
7581
7600
  if (!this.checkout || !this.googlePaymentClient) {
7582
7601
  return null;
7583
7602
  }
@@ -7588,7 +7607,7 @@ class GooglePayService {
7588
7607
  allowedPaymentMethods: paymentDataRequest.allowedPaymentMethods,
7589
7608
  buttonSizeMode: 'fill',
7590
7609
  buttonType: 'buy',
7591
- buttonColor: 'white',
7610
+ buttonColor,
7592
7611
  });
7593
7612
  }
7594
7613
  setupGooglePayClient() {