graycoreio/daffodil

View on GitHub
libs/customer-payment-authorizenet/driver/src/interfaces/payment-service.interface.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Observable } from 'rxjs';

import { createSingletonInjectionToken } from '@daffodil/core';
import { DaffCustomerPaymentAuthorizeNetApplyRequest } from '@daffodil/customer-payment-authorizenet';
import { DaffPaymentResponse } from '@daffodil/payment';
import { DaffPaymentDriverInterface } from '@daffodil/payment/driver';

export const {
  /**
   * An injection token for the customer authorize.net payment driver.
   */
  token: DaffCustomerPaymentAuthorizeNetPaymentDriver,
  /**
   * Provider function for {@link DaffCustomerPaymentAuthorizeNetPaymentDriver}.
   */
  provider: provideDaffCustomerPaymentAuthorizeNetPaymentDriver,
} = createSingletonInjectionToken<DaffCustomerPaymentAuthorizeNetPaymentDriverInterface>('DaffCustomerPaymentAuthorizeNetPaymentDriver');

/**
 * @inheritdoc
 */
export interface DaffCustomerPaymentAuthorizeNetPaymentDriverInterface extends DaffPaymentDriverInterface<DaffPaymentResponse> {
  generateToken(request: DaffCustomerPaymentAuthorizeNetApplyRequest): Observable<DaffPaymentResponse>;
}