{"version":3,"file":"daffodil-authorizenet-driver.mjs","names":[],"sources":["../../../libs/authorizenet/driver/src/interfaces/authorize-net-config.interface.ts","../../../libs/authorizenet/driver/src/interfaces/authorize-net-service.interface.ts","../../../libs/authorizenet/driver/src/interfaces/authorize-net-payment-id.token.ts","../../../libs/authorizenet/driver/src/interfaces/payment-service.interface.ts","../../../libs/authorizenet/driver/src/errors/error-codes.enum.ts","../../../libs/authorizenet/driver/src/errors/acceptjs_invalid.ts","../../../libs/authorizenet/driver/src/errors/acceptjs_missing.ts","../../../libs/authorizenet/driver/src/errors/auth-failed.ts","../../../libs/authorizenet/driver/src/errors/input-missing.ts","../../../libs/authorizenet/driver/src/errors/insecure-connection.ts","../../../libs/authorizenet/driver/src/errors/invalid-api-response.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-cvv.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-exp-month.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-exp-year.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-name.ts","../../../libs/authorizenet/driver/src/errors/invalid-cc-number.ts","../../../libs/authorizenet/driver/src/errors/invalid-client-key.ts","../../../libs/authorizenet/driver/src/errors/invalid-login-id.ts","../../../libs/authorizenet/driver/src/errors/invalid-postal-code.ts","../../../libs/authorizenet/driver/src/errors/past-cc-expiration.ts","../../../libs/authorizenet/driver/src/errors/error-code-map.ts","../../../libs/authorizenet/driver/src/errors/unconfigured.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nexport const {\n  token: DaffAuthorizeNetConfigToken,\n  /**\n   * Provider function for {@link DaffAuthorizeNetConfigToken}.\n   */\n  provider: provideDaffAuthorizeNetConfigToken,\n} = createSingleInjectionToken<DaffAuthorizeNetConfig>('DaffAuthorizeNetConfigToken');\n\n/**\n * An interface for providing @daffodil/authorizenet with needed configurations specific to your authorizenet\n * endpoint.\n */\nexport interface DaffAuthorizeNetConfig {\n  clientKey: string;\n  apiLoginID: string;\n}\n","import { Observable } from 'rxjs';\n\nimport { DaffAuthorizeNetTokenRequest } from '@daffodil/authorizenet';\nimport { createSingletonInjectionToken } from '@daffodil/core';\n\nexport const {\n  token: DaffAuthorizeNetDriver,\n  /**\n   * Provider function for {@link DaffAuthorizeNetDriver}.\n   */\n  provider: provideDaffAuthorizeNetDriver,\n} = createSingletonInjectionToken<DaffAuthorizeNetService>('DaffAuthorizeNetDriver');\n\nexport interface DaffAuthorizeNetService<T extends DaffAuthorizeNetTokenRequest = DaffAuthorizeNetTokenRequest> {\n  generateToken(paymentTokenRequest: T): Observable<any>;\n}\n","import { createSingleInjectionToken } from '@daffodil/core';\n\nexport const {\n  token: DaffAuthorizeNetPaymentId,\n  /**\n   * Provider function for {@link DaffAuthorizeNetPaymentId}.\n   */\n  provider: provideDaffAuthorizeNetPaymentId,\n} = createSingleInjectionToken<string>('DaffAuthorizeNetPaymentId');\n","import { Observable } from 'rxjs';\n\nimport {\n  DaffAuthorizenetPaymentRequest,\n  DaffAuthorizenetPaymentResponse,\n} from '@daffodil/authorizenet';\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport { DaffPaymentDriverInterface } from '@daffodil/payment/driver';\n\nexport const {\n  /**\n   * An injection token for the authorize.net payment driver.\n   */\n  token: DaffAuthorizeNetPaymentDriver,\n  /**\n   * Provider function for {@link DaffAuthorizeNetPaymentDriver}.\n   */\n  provider: provideDaffAuthorizeNetPaymentDriver,\n} = createSingletonInjectionToken<DaffAuthorizeNetPaymentDriverInterface>('DaffAuthorizeNetPaymentDriver');\n\n/**\n * @inheritdoc\n */\nexport interface DaffAuthorizeNetPaymentDriverInterface<\n  T extends DaffAuthorizenetPaymentResponse = DaffAuthorizenetPaymentResponse,\n> extends DaffPaymentDriverInterface<T> {\n  generateToken(request: DaffAuthorizenetPaymentRequest): Observable<T>;\n}\n","/**\n * The error codes for Authorize.net driver errors.\n * See {@link DaffError} and {@link DaffStateError}.\n */\nexport enum DaffAuthorizeNetDriverErrorCodes {\n  ACCEPTJS_INVALID = 'DAFF_AUTHORIZE_NET_ACCEPTJS_INVALID',\n  ACCEPTJS_MISSING = 'DAFF_AUTHORIZE_NET_ACCEPTJS_MISSING',\n  AUTH_FAILED = 'DAFF_AUTHORIZE_NET_AUTH_FAILED',\n  INPUT_MISSING = 'DAFF_AUTHORIZE_NET_INPUT_MISSING',\n  INSECURE_CONNECTION = 'DAFF_AUTHORIZE_NET_INSECURE_CONNECTION',\n  INVALID_API_RESPONSE = 'DAFF_AUTHORIZE_NET_INVALID_API_RESPONSE',\n  INVALID_CC_CVV = 'DAFF_AUTHORIZE_NET_INVALID_CC_CVV',\n  INVALID_CC_EXP_MONTH = 'DAFF_AUTHORIZE_NET_INVALID_CC_EXP_MONTH',\n  INVALID_CC_EXP_YEAR = 'DAFF_AUTHORIZE_NET_INVALID_CC_EXP_YEAR',\n  INVALID_CC_NAME = 'DAFF_AUTHORIZE_NET_INVALID_CC_NAME',\n  INVALID_CC_NUMBER = 'DAFF_AUTHORIZE_NET_INVALID_CC_NUMBER',\n  INVALID_CLIENT_KEY = 'DAFF_AUTHORIZE_NET_INVALID_CLIENT_KEY',\n  INVALID_LOGIN_ID = 'DAFF_AUTHORIZE_NET_INVALID_LOGIN_ID',\n  INVALID_POSTAL_CODE = 'DAFF_AUTHORIZE_NET_INVALID_POSTAL_CODE',\n  PAST_CC_EXPIRATION = 'DAFF_AUTHORIZE_NET_PAST_CC_EXPIRATION',\n  UNCONFIGURED = 'DAFF_AUTHORIZE_NET_UNCONFIGURED',\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when Accept.js has been loaded incorrectly.\n * This can be caused by the script being loaded from a local source\n * or when the browser or proxy has improperly cached an older version of the script.\n */\nexport class DaffAuthorizeNetAcceptjsInvalidError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.ACCEPTJS_INVALID;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when Accept.js has not been loaded.\n */\nexport class DaffAuthorizeNetAcceptjsMissingError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.ACCEPTJS_MISSING;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when either the API Login ID or Public Client Key values are incorrect.\n */\nexport class DaffAuthorizeNetAuthFailedError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.AUTH_FAILED;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when required information is missing from the request payload.\n */\nexport class DaffAuthorizeNetInputMissingError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INPUT_MISSING;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when requests are not made over HTTPS.\n */\nexport class DaffAuthorizeNetInsecureConnectionError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INSECURE_CONNECTION;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the platform response is missing key information or malformed in an unrecoverable way.\n */\nexport class DaffAuthorizeNetInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_API_RESPONSE;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card cvv number is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCCVVError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_CVV;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card expiration month is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCExpMonthError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_EXP_MONTH;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card expiration year is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCExpYearError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_EXP_YEAR;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the cardholder name is invalid.\n * It should be no more than 64 characters in length.\n */\nexport class DaffAuthorizeNetInvalidCCNameError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_NAME;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card number is invalid.\n */\nexport class DaffAuthorizeNetInvalidCCNumberError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CC_NUMBER;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the `clientKey` value with which the Authorize.net driver has been configured is invalid or missing.\n *\n * @see {@link DaffAuthorizeNetConfig}\n */\nexport class DaffAuthorizeNetInvalidClientKeyError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_CLIENT_KEY;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the `apiLoginID` value with which the Authorize.net driver has been configured is invalid or missing.\n *\n * @see {@link DaffAuthorizeNetConfig}\n */\nexport class DaffAuthorizeNetInvalidLoginIdError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_LOGIN_ID;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the postal code is invalid.\n * It should be no more than 20 characters in length.\n */\nexport class DaffAuthorizeNetInvalidPostalCodeError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.INVALID_POSTAL_CODE;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the credit card expiration date is in the past.\n */\nexport class DaffAuthorizeNetPastCCExpirationError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.PAST_CC_EXPIRATION;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n","import { DaffAuthorizeNetAcceptjsInvalidError } from './acceptjs_invalid';\nimport { DaffAuthorizeNetAcceptjsMissingError } from './acceptjs_missing';\nimport { DaffAuthorizeNetAuthFailedError } from './auth-failed';\nimport { DaffAuthorizeNetInputMissingError } from './input-missing';\nimport { DaffAuthorizeNetInsecureConnectionError } from './insecure-connection';\nimport { DaffAuthorizeNetInvalidCCCVVError } from './invalid-cc-cvv';\nimport { DaffAuthorizeNetInvalidCCExpMonthError } from './invalid-cc-exp-month';\nimport { DaffAuthorizeNetInvalidCCExpYearError } from './invalid-cc-exp-year';\nimport { DaffAuthorizeNetInvalidCCNameError } from './invalid-cc-name';\nimport { DaffAuthorizeNetInvalidCCNumberError } from './invalid-cc-number';\nimport { DaffAuthorizeNetInvalidClientKeyError } from './invalid-client-key';\nimport { DaffAuthorizeNetInvalidLoginIdError } from './invalid-login-id';\nimport { DaffAuthorizeNetInvalidPostalCodeError } from './invalid-postal-code';\nimport { DaffAuthorizeNetPastCCExpirationError } from './past-cc-expiration';\n\n/**\n * A mapping from the Authorize.net platform error codes to Daffodil driver error classes.\n */\nexport const DAFF_AUTHORIZE_NET_ERROR_CODE_MAP = {\n  E_WC_01: DaffAuthorizeNetAcceptjsMissingError,\n  E_WC_02: DaffAuthorizeNetInsecureConnectionError,\n  E_WC_03: DaffAuthorizeNetAcceptjsInvalidError,\n  E_WC_04: DaffAuthorizeNetInputMissingError,\n  E_WC_05: DaffAuthorizeNetInvalidCCNumberError,\n  E_WC_06: DaffAuthorizeNetInvalidCCExpMonthError,\n  E_WC_07: DaffAuthorizeNetInvalidCCExpYearError,\n  E_WC_08: DaffAuthorizeNetPastCCExpirationError,\n  E_WC_10: DaffAuthorizeNetInvalidLoginIdError,\n  E_WC_13: DaffAuthorizeNetAcceptjsInvalidError,\n  E_WC_15: DaffAuthorizeNetInvalidCCCVVError,\n  E_WC_16: DaffAuthorizeNetInvalidPostalCodeError,\n  E_WC_17: DaffAuthorizeNetInvalidCCNameError,\n  E_WC_18: DaffAuthorizeNetInvalidClientKeyError,\n  E_WC_19: DaffAuthorizeNetInvalidLoginIdError,\n  E_WC_21: DaffAuthorizeNetAuthFailedError,\n  E_WC_23: DaffAuthorizeNetInputMissingError,\n};\n","import {\n  DaffError,\n  DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthorizeNetDriverErrorCodes } from './error-codes.enum';\n\n/**\n * An error thrown when the driver config is missing required information for the driver to function.\n */\nexport class DaffAuthorizeNetUnconfiguredError extends DaffInheritableError implements DaffError {\n  public readonly code: string = DaffAuthorizeNetDriverErrorCodes.UNCONFIGURED;\n\n  constructor(public message: string) {\n    super(message);\n  }\n}\n"],"mappings":";AAEA,MAAa,EACX,OAAO,6BAIP,UAAU,uCACR,2BAAmD,6BAA6B;ACHpF,MAAa,EACX,OAAO,wBAIP,UAAU,kCACR,8BAAuD,wBAAwB;ACTnF,MAAa,EACX,OAAO,2BAIP,UAAU,qCACR,2BAAmC,2BAA2B;ACClE,MAAa,EAIX,OAAO,+BAIP,UAAU,yCACR,8BAAsE,+BAA+B;ACdzG,IAAY;CAAZ,SAAY,kCAAgC;CAC1C,iCAAA,sBAAA;CACA,iCAAA,sBAAA;CACA,iCAAA,iBAAA;CACA,iCAAA,mBAAA;CACA,iCAAA,yBAAA;CACA,iCAAA,0BAAA;CACA,iCAAA,oBAAA;CACA,iCAAA,0BAAA;CACA,iCAAA,yBAAA;CACA,iCAAA,qBAAA;CACA,iCAAA,uBAAA;CACA,iCAAA,wBAAA;CACA,iCAAA,sBAAA;CACA,iCAAA,yBA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