...
PayFields supports two ways to launch the card swipe popup: the PayFields.swipePopup();
function and the card swipe popup button.
Info |
---|
To use |
The sections below provide examples of each:
...
Use zero dollar auth transactions to obtain approval for a payment method without actually charging the cardholder’s account. Zero dollar auth transactions are a component of setting up automatic and recurring payments. Follow the steps below to perform zero dollar auth transaction:
Set the PayFields transaction mode to
'txn'
as shown below:Code Block PayFields.config.mode = 'txn';
Set the transaction amount to
`0`
as shown below. Use a string for the amount:Code Block PayFields.config.amount = '0';
Set the transaction type to
'auth'
:Code Block PayFields.config.txnType = 'auth';
Tokenization
The PayFields tokenization feature makes it possible to store a reference to payment information that can be used to process automatic or recurring payments. PayFields supports token only and transaction+token functions.
Do not use the tokenization feature in combination with Customer, since Customer is a unique token/card holder. Creating a tokenized card creates a unique Customer.
The sections below provide examples of how to generate tokens using PayFields.
...
Code Block |
---|
PayFields.config.amount = '0'; PayFields.config.mode = 'txnToken'; |
ACH
The information below provides an overview of the PayFields ACH feature. See the Accept ACH Payments With PayFields page for details about building a payment page that accepts ACH payments.
Set the PayFields.config.txnType
to ecsale
. Failure to update this value will result in an error during the eCheck transaction request.
Code Block |
---|
PayFields.config.txnType = 'ecsale'; |
Add routing number, account number, and account type fields on the payment page as shown in the code below:
Code Block | ||
---|---|---|
| ||
PayFields.fields = [
{
type: "routing",
element: "#routing",
},
{
type: "account_type",
element: "#account_type",
},
{
type: "account_number",
element: "#account_number",
},
{
type: 'name',
element: '#name',
values: { name: 'John Wayne' }
},
{
type: 'address',
element: '#address',
values: {
email: 'one@two.com',
city: 'New York'
}
}
]; |
Invoicing
...
Invoicing
Use the PayFields.config.invoiceResult
object to apply a full or partial payment to an invoice:
Code Block |
---|
PayFields.config.invoiceResult = { invoice: '{{InvoiceID}}' shippingAddress1: '123 Main Street', shippingAddress2: 'Suite 400', shippingCity: "Los Angeles", shippingState: "CA", shippingFirst: "Kevin", shippingLast: "Henry", message: "Checking", shippingCompany: "Drone Inc", shippingPhone: "1113334444", shippingFax: "2223334445", shippingZip: "90023", shippingCountry: "USA" } |
...
Code Block | ||
---|---|---|
| ||
PayFields.config.customer = { first: "Henry", middle: "Middle", last: "Kevin", company: "Another Company, Inc.", custom: "Checking", email: "testing@gmail.com", phone: "1112223334", fax: "1234567890" } |
The value for PayFields.config.mode
must be set to token
to create a customer account. Customer accounts cannot be created if mode
is set to txnToken
If customerID
is not passed with the transaction, in either mode, a new customer account will be created.
DOM Styling
Certain fields can be hidden by setting display: "none"
in the PayFields.customizations.style
object when you are prepopulating fields using the PayFields.array
. The sample code below shows all of the fields that can be hidden:
...