File

feature-libs/checkout/core/connectors/payment/checkout-payment.connector.ts

Index

Methods

Constructor

constructor(adapter: CheckoutPaymentAdapter)
Parameters :
Name Type Optional
adapter CheckoutPaymentAdapter No

Methods

Public create
create(userId: string, cartId: string, paymentDetails: PaymentDetails)
Parameters :
Name Type Optional
userId string No
cartId string No
paymentDetails PaymentDetails No
Returns : Observable<PaymentDetails>
getCardTypes
getCardTypes()
Public set
set(userId: string, cartId: string, paymentDetailsId: string)
Parameters :
Name Type Optional
userId string No
cartId string No
paymentDetailsId string No
Returns : Observable<any>
import { Injectable } from '@angular/core';
import { CardType, PaymentDetails } from '@spartacus/core';
import { Observable } from 'rxjs';
import { CheckoutPaymentAdapter } from './checkout-payment.adapter';

@Injectable()
export class CheckoutPaymentConnector {
  constructor(protected adapter: CheckoutPaymentAdapter) {}

  public create(
    userId: string,
    cartId: string,
    paymentDetails: PaymentDetails
  ): Observable<PaymentDetails> {
    return this.adapter.create(userId, cartId, paymentDetails);
  }

  public set(
    userId: string,
    cartId: string,
    paymentDetailsId: string
  ): Observable<any> {
    return this.adapter.set(userId, cartId, paymentDetailsId);
  }

  getCardTypes(): Observable<CardType[]> {
    return this.adapter.loadCardTypes();
  }
}

result-matching ""

    No results matching ""