npm package: @sourceallies/payment-gateway
Description: Javascript helper package for Source Allies Payment Gateway
Author: Source Allies
Latest version: 0.10.5


<a name="readmemd"></a>

# @sourceallies/payment-gateway

# Introduction

[![npm version](https://badge.fury.io/js/%40sourceallies%2Fpayment-gateway.svg)](https://badge.fury.io/js/%40sourceallies%2Fpayment-gateway)

NPM package used to interface your website with [Source Allies Payment Gateway](https://www.sourceallies.com/payment-gateway). The developer documentation for this package [can be found here](https://sourceallies.github.io/payment-gateway-docs/@sourceallies/payment-gateway/latest/index.html). A tutorial of how to integrate Payment Gateway with your website [can be found here](https://www.sourceallies.com/payment-gateway/developer).

# Enums


<a name="enumsenvironmentmd"></a>

## Enumeration: Environment

### Index

#### Enumeration members

* [DEV](#dev)
* [LOCAL](#local)
* [PROD](#prod)
* [QUAL](#qual)

### Enumeration members

#### DEV

•  **DEV**:  = "DEV"


___

#### LOCAL

•  **LOCAL**:  = "LOCAL"


___

#### PROD

•  **PROD**:  = "PROD"


___

#### QUAL

•  **QUAL**:  = "QUAL"



<a name="globalsmd"></a>

# Documentation - v0.10.5

## Index

### Enumerations

* [Environment](#enumsenvironmentmd)

### Interfaces

* [AuthData](#interfacesauthdatamd)
* [BankData](#interfacesbankdatamd)
* [BillTo](#interfacesbilltomd)
* [BuildApplePayRequestParams](#interfacesbuildapplepayrequestparamsmd)
* [BuildGooglePayRequestParams](#interfacesbuildgooglepayrequestparamsmd)
* [CardData](#interfacescarddatamd)
* [Customer](#interfacescustomermd)
* [CustomerProfile](#interfacescustomerprofilemd)
* [ExtendedAmountType](#interfacesextendedamounttypemd)
* [GatewayData](#interfacesgatewaydatamd)
* [Interval](#interfacesintervalmd)
* [LineItemSingle](#interfaceslineitemsinglemd)
* [LineItemsRecurring](#interfaceslineitemsrecurringmd)
* [LineItemsSingle](#interfaceslineitemssinglemd)
* [Order](#interfacesordermd)
* [ParsedCardData](#interfacesparsedcarddatamd)
* [Payment](#interfacespaymentmd)
* [PaymentSchedule](#interfacespaymentschedulemd)
* [ProcessPaymentOptions](#interfacesprocesspaymentoptionsmd)
* [RequestData](#interfacesrequestdatamd)
* [RequestDataParams](#interfacesrequestdataparamsmd)
* [SecureData](#interfacessecuredatamd)
* [ShipTo](#interfacesshiptomd)
* [SubscriptionData](#interfacessubscriptiondatamd)
* [SubscriptionRequest](#interfacessubscriptionrequestmd)
* [TransactionData](#interfacestransactiondatamd)
* [TransactionRequest](#interfacestransactionrequestmd)
* [ValidationData](#interfacesvalidationdatamd)

### Type aliases

* [AccountType](#accounttype)

### Variables

* [NUMBERS\_REGEX](#numbers_regex)

### Functions

* [buildApplePayRequestData](#buildapplepayrequestdata)
* [buildApplePayTransactionRequestData](#buildapplepaytransactionrequestdata)
* [buildApplePayValidationRequestData](#buildapplepayvalidationrequestdata)
* [buildGooglePayRequestData](#buildgooglepayrequestdata)
* [buildGooglePayTransactionRequestData](#buildgooglepaytransactionrequestdata)
* [buildRequestData](#buildrequestdata)
* [buildSubscriptionRequestData](#buildsubscriptionrequestdata)
* [buildTransactionRequestData](#buildtransactionrequestdata)
* [encryptPaymentData](#encryptpaymentdata)
* [getMerchantDetails](#getmerchantdetails)
* [isBankDataValid](#isbankdatavalid)
* [isCardDataValid](#iscarddatavalid)
* [passesLuhnAlgorithm](#passesluhnalgorithm)
* [processApplePayRequest](#processapplepayrequest)
* [processApplePayTransactionRequest](#processapplepaytransactionrequest)
* [processApplePayValidationRequest](#processapplepayvalidationrequest)
* [processGooglePayRequest](#processgooglepayrequest)
* [processGooglePayTransactionRequest](#processgooglepaytransactionrequest)
* [processPayment](#processpayment)
* [processSubscription](#processsubscription)
* [processSubscriptionRequest](#processsubscriptionrequest)
* [processTransaction](#processtransaction)
* [processTransactionRequest](#processtransactionrequest)
* [validateApplePayRequest](#validateapplepayrequest)

## Type aliases

### AccountType

Ƭ  **AccountType**: \"checking\" \| \"savings\" \| \"businessChecking\"


## Variables

### NUMBERS\_REGEX

• `Const` **NUMBERS\_REGEX**: RegExp = /^[0-9]+$/


## Functions

### buildApplePayRequestData

▸ **buildApplePayRequestData**(`__namedParameters`: { amount: string ; billTo: undefined \| [BillTo](#interfacesbilltomd) ; customer: undefined \| [Customer](#interfacescustomermd) ; gatewayData: [GatewayData](#interfacesgatewaydatamd) ; lineItems: undefined \| [LineItemSingle](#interfaceslineitemsinglemd)[] \| [LineItemsRecurring](#interfaceslineitemsrecurringmd)[] ; order: [Order](#interfacesordermd) ; paymentData: undefined \| null \| ApplePayPayment ; paymentSchedule: undefined \| [PaymentSchedule](#interfacespaymentschedulemd) ; phoneNumber: undefined \| string ; preferredName: undefined \| string ; surcharge: undefined \| [ExtendedAmountType](#interfacesextendedamounttypemd)  }): [TransactionData](#interfacestransactiondatamd) \| [SubscriptionData](#interfacessubscriptiondatamd) \| null


Creates the [TransactionData](#interfacestransactiondatamd) [SubscriptionData](#interfacessubscriptiondatamd) object with the correct fields.
`paymentData` is derived from the argument of the function you define for
Apple Pay's `applePaySession.onpaymentauthorized` function. Apple Pay will
pass in an event to the function you defined. This event will have a property
called `payment`. `event.payment` is what needs to be passed as the
`paymentData` argument of this function.

If you do not specify the
`billTo` parameter, the following fields are required for `paymentData`
(Apple Pay may not set these values in `event.payment`):
- `paymentData.billingContact`
- `paymentData.billingContact.givenName`
- `paymentData.billingContact.familyName`
Leaving these fields out may cause unexpected behavior. See
[Apple Pay Web Reference](https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api)
for more details.

If the `lineItems` parameter is not passed in,
the following one will be added as a line item:
 ```javascript
 listItems = [
     {
         itemId: 'invoice',
         name: 'Invoice Payment',
         unitPrice: parseFloat(requestData.amount),
         quantity: 1
     }
 ];
 ```
This requires `amount` to be able to be parsed to a float. If it is not,
`null` is returned.

__Return Value__

The return value is then used in [processTransaction](#processtransaction) or [processSubscription](#processsubscription).

#### Parameters:

Name | Type |
------ | ------ |
`__namedParameters` | { amount: string ; billTo: undefined \| [BillTo](#interfacesbilltomd) ; customer: undefined \| [Customer](#interfacescustomermd) ; gatewayData: [GatewayData](#interfacesgatewaydatamd) ; lineItems: undefined \| [LineItemSingle](#interfaceslineitemsinglemd)[] \| [LineItemsRecurring](#interfaceslineitemsrecurringmd)[] ; order: [Order](#interfacesordermd) ; paymentData: undefined \| null \| ApplePayPayment ; paymentSchedule: undefined \| [PaymentSchedule](#interfacespaymentschedulemd) ; phoneNumber: undefined \| string ; preferredName: undefined \| string ; surcharge: undefined \| [ExtendedAmountType](#interfacesextendedamounttypemd)  } |

**Returns:** [TransactionData](#interfacestransactiondatamd) \| [SubscriptionData](#interfacessubscriptiondatamd) \| null

   The transaction data, subscription data, or null

___

### buildApplePayTransactionRequestData

▸ **buildApplePayTransactionRequestData**(`paymentData`: ApplePayPayment \| null \| undefined, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `amount`: string, `order`: [Order](#interfacesordermd), `customer?`: [Customer](#interfacescustomermd), `lineItems?`: [LineItemSingle](#interfaceslineitemsinglemd)[], `billTo?`: [BillTo](#interfacesbilltomd)): [TransactionData](#interfacestransactiondatamd) \| null


**`deprecated`** please use [processApplePayRequest](#processapplepayrequest)

Creates the [TransactionData](#interfacestransactiondatamd) object with the correct fields.
`paymentData` is derived from the argument of the function you define for
Apple Pay's `applePaySession.onpaymentauthorized` function. Apple Pay will
pass in an event to the function you defined. This event will have a property
called `payment`. `event.payment` is what needs to be passed as the
`paymentData` argument of this function.

If you do not specify the
`billTo` parameter, the following fields are required for `paymentData`
(Apple Pay may not set these values in `event.payment`):
- `paymentData.billingContact`
- `paymentData.billingContact.givenName`
- `paymentData.billingContact.familyName`
Leaving these fields out may cause unexpected behavior. See
[Apple Pay Web Reference](https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api)
for more details.

If the `lineItems` parameter is not passed in,
the following one will be added as a line item:
 ```javascript
 listItems = [
     {
         itemId: 'invoice',
         name: 'Invoice Payment',
         unitPrice: parseFloat(requestData.amount),
         quantity: 1
     }
 ];
 ```
This requires `amount` to be able to be parsed to a float. If it is not,
`null` is returned.

__Return Value__

The return value is then used in [processTransaction](#processtransaction).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`paymentData` | ApplePayPayment \| null \| undefined |       The argument passed into Apple's `applePaySession.onpaymentauthorized`      function. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`amount` | string |       The monetary value of the transaction being processed. This must be in      the form of a number. |
`order` | [Order](#interfacesordermd) |       An object containing the order description and invoice number. |
`customer?` | [Customer](#interfacescustomermd) |       An object containing customer email. |
`lineItems?` | [LineItemSingle](#interfaceslineitemsinglemd)[] |       Line items you want included in the transaction. |
`billTo?` | [BillTo](#interfacesbilltomd) |       Bill to information for the paying user. This parameter is optional. If      it is not specified, the bill to information will be built from      paymentData. |

**Returns:** [TransactionData](#interfacestransactiondatamd) \| null

     Transaction data ready to be called with `processTransaction` if paymentData is not null,
     or returns null if amount is not a number or paymentData is null.

___

### buildApplePayValidationRequestData

▸ **buildApplePayValidationRequestData**(`event`: ApplePayValidateMerchantEvent \| null \| undefined, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `clientCanonicalName`: string, `context`: string): [ValidationData](#interfacesvalidationdatamd) \| null


Builds the [ValidationData](#interfacesvalidationdatamd) object. This function should be called in
the `applepaysession.onvalidatemerchant` function you define. The argument
passed in to `applepaysession.onvalidatemerchant` should be passed in as the
`event` parameter.

__Example Usage__

```javascript
applepaysession.onvalidatemerchant = (event) => {
    const validationData = paymentGateway.buildApplePayValidationRequestData(
        event,
        gatewayData,
        clientCanonicalName,
        context
    );
    paymentGateway.validateApplePayRequest(callback, validationData, environment);
}
```

__Return Value__

The return value is then used in [validateApplePayRequest](#validateapplepayrequest).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`event` | ApplePayValidateMerchantEvent \| null \| undefined |       The event paramenter passed in to the applepaysession.onvalidatemerchant      callback. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`clientCanonicalName` | string |       The client canonical name you use for Apple Pay. |
`context` | string |       The hostname of your website. |

**Returns:** [ValidationData](#interfacesvalidationdatamd) \| null

     If event is null or missing property validationURL, null is returned.

___

### buildGooglePayRequestData

▸ **buildGooglePayRequestData**(`__namedParameters`: { amount: string ; billTo: undefined \| [BillTo](#interfacesbilltomd) ; customer: undefined \| [Customer](#interfacescustomermd) ; gatewayData: [GatewayData](#interfacesgatewaydatamd) ; lineItems: undefined \| [LineItemSingle](#interfaceslineitemsinglemd)[] \| [LineItemsRecurring](#interfaceslineitemsrecurringmd)[] ; order: [Order](#interfacesordermd) ; paymentData: undefined \| null \| PaymentData ; paymentSchedule: undefined \| [PaymentSchedule](#interfacespaymentschedulemd) ; phoneNumber: undefined \| string ; preferredName: undefined \| string ; shipTo: undefined \| [ShipTo](#interfacesshiptomd) ; surcharge: undefined \| [ExtendedAmountType](#interfacesextendedamounttypemd)  }): [TransactionData](#interfacestransactiondatamd) \| [SubscriptionData](#interfacessubscriptiondatamd) \| null


Creates the [TransactionData](#interfacestransactiondatamd) [SubscriptionData](#interfacessubscriptiondatamd) object with the correct fields.
paymentData is generated from Google's `paymentsClient.loadPaymentData()`.

If you do not specify the `billTo` parameter, the following properties are
required for `paymentData` (Google Pay may not set these properties):
- `paymentData.paymentMethodData.info`
- `paymentData.paymentMethodData.info.billingAddress`
- `paymentData.paymentMethodData.info.billingAddress.name`
Leaving these fields out may cause unexpected behavior. Make sure
billingAddressRequired is set to `true` in your card parameters if you are
not passing in the `billTo` parameter. See
[Google Pay Web Reference](https://developers.google.com/pay/api/web/reference/request-objects#CardParameters)
for more details.

If the `lineItems` parameter is not passed in,
the following one will be added as a line item:
 ```javascript
 lineItems = [
     {
         itemId: 'invoice',
         name: 'Invoice Payment',
         unitPrice: parseFloat(requestData.amount),
         quantity: 1
     }
 ];
 ```
This requires `amount` to be able to be parsed to a float. If it is not,
`null` is returned.

__Return Value__

The return value is then used in [processTransaction](#processtransaction) or [processSubscription](#processsubscription).

#### Parameters:

Name | Type |
------ | ------ |
`__namedParameters` | { amount: string ; billTo: undefined \| [BillTo](#interfacesbilltomd) ; customer: undefined \| [Customer](#interfacescustomermd) ; gatewayData: [GatewayData](#interfacesgatewaydatamd) ; lineItems: undefined \| [LineItemSingle](#interfaceslineitemsinglemd)[] \| [LineItemsRecurring](#interfaceslineitemsrecurringmd)[] ; order: [Order](#interfacesordermd) ; paymentData: undefined \| null \| PaymentData ; paymentSchedule: undefined \| [PaymentSchedule](#interfacespaymentschedulemd) ; phoneNumber: undefined \| string ; preferredName: undefined \| string ; shipTo: undefined \| [ShipTo](#interfacesshiptomd) ; surcharge: undefined \| [ExtendedAmountType](#interfacesextendedamounttypemd)  } |

**Returns:** [TransactionData](#interfacestransactiondatamd) \| [SubscriptionData](#interfacessubscriptiondatamd) \| null

   The transaction data, subscription data, or null

___

### buildGooglePayTransactionRequestData

▸ **buildGooglePayTransactionRequestData**(`paymentData`: PaymentData \| null \| undefined, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `amount`: string, `order`: [Order](#interfacesordermd), `customer?`: [Customer](#interfacescustomermd), `lineItems?`: [LineItemSingle](#interfaceslineitemsinglemd)[], `billTo?`: [BillTo](#interfacesbilltomd), `shipTo?`: [ShipTo](#interfacesshiptomd), `phoneNumber?`: undefined \| string): [TransactionData](#interfacestransactiondatamd) \| null


**`deprecated`** 

Please use [buildGooglePayRequestData](#buildgooglepayrequestdata)

Creates the [TransactionData](#interfacestransactiondatamd) object with the correct fields.
paymentData is generated from Google's `paymentsClient.loadPaymentData()`.

If you do not specify the `billTo` parameter, the following properties are
required for `paymentData` (Google Pay may not set these properties):
- `paymentData.paymentMethodData.info`
- `paymentData.paymentMethodData.info.billingAddress`
- `paymentData.paymentMethodData.info.billingAddress.name`
Leaving these fields out may cause unexpected behavior. Make sure
billingAddressRequired is set to `true` in your card parameters if you are
not passing in the `billTo` parameter. See
[Google Pay Web Reference](https://developers.google.com/pay/api/web/reference/request-objects#CardParameters)
for more details.

If the `lineItems` parameter is not passed in,
the following one will be added as a line item:
 ```javascript
 lineItems = [
     {
         itemId: 'invoice',
         name: 'Invoice Payment',
         unitPrice: parseFloat(requestData.amount),
         quantity: 1
     }
 ];
 ```
This requires `amount` to be able to be parsed to a float. If it is not,
`null` is returned.

__Return Value__

The return value is then used in [processTransaction](#processtransaction) or [processSubscription](#processsubscription).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`paymentData` | PaymentData \| null \| undefined |       The object returned from Google's `paymentsClient.loadPaymentData()`. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`amount` | string |       The monetary value of the transaction being processed. This must be in      the form of a number. |
`order` | [Order](#interfacesordermd) |       An object containing the order description and invoice number. |
`customer?` | [Customer](#interfacescustomermd) |       An object containing customer email. |
`lineItems?` | [LineItemSingle](#interfaceslineitemsinglemd)[] |       Line items you want included in the transaction. This parameter is      optional. If it is not specified, the default `lineItems` will be used. |
`billTo?` | [BillTo](#interfacesbilltomd) |       Bill to information for the paying user. This parameter is optional. If      it is not specified, the bill to information will be built from      paymentData. |
`shipTo?` | [ShipTo](#interfacesshiptomd) |       Ship to information for the paying user. This parameter is optional. |
`phoneNumber?` | undefined \| string |       Phone number provided by user on the form. This Parameter is optional. |

**Returns:** [TransactionData](#interfacestransactiondatamd) \| null

     Transaction data ready to be called with `processTransaction` if paymentData is not null,
     or returns null if amount is not a number or paymentData is null.

___

### buildRequestData

▸ **buildRequestData**(`requestDataParams`: [RequestDataParams](#interfacesrequestdataparamsmd)): [RequestData](#interfacesrequestdatamd) \| null


Builds the [RequestData](#interfacesrequestdatamd) object to be used in
[buildTransactionRequestData](#buildtransactionrequestdata) or [buildSubscriptionRequestData](#buildsubscriptionrequestdata).
The only fields required for parament `billTo` are `firstName` and
`lastName`. The paremeter `customer` is not required but must have a value
passed in (i.e. `null` if you do not want to use it). The parameter `order`
is only needed for a recurring transaction. Although these are optional, we
highly recommend including all of them in all payments. *NOTE: If you are
using this in a TypeScript node project, all the paremeters will be required
except for the optional ones in the parameter `billTo`.

__Return Value__

The return value is then used in [buildTransactionRequestData](#buildtransactionrequestdata) or
[buildSubscriptionRequestData](#buildsubscriptionrequestdata)

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`requestDataParams` | [RequestDataParams](#interfacesrequestdataparamsmd) |         An object containing the data from the form that has yet to be structured into a proper RequestData type. |

**Returns:** [RequestData](#interfacesrequestdatamd) \| null

     If response is null or it does not contain opaqueData, null is
     returned.

___

### buildSubscriptionRequestData

▸ **buildSubscriptionRequestData**(`requestData`: [RequestData](#interfacesrequestdatamd) \| null, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `paymentSchedule`: [PaymentSchedule](#interfacespaymentschedulemd), `lineItems?`: [LineItemsRecurring](#interfaceslineitemsrecurringmd)[]): [SubscriptionData](#interfacessubscriptiondatamd) \| null


Creates the [SubscriptionData](#interfacessubscriptiondatamd) object containing the correct fields.
`requestData` can be generated by calling [buildRequestData](#buildrequestdata).

If the lineItems` parameter is not passed in, the following one will be
added as a line item:
 ```javascript
 listItems = [
     {
         itemCode: 'invoice',
         name: 'Invoice Payment',
         amount: parseFloat(requestData.amount),
         description: 'invoice payment'
     }
 ];
 ```
This requires `requestData.amount` to be able to be parsed to a float. If it
is not, `null` is returned.

__Return Value__

The return value is then used in [processSubscription](#processsubscription).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`requestData` | [RequestData](#interfacesrequestdatamd) \| null |       The data needed to make the request. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`paymentSchedule` | [PaymentSchedule](#interfacespaymentschedulemd) |       The schedule of the recurring payment. |
`lineItems?` | [LineItemsRecurring](#interfaceslineitemsrecurringmd)[] |       Line items you want included in the subscription. |

**Returns:** [SubscriptionData](#interfacessubscriptiondatamd) \| null

     If requestData is null, null is returned.

___

### buildTransactionRequestData

▸ **buildTransactionRequestData**(`requestData`: [RequestData](#interfacesrequestdatamd) \| null, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `lineItems?`: [LineItemSingle](#interfaceslineitemsinglemd)[]): [TransactionData](#interfacestransactiondatamd) \| null


Creates the [TransactionData](#interfacestransactiondatamd) object containing the correct fields.
`requestData` can be generated by calling [buildRequestData](#buildrequestdata).
If the `lineItems` parameter is not passed in, the following one will be
added as a line item:
 ```javascript
 lineItems = [
     {
         itemId: 'invoice',
         name: 'Invoice Payment',
         unitPrice: parseFloat(requestData.amount),
         quantity: 1
     }
 ];
 ```

__Return Value__

The returned value is then used in [processTransaction](#processtransaction).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`requestData` | [RequestData](#interfacesrequestdatamd) \| null |       The data needed to make the request. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`lineItems?` | [LineItemSingle](#interfaceslineitemsinglemd)[] |       Line items you want included in the transaction. |

**Returns:** [TransactionData](#interfacestransactiondatamd) \| null

     If requestData is null, null is returned.

___

### encryptPaymentData

▸ **encryptPaymentData**(`response`: any \| void, `authorizeNetApiKey`: string, `paymentData`: [CardData](#interfacescarddatamd) \| [BankData](#interfacesbankdatamd)): [SecureData](#interfacessecuredatamd) \| null


Creates the correct payment object to be used in the call to AcceptJS to
encrypt the payment data. The paremeter `response` is the response body of
[getMerchantDetails](#getmerchantdetails).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`response` | any \| void |       The response body as a JavaScript object from HTTP request in      `getMerchantDetails`. |
`authorizeNetApiKey` | string |       Your Authorize.NET API key. |
`paymentData` | [CardData](#interfacescarddatamd) \| [BankData](#interfacesbankdatamd) |       The card or bank payment data that will be used for the request. |

**Returns:** [SecureData](#interfacessecuredatamd) \| null

     If response is void or does not have publicClientKey, null is
     returned.

___

### getMerchantDetails

▸ `Const`**getMerchantDetails**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `env`: [Environment](#enumsenvironmentmd)): void


Makes an HTTP request to get the merchant details from Payment Gateway. When
the response is received, `callbackFunction` is called with the
`XMLHttpRequest` object as the parameter. The body of the HTTP request can
then be parsed to JSON and used in [encryptPaymentData](#encryptpaymentdata).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       The gateway data for your Payment Gateway account. |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to.  |

**Returns:** void

▸ `Const`**getMerchantDetails**(`gatewayData`: [GatewayData](#interfacesgatewaydatamd), `env`: [Environment](#enumsenvironmentmd)): Promise\<XMLHttpRequest>


#### Parameters:

Name | Type |
------ | ------ |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |
`env` | [Environment](#enumsenvironmentmd) |

**Returns:** Promise\<XMLHttpRequest>

___

### isBankDataValid

▸ **isBankDataValid**(`bankData`: [BankData](#interfacesbankdatamd)): boolean


Checks if bank data could possibly be valid by doing basic validation of
the account number and routing number. This function uses the
[Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) to check the
account number and routing number.

> NOTE: this function __does not__ check that the account is actually valid,
only that it __could be__ valid.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`bankData` | [BankData](#interfacesbankdatamd) | The card data to check.  |

**Returns:** boolean

   True if the bank could be valid, false if not.

___

### isCardDataValid

▸ **isCardDataValid**(`cardData`: [CardData](#interfacescarddatamd)): boolean


Checks if a credit card could possibly be valid by doing basic validation of
the card number, CSC, and expiration date. This function uses the
[Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) to check the
card number.

> NOTE: this function __does not__ check that the card is actually valid, only
that it __could be__ valid.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`cardData` | [CardData](#interfacescarddatamd) | The card data to check.  |

**Returns:** boolean

   True if the card could be valid, false if not.

___

### passesLuhnAlgorithm

▸ **passesLuhnAlgorithm**(`number`: string): boolean


Checks if a  number could possibly be valid by using the
[Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm). The number
string passed in must contain only number characters. If there is a
non-number character, there may be unexpected behaviors.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`number` | string | The number to check as a string.  |

**Returns:** boolean

   True if the card number could be valid, false if not.

___

### processApplePayRequest

▸ **processApplePayRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `applePayRequestParams`: [BuildApplePayRequestParams](#interfacesbuildapplepayrequestparamsmd), `env`: [Environment](#enumsenvironmentmd)): void


Wrapper function that calls [buildApplePayRequestData](#buildapplepayrequestdata) then [processTransaction](#processtransaction)
or [processSubscription](#processsubscription). See those functions for additional information.
This function calls [processTransaction](#processtransaction) or [processSubscription](#processsubscription) even
if the return value from [buildTransactionRequestData](#buildtransactionrequestdata) is null. All error
handling must be done in the `callbackFunction` parameter.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`applePayRequestParams` | [BuildApplePayRequestParams](#interfacesbuildapplepayrequestparamsmd) |       The payment parameters |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to.  |

**Returns:** void

___

### processApplePayTransactionRequest

▸ **processApplePayTransactionRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `paymentData`: ApplePayPayment \| null \| undefined, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `amount`: string, `order`: [Order](#interfacesordermd), `env`: [Environment](#enumsenvironmentmd), `customer?`: [Customer](#interfacescustomermd), `lineItems?`: [LineItemSingle](#interfaceslineitemsinglemd)[], `billTo?`: [BillTo](#interfacesbilltomd)): void


**`deprecated`** please use [processApplePayRequest](#processapplepayrequest)

Wrapper function that calls [buildApplePayTransactionRequestData](#buildapplepaytransactionrequestdata) then
[processTransaction](#processtransaction). See those functions for additional information.
This function calls [processTransaction](#processtransaction) even if the return value from
[buildTransactionRequestData](#buildtransactionrequestdata) is null. All error handling must be done
in the `callbackFunction` parameter.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`paymentData` | ApplePayPayment \| null \| undefined |       The argument passed into Apple's `applePaySession.onpaymentauthorized`      function. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`amount` | string |       The monetary value of the transaction being processed. This must be in      the form of a number. |
`order` | [Order](#interfacesordermd) |       An object containing the order description and invoice number. |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to. |
`customer?` | [Customer](#interfacescustomermd) |       An object containing customer email. |
`lineItems?` | [LineItemSingle](#interfaceslineitemsinglemd)[] |       Line items you want included in the transaction. |
`billTo?` | [BillTo](#interfacesbilltomd) |       Bill to information for the paying user. This parameter is optional. If      it is not specified, the bill to information will be built from      paymentData.  |

**Returns:** void

___

### processApplePayValidationRequest

▸ **processApplePayValidationRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `event`: ApplePayValidateMerchantEvent \| null \| undefined, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `clientCanonicalName`: string, `context`: string, `environment`: [Environment](#enumsenvironmentmd)): void


Wrapper function that calls [buildApplePayValidationRequestData](#buildapplepayvalidationrequestdata) then
[validateApplePayRequest](#validateapplepayrequest). See those functions for additional information.
This function calls [validateApplePayRequest](#validateapplepayrequest) even if the return value
from [buildApplePayValidationRequestData](#buildapplepayvalidationrequestdata) is null. All error handling
must be done in the `callbackFunction` parameter.

__Example Usage__

```
applepaysession.onvalidatemerchant = (event) => {
    paymentGateway.processApplePayValidationRequest(
        callbackFunction,
        event,
        gatewayData,
        clientCanonicalName,
        context,
        environment
    );
}
```

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`event` | ApplePayValidateMerchantEvent \| null \| undefined |       The event paramenter passed in to the applepaysession.onvalidatemerchant      callback. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`clientCanonicalName` | string |       The client canonical name you use for Apple Pay. |
`context` | string |       The hostname of your website. |
`environment` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway that you want the request set to.  |

**Returns:** void

___

### processGooglePayRequest

▸ **processGooglePayRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `googlePayRequestParams`: [BuildGooglePayRequestParams](#interfacesbuildgooglepayrequestparamsmd), `env`: [Environment](#enumsenvironmentmd)): void


Wrapper function that calls [buildGooglePayRequestData](#buildgooglepayrequestdata) then [processTransaction](#processtransaction)
or [processSubscription](#processsubscription). See those functions for additional information.
This function calls [processTransaction](#processtransaction) or [processSubscription](#processsubscription) even
if the return value from [buildTransactionRequestData](#buildtransactionrequestdata) is null. All error
handling must be done in the `callbackFunction` parameter.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`googlePayRequestParams` | [BuildGooglePayRequestParams](#interfacesbuildgooglepayrequestparamsmd) |       The payment parameters |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to.  |

**Returns:** void

___

### processGooglePayTransactionRequest

▸ **processGooglePayTransactionRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `paymentData`: PaymentData \| null \| undefined, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `amount`: string, `order`: [Order](#interfacesordermd), `env`: [Environment](#enumsenvironmentmd), `customer?`: [Customer](#interfacescustomermd), `lineItems?`: [LineItemSingle](#interfaceslineitemsinglemd)[], `billTo?`: [BillTo](#interfacesbilltomd)): void


**`deprecated`** 

Please use [processGooglePayRequest](#processgooglepayrequest)

Wrapper function that calls [buildGooglePayTransactionRequestData](#buildgooglepaytransactionrequestdata) then
[processTransaction](#processtransaction). See those functions for additional information.
This function calls [processTransaction](#processtransaction) even if the return value from
[buildGooglePayTransactionRequestData](#buildgooglepaytransactionrequestdata) is null. All error handling must be done
in the `callbackFunction` parameter.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void | - |
`paymentData` | PaymentData \| null \| undefined |       The object returned from Google's `paymentsClient.loadPaymentData()`. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`amount` | string |       The monetary value of the transaction being processed. This must be in      the form of a number. |
`order` | [Order](#interfacesordermd) |       An object containing the order description and invoice number. |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to. |
`customer?` | [Customer](#interfacescustomermd) |       An object containing customer email. |
`lineItems?` | [LineItemSingle](#interfaceslineitemsinglemd)[] |       Line items you want included in the transaction. This parameter is      optional. If it is not specified, the default `lineItems` will be used. |
`billTo?` | [BillTo](#interfacesbilltomd) |       Bill to information for the paying user. This parameter is optional. If      it is not specified, the bill to information will be built from      paymentData.  |

**Returns:** void

___

### processPayment

▸ `Const`**processPayment**(`requestData`: [RequestData](#interfacesrequestdatamd) \| null, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `env`: [Environment](#enumsenvironmentmd), `options?`: [ProcessPaymentOptions](#interfacesprocesspaymentoptionsmd)): Promise\<XMLHttpRequest>


#### Parameters:

Name | Type |
------ | ------ |
`requestData` | [RequestData](#interfacesrequestdatamd) \| null |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |
`env` | [Environment](#enumsenvironmentmd) |
`options?` | [ProcessPaymentOptions](#interfacesprocesspaymentoptionsmd) |

**Returns:** Promise\<XMLHttpRequest>

___

### processSubscription

▸ **processSubscription**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `subscriptionData`: [SubscriptionData](#interfacessubscriptiondatamd) \| null, `env`: [Environment](#enumsenvironmentmd)): void


Makes an HTTP request to process the subscription with Payment Gateway. When
the response is received, `callbackFunction` is called with the
`XMLHttpRequest` object as the parameter. The parameter `subscriptionData` can
be generated by calling [buildSubscriptionRequestData](#buildsubscriptionrequestdata).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`subscriptionData` | [SubscriptionData](#interfacessubscriptiondatamd) \| null |       The subscription data. |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to.  |

**Returns:** void

___

### processSubscriptionRequest

▸ **processSubscriptionRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `requestData`: [RequestData](#interfacesrequestdatamd) \| null, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `paymentSchedule`: [PaymentSchedule](#interfacespaymentschedulemd), `env`: [Environment](#enumsenvironmentmd), `lineItems?`: [LineItemsRecurring](#interfaceslineitemsrecurringmd)[]): void


Wrapper function that calls [buildSubscriptionRequestData](#buildsubscriptionrequestdata) then
[processSubscription](#processsubscription). See those functions for additional information.
This function calls [processSubscription](#processsubscription) even if the return value from
[buildSubscriptionRequestData](#buildsubscriptionrequestdata) is null. All error handling must be done
in the `callbackFunction` parameter.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`requestData` | [RequestData](#interfacesrequestdatamd) \| null |       The data needed to make the request. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`paymentSchedule` | [PaymentSchedule](#interfacespaymentschedulemd) |       The schedule of the recurring payment. |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to. |
`lineItems?` | [LineItemsRecurring](#interfaceslineitemsrecurringmd)[] |       Line items you want included in the subscription.  |

**Returns:** void

___

### processTransaction

▸ **processTransaction**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `transactionData`: [TransactionData](#interfacestransactiondatamd) \| null, `environment`: [Environment](#enumsenvironmentmd)): void


Makes an HTTP request to proccess the transaction with Payment Gateway. When
the response is received, `callbackFunction` is called with the
`XMLHttpRequest` object as the parameter. The parameter `transactionData` can
be generated by calling [buildTransactionRequestData](#buildtransactionrequestdata).

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`transactionData` | [TransactionData](#interfacestransactiondatamd) \| null |       The transaction data. |
`environment` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to.  |

**Returns:** void

___

### processTransactionRequest

▸ **processTransactionRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `requestData`: [RequestData](#interfacesrequestdatamd) \| null, `gatewayData`: [GatewayData](#interfacesgatewaydatamd), `env`: [Environment](#enumsenvironmentmd), `lineItems?`: [LineItemSingle](#interfaceslineitemsinglemd)[]): void


Wrapper function that calls [buildTransactionRequestData](#buildtransactionrequestdata) then
[processTransaction](#processtransaction). See those functions for additional information.
This function calls [processTransaction](#processtransaction) even if the return value from
[buildTransactionRequestData](#buildtransactionrequestdata) is null. All error handling must be done
in the `callbackFunction` parameter.

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`requestData` | [RequestData](#interfacesrequestdatamd) \| null |       The data needed to make the request. |
`gatewayData` | [GatewayData](#interfacesgatewaydatamd) |       Your Payment Gateway partner information. |
`env` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway you want the request sent to. |
`lineItems?` | [LineItemSingle](#interfaceslineitemsinglemd)[] |       Line items you want included in the transaction.  |

**Returns:** void

___

### validateApplePayRequest

▸ **validateApplePayRequest**(`callbackFunction`: (xmlHttpRequest: XMLHttpRequest) => void, `validationData`: [ValidationData](#interfacesvalidationdatamd) \| null, `environment`: [Environment](#enumsenvironmentmd)): void


Validates the [ValidationData](#interfacesvalidationdatamd) that's generated via the
[buildApplePayValidationRequestData](#buildapplepayvalidationrequestdata) function by making a HTTP request
to Payment Gateway. When the response is received, `callbackFunction` is
called with the `XMLHttpRequest` object as the parameter. This function
should be called in the `applepaysession.onvalidatemerchant` function that
you define.

__Example Usage__

```
applepaysession.onvalidatemerchant = (event) => {
    const validationData = paymentGateway.buildApplePayValidationRequestData(
        event,
        gatewayData,
        clientCanonicalName,
        context
    );
    paymentGateway.validateApplePayRequest(callbackFunction, validationData, environment);
}
```

#### Parameters:

Name | Type | Description |
------ | ------ | ------ |
`callbackFunction` | (xmlHttpRequest: XMLHttpRequest) => void |       The function to be called when a response is received. |
`validationData` | [ValidationData](#interfacesvalidationdatamd) \| null |       The validation data. |
`environment` | [Environment](#enumsenvironmentmd) |       The environment of Payment Gateway that you want the request set to.  |

**Returns:** void

# Interfaces


<a name="interfacesauthdatamd"></a>

## Interface: AuthData

### Hierarchy

* **AuthData**

### Index

#### Properties

* [apiLoginID](#apiloginid)
* [clientKey](#clientkey)

### Properties

#### apiLoginID

•  **apiLoginID**: string


___

#### clientKey

•  **clientKey**: string



<a name="interfacesbankdatamd"></a>

## Interface: BankData

### Hierarchy

* **BankData**

### Index

#### Properties

* [accountNumber](#accountnumber)
* [accountType](#accounttype)
* [nameOnAccount](#nameonaccount)
* [routingNumber](#routingnumber)

### Properties

#### accountNumber

•  **accountNumber**: string


___

#### accountType

•  **accountType**: [AccountType](#accounttype)


___

#### nameOnAccount

•  **nameOnAccount**: string


___

#### routingNumber

•  **routingNumber**: string



<a name="interfacesbilltomd"></a>

## Interface: BillTo

### Hierarchy

* [ShipTo](#interfacesshiptomd)

  ↳ **BillTo**

### Index

#### Properties

* [address](#address)
* [city](#city)
* [country](#country)
* [email](#email)
* [faxNumber](#faxnumber)
* [firstName](#firstname)
* [lastName](#lastname)
* [phoneNumber](#phonenumber)
* [state](#state)
* [zip](#zip)

### Properties

#### address

• `Optional` **address**: undefined \| string

*Inherited from [ShipTo](#interfacesshiptomd).[address](#address)*


___

#### city

• `Optional` **city**: undefined \| string

*Inherited from [ShipTo](#interfacesshiptomd).[city](#city)*


___

#### country

• `Optional` **country**: undefined \| string

*Inherited from [ShipTo](#interfacesshiptomd).[country](#country)*


___

#### email

• `Optional` **email**: undefined \| string


___

#### faxNumber

• `Optional` **faxNumber**: undefined \| string


___

#### firstName

•  **firstName**: string

*Inherited from [ShipTo](#interfacesshiptomd).[firstName](#firstname)*


___

#### lastName

•  **lastName**: string

*Inherited from [ShipTo](#interfacesshiptomd).[lastName](#lastname)*


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string


___

#### state

• `Optional` **state**: undefined \| string

*Inherited from [ShipTo](#interfacesshiptomd).[state](#state)*


___

#### zip

• `Optional` **zip**: undefined \| string

*Inherited from [ShipTo](#interfacesshiptomd).[zip](#zip)*



<a name="interfacesbuildapplepayrequestparamsmd"></a>

## Interface: BuildApplePayRequestParams

### Hierarchy

* **BuildApplePayRequestParams**

### Index

#### Properties

* [amount](#amount)
* [billTo](#billto)
* [customer](#customer)
* [gatewayData](#gatewaydata)
* [lineItems](#lineitems)
* [order](#order)
* [paymentData](#paymentdata)
* [paymentSchedule](#paymentschedule)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)
* [surcharge](#surcharge)

### Properties

#### amount

•  **amount**: string


___

#### billTo

• `Optional` **billTo**: [BillTo](#interfacesbilltomd)


___

#### customer

• `Optional` **customer**: [Customer](#interfacescustomermd)


___

#### gatewayData

•  **gatewayData**: [GatewayData](#interfacesgatewaydatamd)


___

#### lineItems

• `Optional` **lineItems**: [LineItemSingle](#interfaceslineitemsinglemd)[] \| [LineItemsRecurring](#interfaceslineitemsrecurringmd)[]


___

#### order

•  **order**: [Order](#interfacesordermd)


___

#### paymentData

•  **paymentData**: ApplePayPayment \| null \| undefined


___

#### paymentSchedule

• `Optional` **paymentSchedule**: [PaymentSchedule](#interfacespaymentschedulemd)


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string


___

#### preferredName

• `Optional` **preferredName**: undefined \| string


___

#### surcharge

• `Optional` **surcharge**: [ExtendedAmountType](#interfacesextendedamounttypemd)



<a name="interfacesbuildgooglepayrequestparamsmd"></a>

## Interface: BuildGooglePayRequestParams

### Hierarchy

* **BuildGooglePayRequestParams**

### Index

#### Properties

* [amount](#amount)
* [billTo](#billto)
* [customer](#customer)
* [gatewayData](#gatewaydata)
* [lineItems](#lineitems)
* [order](#order)
* [paymentData](#paymentdata)
* [paymentSchedule](#paymentschedule)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)
* [shipTo](#shipto)
* [surcharge](#surcharge)

### Properties

#### amount

•  **amount**: string


___

#### billTo

• `Optional` **billTo**: [BillTo](#interfacesbilltomd)


___

#### customer

• `Optional` **customer**: [Customer](#interfacescustomermd)


___

#### gatewayData

•  **gatewayData**: [GatewayData](#interfacesgatewaydatamd)


___

#### lineItems

• `Optional` **lineItems**: [LineItemSingle](#interfaceslineitemsinglemd)[] \| [LineItemsRecurring](#interfaceslineitemsrecurringmd)[]


___

#### order

•  **order**: [Order](#interfacesordermd)


___

#### paymentData

• `Optional` **paymentData**: PaymentData \| null


___

#### paymentSchedule

• `Optional` **paymentSchedule**: [PaymentSchedule](#interfacespaymentschedulemd)


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string


___

#### preferredName

• `Optional` **preferredName**: undefined \| string


___

#### shipTo

• `Optional` **shipTo**: [ShipTo](#interfacesshiptomd)


___

#### surcharge

• `Optional` **surcharge**: [ExtendedAmountType](#interfacesextendedamounttypemd)



<a name="interfacescarddatamd"></a>

## Interface: CardData

### Hierarchy

* **CardData**

### Index

#### Properties

* [cardCode](#cardcode)
* [cardExpiration](#cardexpiration)
* [cardNumber](#cardnumber)
* [fullname](#fullname)
* [zip](#zip)

### Properties

#### cardCode

•  **cardCode**: string


___

#### cardExpiration

•  **cardExpiration**: string


___

#### cardNumber

•  **cardNumber**: string


___

#### fullname

• `Optional` **fullname**: undefined \| string


___

#### zip

• `Optional` **zip**: undefined \| string



<a name="interfacescustomermd"></a>

## Interface: Customer

### Hierarchy

* **Customer**

### Index

#### Properties

* [email](#email)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)

### Properties

#### email

•  **email**: string


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string


___

#### preferredName

• `Optional` **preferredName**: undefined \| string



<a name="interfacescustomerprofilemd"></a>

## Interface: CustomerProfile

### Hierarchy

* **CustomerProfile**

### Index

#### Properties

* [email](#email)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)

### Properties

#### email

• `Optional` **email**: undefined \| string


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string


___

#### preferredName

• `Optional` **preferredName**: undefined \| string



<a name="interfacesextendedamounttypemd"></a>

## Interface: ExtendedAmountType

### Hierarchy

* **ExtendedAmountType**

### Index

#### Properties

* [amount](#amount)
* [description](#description)
* [name](#name)

### Properties

#### amount

•  **amount**: number


___

#### description

• `Optional` **description**: undefined \| string


___

#### name

• `Optional` **name**: undefined \| string



<a name="interfacesgatewaydatamd"></a>

## Interface: GatewayData

### Hierarchy

* **GatewayData**

### Index

#### Properties

* [gatewayName](#gatewayname)
* [partnerName](#partnername)

### Properties

#### gatewayName

•  **gatewayName**: string


___

#### partnerName

•  **partnerName**: string



<a name="interfacesintervalmd"></a>

## Interface: Interval

### Hierarchy

* **Interval**

### Index

#### Properties

* [length](#length)
* [unit](#unit)

### Properties

#### length

•  **length**: string


___

#### unit

•  **unit**: \"DAYS\" \| \"MONTHS\"



<a name="interfaceslineitemsinglemd"></a>

## Interface: LineItemSingle

### Hierarchy

* **LineItemSingle**

### Index

#### Properties

* [itemId](#itemid)
* [name](#name)
* [quantity](#quantity)
* [unitPrice](#unitprice)

### Properties

#### itemId

•  **itemId**: string


___

#### name

•  **name**: string


___

#### quantity

•  **quantity**: number


___

#### unitPrice

•  **unitPrice**: number



<a name="interfaceslineitemsrecurringmd"></a>

## Interface: LineItemsRecurring

### Hierarchy

* **LineItemsRecurring**

### Index

#### Properties

* [amount](#amount)
* [description](#description)
* [itemCode](#itemcode)
* [name](#name)

### Properties

#### amount

•  **amount**: number


___

#### description

•  **description**: string


___

#### itemCode

•  **itemCode**: string


___

#### name

•  **name**: string



<a name="interfaceslineitemssinglemd"></a>

## Interface: LineItemsSingle

### Hierarchy

* **LineItemsSingle**

### Index

#### Properties

* [lineItem](#lineitem)

### Properties

#### lineItem

•  **lineItem**: [LineItemSingle](#interfaceslineitemsinglemd)[]



<a name="interfacesordermd"></a>

## Interface: Order

### Hierarchy

* **Order**

### Index

#### Properties

* [description](#description)
* [invoiceNumber](#invoicenumber)

### Properties

#### description

•  **description**: string


___

#### invoiceNumber

•  **invoiceNumber**: string



<a name="interfacesparsedcarddatamd"></a>

## Interface: ParsedCardData

### Hierarchy

* **ParsedCardData**

### Index

#### Properties

* [cardCode](#cardcode)
* [cardNumber](#cardnumber)
* [fullname](#fullname)
* [month](#month)
* [year](#year)
* [zip](#zip)

### Properties

#### cardCode

•  **cardCode**: string


___

#### cardNumber

•  **cardNumber**: string


___

#### fullname

• `Optional` **fullname**: undefined \| string


___

#### month

•  **month**: string


___

#### year

•  **year**: string


___

#### zip

• `Optional` **zip**: undefined \| string



<a name="interfacespaymentmd"></a>

## Interface: Payment

### Hierarchy

* **Payment**

### Index

#### Properties

* [opaqueData](#opaquedata)

### Properties

#### opaqueData

•  **opaqueData**: any



<a name="interfacespaymentschedulemd"></a>

## Interface: PaymentSchedule

### Hierarchy

* **PaymentSchedule**

### Index

#### Properties

* [interval](#interval)
* [startDate](#startdate)
* [totalOccurrences](#totaloccurrences)

### Properties

#### interval

•  **interval**: [Interval](#interfacesintervalmd)


___

#### startDate

•  **startDate**: string


___

#### totalOccurrences

•  **totalOccurrences**: string



<a name="interfacesprocesspaymentoptionsmd"></a>

## Interface: ProcessPaymentOptions

### Hierarchy

* **ProcessPaymentOptions**

### Index

#### Properties

* [lineItems](#lineitems)
* [paymentSchedule](#paymentschedule)

### Properties

#### lineItems

• `Optional` **lineItems**: [LineItemsRecurring](#interfaceslineitemsrecurringmd)[] \| [LineItemSingle](#interfaceslineitemsinglemd)[]


___

#### paymentSchedule

• `Optional` **paymentSchedule**: [PaymentSchedule](#interfacespaymentschedulemd)



<a name="interfacesrequestdatamd"></a>

## Interface: RequestData

### Hierarchy

* **RequestData**

  ↳ [TransactionRequest](#interfacestransactionrequestmd)

  ↳ [SubscriptionRequest](#interfacessubscriptionrequestmd)

### Index

#### Properties

* [amount](#amount)
* [billTo](#billto)
* [customer](#customer)
* [order](#order)
* [payment](#payment)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)
* [shipTo](#shipto)
* [surcharge](#surcharge)

### Properties

#### amount

•  **amount**: string


___

#### billTo

•  **billTo**: [BillTo](#interfacesbilltomd)


___

#### customer

•  **customer**: [Customer](#interfacescustomermd)


___

#### order

•  **order**: [Order](#interfacesordermd)


___

#### payment

•  **payment**: [Payment](#interfacespaymentmd)


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string


___

#### preferredName

• `Optional` **preferredName**: undefined \| string


___

#### shipTo

• `Optional` **shipTo**: [ShipTo](#interfacesshiptomd)


___

#### surcharge

• `Optional` **surcharge**: [ExtendedAmountType](#interfacesextendedamounttypemd)



<a name="interfacesrequestdataparamsmd"></a>

## Interface: RequestDataParams

### Hierarchy

* **RequestDataParams**

### Index

#### Properties

* [amount](#amount)
* [billTo](#billto)
* [customer](#customer)
* [order](#order)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)
* [response](#response)
* [shipTo](#shipto)
* [surcharge](#surcharge)

### Properties

#### amount

•  **amount**: string


___

#### billTo

•  **billTo**: [BillTo](#interfacesbilltomd)


___

#### customer

•  **customer**: [Customer](#interfacescustomermd)


___

#### order

•  **order**: [Order](#interfacesordermd)


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string


___

#### preferredName

• `Optional` **preferredName**: undefined \| string


___

#### response

•  **response**: any


___

#### shipTo

• `Optional` **shipTo**: [ShipTo](#interfacesshiptomd)


___

#### surcharge

• `Optional` **surcharge**: [ExtendedAmountType](#interfacesextendedamounttypemd)



<a name="interfacessecuredatamd"></a>

## Interface: SecureData

### Hierarchy

* **SecureData**

### Index

#### Properties

* [authData](#authdata)
* [bankData](#bankdata)
* [cardData](#carddata)

### Properties

#### authData

•  **authData**: [AuthData](#interfacesauthdatamd)


___

#### bankData

• `Optional` **bankData**: [BankData](#interfacesbankdatamd)


___

#### cardData

• `Optional` **cardData**: [ParsedCardData](#interfacesparsedcarddatamd)



<a name="interfacesshiptomd"></a>

## Interface: ShipTo

### Hierarchy

* **ShipTo**

  ↳ [BillTo](#interfacesbilltomd)

### Index

#### Properties

* [address](#address)
* [city](#city)
* [country](#country)
* [firstName](#firstname)
* [lastName](#lastname)
* [state](#state)
* [zip](#zip)

### Properties

#### address

• `Optional` **address**: undefined \| string


___

#### city

• `Optional` **city**: undefined \| string


___

#### country

• `Optional` **country**: undefined \| string


___

#### firstName

•  **firstName**: string


___

#### lastName

•  **lastName**: string


___

#### state

• `Optional` **state**: undefined \| string


___

#### zip

• `Optional` **zip**: undefined \| string



<a name="interfacessubscriptiondatamd"></a>

## Interface: SubscriptionData

### Hierarchy

* **SubscriptionData**

### Index

#### Properties

* [customerProfile](#customerprofile)
* [gatewayData](#gatewaydata)
* [lineItems](#lineitems)
* [subscription](#subscription)

### Properties

#### customerProfile

• `Optional` **customerProfile**: [CustomerProfile](#interfacescustomerprofilemd)


___

#### gatewayData

•  **gatewayData**: [GatewayData](#interfacesgatewaydatamd)


___

#### lineItems

•  **lineItems**: [LineItemsRecurring](#interfaceslineitemsrecurringmd)[]


___

#### subscription

•  **subscription**: [SubscriptionRequest](#interfacessubscriptionrequestmd)



<a name="interfacessubscriptionrequestmd"></a>

## Interface: SubscriptionRequest

### Hierarchy

* [RequestData](#interfacesrequestdatamd)

  ↳ **SubscriptionRequest**

### Index

#### Properties

* [amount](#amount)
* [billTo](#billto)
* [customer](#customer)
* [order](#order)
* [payment](#payment)
* [paymentSchedule](#paymentschedule)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)
* [shipTo](#shipto)
* [surcharge](#surcharge)

### Properties

#### amount

•  **amount**: string

*Inherited from [RequestData](#interfacesrequestdatamd).[amount](#amount)*


___

#### billTo

•  **billTo**: [BillTo](#interfacesbilltomd)

*Inherited from [RequestData](#interfacesrequestdatamd).[billTo](#billto)*


___

#### customer

•  **customer**: [Customer](#interfacescustomermd)

*Inherited from [RequestData](#interfacesrequestdatamd).[customer](#customer)*


___

#### order

•  **order**: [Order](#interfacesordermd)

*Inherited from [RequestData](#interfacesrequestdatamd).[order](#order)*


___

#### payment

•  **payment**: [Payment](#interfacespaymentmd)

*Inherited from [RequestData](#interfacesrequestdatamd).[payment](#payment)*


___

#### paymentSchedule

•  **paymentSchedule**: [PaymentSchedule](#interfacespaymentschedulemd)


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string

*Inherited from [RequestData](#interfacesrequestdatamd).[phoneNumber](#phonenumber)*


___

#### preferredName

• `Optional` **preferredName**: undefined \| string

*Inherited from [RequestData](#interfacesrequestdatamd).[preferredName](#preferredname)*


___

#### shipTo

• `Optional` **shipTo**: [ShipTo](#interfacesshiptomd)

*Inherited from [RequestData](#interfacesrequestdatamd).[shipTo](#shipto)*


___

#### surcharge

• `Optional` **surcharge**: [ExtendedAmountType](#interfacesextendedamounttypemd)

*Inherited from [RequestData](#interfacesrequestdatamd).[surcharge](#surcharge)*



<a name="interfacestransactiondatamd"></a>

## Interface: TransactionData

### Hierarchy

* **TransactionData**

### Index

#### Properties

* [customerProfile](#customerprofile)
* [gatewayData](#gatewaydata)
* [transactionRequest](#transactionrequest)

### Properties

#### customerProfile

• `Optional` **customerProfile**: [CustomerProfile](#interfacescustomerprofilemd)


___

#### gatewayData

•  **gatewayData**: [GatewayData](#interfacesgatewaydatamd)


___

#### transactionRequest

•  **transactionRequest**: [TransactionRequest](#interfacestransactionrequestmd)



<a name="interfacestransactionrequestmd"></a>

## Interface: TransactionRequest

### Hierarchy

* [RequestData](#interfacesrequestdatamd)

  ↳ **TransactionRequest**

### Index

#### Properties

* [amount](#amount)
* [billTo](#billto)
* [customer](#customer)
* [lineItems](#lineitems)
* [order](#order)
* [payment](#payment)
* [phoneNumber](#phonenumber)
* [preferredName](#preferredname)
* [shipTo](#shipto)
* [surcharge](#surcharge)
* [transactionType](#transactiontype)

### Properties

#### amount

•  **amount**: string

*Inherited from [RequestData](#interfacesrequestdatamd).[amount](#amount)*


___

#### billTo

•  **billTo**: [BillTo](#interfacesbilltomd)

*Inherited from [RequestData](#interfacesrequestdatamd).[billTo](#billto)*


___

#### customer

•  **customer**: [Customer](#interfacescustomermd)

*Inherited from [RequestData](#interfacesrequestdatamd).[customer](#customer)*


___

#### lineItems

•  **lineItems**: [LineItemsSingle](#interfaceslineitemssinglemd)


___

#### order

•  **order**: [Order](#interfacesordermd)

*Inherited from [RequestData](#interfacesrequestdatamd).[order](#order)*


___

#### payment

•  **payment**: [Payment](#interfacespaymentmd)

*Inherited from [RequestData](#interfacesrequestdatamd).[payment](#payment)*


___

#### phoneNumber

• `Optional` **phoneNumber**: undefined \| string

*Inherited from [RequestData](#interfacesrequestdatamd).[phoneNumber](#phonenumber)*


___

#### preferredName

• `Optional` **preferredName**: undefined \| string

*Inherited from [RequestData](#interfacesrequestdatamd).[preferredName](#preferredname)*


___

#### shipTo

• `Optional` **shipTo**: [ShipTo](#interfacesshiptomd)

*Inherited from [RequestData](#interfacesrequestdatamd).[shipTo](#shipto)*


___

#### surcharge

• `Optional` **surcharge**: [ExtendedAmountType](#interfacesextendedamounttypemd)

*Inherited from [RequestData](#interfacesrequestdatamd).[surcharge](#surcharge)*


___

#### transactionType

•  **transactionType**: string



<a name="interfacesvalidationdatamd"></a>

## Interface: ValidationData

### Hierarchy

* **ValidationData**

### Index

#### Properties

* [clientCanonicalName](#clientcanonicalname)
* [context](#context)
* [gatewayData](#gatewaydata)
* [validationUrl](#validationurl)

### Properties

#### clientCanonicalName

•  **clientCanonicalName**: string


___

#### context

•  **context**: string


___

#### gatewayData

•  **gatewayData**: [GatewayData](#interfacesgatewaydatamd)


___

#### validationUrl

•  **validationUrl**: string