@xsolla/payment-client-core 0.2.57 → 0.2.59

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.
@@ -3,23 +3,25 @@ import { ApplePayError, ApplePayShippingContact, ApplePayShippingContactUpdate }
3
3
  import { ApplePayParams } from '../apple-pay-params.interface';
4
4
  import { UpdatedPrice } from '../updated-price.interface';
5
5
  import { ShippingAddress } from '../shipping-address.interface';
6
- import { ApplePayExternalWindowCommunicationService } from '../external-window-communication/external-window-communication.service';
6
+ import { XpsResponse } from '../../../payment/xps-response.interface';
7
+ import { SummaryFinanceDetailsAdapterService } from '../../../payment/finance-details/summary/summary-finance-details-adapter.service';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class ApplePayCartService {
9
- private readonly externalWindowCommunicationService;
10
+ private readonly summaryFinanceDetailsAdapterService;
10
11
  private readonly cartSuccessfulRecalculated;
11
12
  private readonly cartErrorRecalculated;
12
13
  private readonly cartRecalculationRequest;
13
14
  get cartSuccessfulRecalculated$(): Observable<UpdatedPrice>;
14
15
  get cartErrorRecalculated$(): Observable<ApplePayError>;
15
16
  get cartRecalculationRequest$(): Observable<ShippingAddress>;
16
- constructor(externalWindowCommunicationService: ApplePayExternalWindowCommunicationService);
17
+ constructor(summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService);
17
18
  recalculateCartTaxes(shippingContact: ApplePayShippingContact): void;
18
19
  buildShippingContactUpdate(paymentParams: ApplePayParams, updatedPrice: UpdatedPrice): ApplePayShippingContactUpdate;
19
- sendSuccessfulRecalculatedCart(updatedPrice: UpdatedPrice): void;
20
+ sendSuccessfulRecalculatedCart(xpsResponse: XpsResponse): void;
20
21
  sendErrorRecalculatedCart(error: ApplePayError): void;
21
22
  isZipCountry(country: string): boolean;
22
23
  private getLineItems;
24
+ private getTotalAmount;
23
25
  static ɵfac: i0.ɵɵFactoryDeclaration<ApplePayCartService, never>;
24
26
  static ɵprov: i0.ɵɵInjectableDeclaration<ApplePayCartService>;
25
27
  }
@@ -13,6 +13,14 @@ import { StartSessionParams } from './session-handlers/start-session-params.inte
13
13
  import { ApplePaySdkService } from './apple-pay-sdk.service';
14
14
  import { ApplePayExternalWindowCommunicationService } from './external-window-communication/external-window-communication.service';
15
15
  import { ApplePayCartService } from './apple-pay-cart/apple-pay-cart.service';
16
+ import { RecalculateCartMessage } from './socket-messages/recalculate-cart-message.interface';
17
+ import { ApplePaySendTokenMessage } from './socket-messages/send-token-message.interface';
18
+ import { WindowCloseMessage } from './socket-messages/window-close-message.interface';
19
+ import { ReturnMessage } from './socket-messages/return-message.interface';
20
+ import { SettingsService } from '../../settings/settings.service';
21
+ import { ShippingAddress } from './shipping-address.interface';
22
+ import { ApplePayShippingContact } from './session-handlers/apple-pay-session.interface';
23
+ import { UpdatedPrice } from './updated-price.interface';
16
24
  import * as i0 from "@angular/core";
17
25
  export declare class ApplePayService {
18
26
  private readonly window;
@@ -24,6 +32,7 @@ export declare class ApplePayService {
24
32
  private readonly applePaySdkService;
25
33
  private readonly externalWindowCommunicationService;
26
34
  private readonly applePayCartService;
35
+ private readonly settingsService;
27
36
  private readonly payment;
28
37
  private readonly error;
29
38
  private readonly integrationType;
@@ -39,7 +48,11 @@ export declare class ApplePayService {
39
48
  get applePayQrOpened$(): Observable<void>;
40
49
  get windowClosing$(): Observable<void>;
41
50
  get integrationType$(): Observable<ApplePayIntegration>;
42
- constructor(window: ExtendedWindow, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService, braintreeHandler: BraintreeHandler, checkoutHandler: CheckoutHandler, appleParamsBuilder: ApplePayParamsBuilderService, elkLoggerService: ElkLoggerService, applePaySdkService: ApplePaySdkService, externalWindowCommunicationService: ApplePayExternalWindowCommunicationService, applePayCartService: ApplePayCartService);
51
+ get getCartRecalculationMessage$(): Observable<RecalculateCartMessage>;
52
+ get getWindowSendTokenMessage$(): Observable<ApplePaySendTokenMessage>;
53
+ get getWindowClose$(): Observable<WindowCloseMessage>;
54
+ get getWindowReturnMessage$(): Observable<ReturnMessage>;
55
+ constructor(window: ExtendedWindow, summaryFinanceDetailsAdapterService: SummaryFinanceDetailsAdapterService, braintreeHandler: BraintreeHandler, checkoutHandler: CheckoutHandler, appleParamsBuilder: ApplePayParamsBuilderService, elkLoggerService: ElkLoggerService, applePaySdkService: ApplePaySdkService, externalWindowCommunicationService: ApplePayExternalWindowCommunicationService, applePayCartService: ApplePayCartService, settingsService: SettingsService);
43
56
  addApplePaySdkJs(): void;
44
57
  removeListeners(): void;
45
58
  setApplePayParams(data: {
@@ -47,7 +60,9 @@ export declare class ApplePayService {
47
60
  }): void;
48
61
  initBraintreeLibrary(tokenKey: string): Promise<void>;
49
62
  initApplePay(tokenKey: string): Promise<void>;
50
- redirectToPaymentPage(parameters: ApplePayParams, token: string, isSandbox?: boolean): Promise<string | undefined>;
63
+ startWindowCommunication(): Promise<void>;
64
+ sendUpdatedPriceViaWindowCommunication(updatedPrice: UpdatedPrice): void;
65
+ redirectToPaymentPage(parameters: ApplePayParams, token: string, isSandbox?: boolean): string | undefined;
51
66
  setOrder(data: {
52
67
  paymentForm: PaymentForm;
53
68
  }): void;
@@ -58,6 +73,8 @@ export declare class ApplePayService {
58
73
  };
59
74
  updateApplePayParams(data: unknown): void;
60
75
  proceedCheckout(parameters: ApplePayParams, additionalParams: StartSessionParams): void;
76
+ mapShippingAddressToContact(shippingAddress: ShippingAddress): ApplePayShippingContact;
77
+ setToken(token: string): void;
61
78
  private getSessionHandler;
62
79
  private loadBraintree;
63
80
  private emitError;
@@ -65,7 +82,6 @@ export declare class ApplePayService {
65
82
  private subscribeToHandlers;
66
83
  private getIntegrationType;
67
84
  private emitApplePayOpened;
68
- private listenWebsocketMessages;
69
85
  static ɵfac: i0.ɵɵFactoryDeclaration<ApplePayService, never>;
70
86
  static ɵprov: i0.ɵɵInjectableDeclaration<ApplePayService>;
71
87
  }
@@ -14,7 +14,7 @@ export declare class ApplePayExternalWindowCommunicationService {
14
14
  private readonly socketBridgeService;
15
15
  private websocketClient;
16
16
  constructor(window: ExtendedWindow, webSocketFactory: WebSocketFactory, socketBridgeService: SocketBridgeService);
17
- getWindowClose$(): Observable<boolean | WindowCloseMessage>;
17
+ getWindowClose$(): Observable<WindowCloseMessage>;
18
18
  getWindowReturnMessage$(): Observable<ReturnMessage>;
19
19
  getWindowSendTokenMessage$(): Observable<ApplePaySendTokenMessage>;
20
20
  getCartRecalculationMessage$(): Observable<RecalculateCartMessage>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/payment-client-core",
3
- "version": "0.2.57",
3
+ "version": "0.2.59",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.3",
6
6
  "@angular/core": "^17.3.3",