CardPointe
Table of Contents:
CardPointe
Working with Plug-ins
Plastic is a plug-in for FileMaker Pro and FileMaker Server that processes secure payments within FileMaker.
Requirements
- FileMaker 19 or higher
- Windows: 10 or later
- Mac OS: Catalina or later
- Linux: Ubuntu 22 or later
Installation
If you unzip the zip archive containing the plug-in files and open the top-level directory, you will find two subdirectories labeled WIN (for Windows) and MAC (for Macintosh). The WIN directory contains two plug-in files, one with a .fmx extension and another with a .fmx64 extension. The file with the .fmx64 extension is only used for FileMaker Server installations, which are explained below. The MAC directory contains a plug-in file with a .fmplugin extension.
To install the plug-in, copy the plug-in from the WIN or MAC folder to one of the directories listed below. Directory paths are listed relative to the parent directory of the installation home directory of the FileMaker application.
FileMaker Pro
FileMaker Pro <XX>/Extensions
FileMaker Pro <XX> Advanced/Extensions
FileMaker Server Web Publishing Engine (applies to the entire Web Publishing Engine prior to FileMaker Server 12.0.2 and to Instant Web Publishing only for FileMaker Server 12.0.2 and later)
FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins (create the Plugins folder if it does not exist)
FileMaker Server Custom Web Publishing (applies only to FileMaker Server 12.0.2 and later)
FileMaker Server/Web Publishing/publishing-engine/cwpc/Plugins (create the Plugins folder if it does not exist)
For 64-bit versions of Windows, be sure to use the 360Works plug-in with a .fmx64 extension
FileMaker Server Scripting Engine (applies to FileMaker Server scheduled scripts)
FileMaker Server/Database Server/Extensions
Using the plug-in with the FileMaker Server Web Publishing Engine or the FileMaker Server Scripting Engine requires an Enterprise plug-in license.
Uninstalling the plug-in
Uninstall the plug-in by quitting FileMaker Pro or stopping FileMaker Server and removing the plug-in file from the appropriate Extensions or Plugins directory.
Demo mode and registering the plug-in
Plug-ins will run in a fully featured demo mode until they are registered. While running in demo mode, the plug-in will run for 2 hours at a time. In order to get another two hours of demo time, you must restart FileMaker Pro, FileMaker Server's database server module or FileMaker Server's Web Publishing Engine, depending upon where the plug-in is installed.
To register the plug-in in FileMaker Pro, you may either enter the license information in FileMaker plug-in preferences or by calling CCRegister inside a script. You must call CCRegister inside a script in order to register the plug-in for use with FileMaker Server.
Set Variable [ $register; Value: CCRegister ( $licenseKey; $registeredToName) ]
Returns: a 1 on success or a 0 on failure.
Error Handling/Reporting
When something unexpected happens, the plug-in will pop up a dialog showing what the error message is. This makes it easy to see what went wrong. However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all. In that case, you can call CCSetErrorCapture ( true ). This will suppress the displaying of error dialogs.
Whether or not you suppress the error dialogs, a plugin function will return the word ERROR if something goes wrong. It's a good idea to check the result of each plugin function call to determine if an error occurred. If an error occurs, use the CCLastError function to get a detailed message describing the error. For example:
Set Variable [ $result; Value: MyPluginFunction("x" ; "y" ; "z") ]
If [ $result = "ERROR" ]
Show Custom Dialog [ "An error occurred: " & CCLastError ]
End If
If a plug-in is not installed correctly, all plug-in function calls will return "?".
To check if a transaction succeeded
The simplest way to check to see if money has changed hands in a payment processing function call is to check the result of the function itself. This is extremely useful when calling functions such as CCProcessPayment and CCProfileProcessPayment. The result of the transaction will give a transaction ID or the word ERROR. Using the CCLastError like in the example above will give further information about the error, such as if there is no network connectivity, or the card was declined.
Set Variable [ $result; Value: CCProcessPayment(...) ]
If [ $result = "ERROR" ]
# Transaction is unsuccessful. Below is an example of how you might handle the error.
Set Field [ Transaction::Error Message ; CCLastError ]
Else
# Transaction is successful.
Set Field [ Transaction::Transaction ID ; $result ]
End If
More Information
For more information on how to correctly install and work with plug-ins, check out the Plugins 101 documentation.
CardPointe
CardPointe can process a wide variety of transactions, and supports ACH payments and profile-based payments. For detailed examples of each of these transactions, check the demo file included as a download with Plastic. These scripts are ready for insertion into your own solution!
Getting an account
If you do not already have a gateway or merchant account, you can sign up for a CardPointe account at this link.
You'll need an account using the CardPointe gateway, and use your Merchant API Login ID and the Merchant Transaction Key as the first two parameters, as well as your Merchant Id as an additional parameter for every plug-in function call that performs a transaction. The merchant API Login ID is provided in a welcome packet from Fiserv on sign up, and together with the transaction key provides the merchant authentication required for access to the payment gateway.
Set Variable [ $result; Value:
CCProcessPayment (
$merchantAPILoginID;
$merchantTransactionKey;
"$merchantId=" & Settings::yourMerchantID;
...) ]
Getting credentials in the gateway
Step 1: In the CardPointe console, go to Administration, Credentials, Create Credentials
Step 2: Select an account and specify a username then click 'Generate Password'
Setting the Gateway
Before calling any function in Plastic, the first required step is to set the gateway required.
Set Variable [ $gateway; Value: CCSetGateway( "cardpointe"; "cardPresent=true" ) ]
Returns: 1 if a valid gateway is provided, ERROR otherwise.
Emulators And Alternate URLs
If you would like to use Plastic to perform transactions against an alternate URL, call the CCSetGateway function with the additional parameter url, whose value would correspond to the alternate url. A gateway emulator is a common use case for an alternate URL. Gateway emulators fashion an application programming interface that resembles that of a competing gateway to ease the integration process for merchants who switch to their gateway.
Example of communicating with a gateway that provides an Authorize.Net emulator at the URL http://AlternateURLGoesHere.com
Set Variable [ $result; Value: CCSetGateway ("cardpointe" ; "url=http://AlternateURLGoesHere.com/") ]
The call to CCSetGateway acts as a flag, so all subsequent transactions will point to the alternate URL until otherwise specified or FileMaker is restarted.
Working With Terminals
Listing Connected Terminals
You will need the terminal ID to process a transaction. That's often included on the Terminal itself, but Plastic also allows you to get a list of active terminals so that you can programmatically manage payment traffic. You only need to provide your API key as the merchantAccount (first) parameter. You can provide an empty string for transactionKey (second) parameter.
For the authKey, this is a separate API key provided by Fiserv.
Set Variable [ $result; Value:
CCListTerminals(
$merchantAPILoginID;
authKey;
$merchantId; ) ]
This method will return a JSON array of objects containing a terminal ID. The shape of the return JSON structure is below.
[{
"id":"c8tqau46lrsdf3d939g"
}]
Using the Terminals
Terminal use is available only with the CCProcessPayment function. When processing a transaction, you are required to provide the additional parameters of methodOfPayment and terminalID. For methodOfPayment you provide "TERMINAL" and for terminalID you'll provide the ID of the terminal you want to send the transaction to.
Set Variable [ $result; Value:
CCProcessPayment(
$merchantAPILoginID;
$merchantTransactionKey;
$chargeAmount;
$cardNumber;
$expDate;
"$merchantId="Settings::yourMerchantID;
"termid=" & Settings::yourTerminalID ) ]
Processing Payments
Basic Credit Card Charge
This simple example will run a single charge and requires you to input a card number and expiration date. To prevent this information from being saved in your database and to simplify PCI compliance, jump to the Payment Profiles section.
Once you properly configure your merchant account, you can quickly and easily process payment transactions.
You must provide the following information for a credit card payment transaction:
- merchant account name
- merchant account key
- dollar amount
- credit card number
- credit card expiration date (Format the expiration date as MMYY or MM/YY or MM/DD/YY)
- merchant ID
The CCProcessPayment function will process a transaction and return a transaction ID. This function returns a transaction ID if the transaction is successful or the word ERROR if the transaction fails. For detailed information about the most recent transaction failure, call the CCLastError function before calling any other transaction-processing function.
In your script, you would then have a second line after setting the gateway.
Set Variable [ $result; Value:
CCProcessPayment(
$merchantAPILoginID;
$merchantTransactionKey;
$chargeAmount;
$cardNumber;
$expDate;
"$merchantId="Settings::yourMerchantID) ]
Returns: a verification code from the payment gateway service if the order is successful, or ERROR if there was a problem
It is important to store the resulting transaction ID because you may need it later to void the transaction, issue a refund or capture a previously authorized transaction.
You may submit optional parameters to most of Plastic's payment-transaction processing functions. These parameters will be submitted to the payment gateway along with the basic transaction information. Although they are not usually required to process an order, these parameters can be useful for tasks such as address verification or linking a transaction to a customer id or an invoice number. To supply additional parameters to a function call, add them to the end of the parameter list after the last required parameter, using a "key=value" syntax.
Set Variable [ $result; Value:
CCProcessPayment(
$merchantAPILoginID;
$merchantTransactionKey;
$chargeAmount;
$cardNumber;
$expDate;
"$merchantId="Settings::yourMerchantID;
"company=" & Payment::company;
"email=" & Payment::email) ]
Optional Parameters
Processing ACH Payments
Plastic now supports payments via direct bank transfers and eChecks, via ACH payments. To take a payment via eCheck, use the CCProcessPaymentACH function after calling the gateway. The exact parameters that are required vary by gateway, but a typical example would look like this:
Set Variable [ $result; Value:
CCProcessPaymentACH (
$merchantAPILoginID;
$merchantTransactionKey;
$dollarAmount;
$accountNumber;
$routingNumber;
bankName;
$accountType;
$accountHolderFirstName;
$accountHolderLastName;
$checkNumber;
"achType=ARC") ]
Check the rest of the CardPointe-specific documentation for the specific parameters required for this gateway.
Returns: a verification code from the payment gateway service if the order is successful, or ERROR if there was a problem.
For ACH payments, you don't necessarily need to pass bankName, accountType, accountHolderFirstName, and accountHolderLastName. If you do not have that information, you can pass in a blank value with "";.
If taking an Account Receivable Transaction (ARC) or Back Office Conversion (BOC) payment, you must also pass in a check number. If not, simply type ""; where that checkNumber field would be.
Optional Parameters
Expand for Optional Parameters
| Parameter | Description |
|---|---|
| currency | ISO currency code for the transaction, for example "USD" |
| name | Account holder's name |
| company | Account holder's company name |
| address | Account holder's billing street address line |
| address2 | Second address line (for example, apartment or suite number) |
| city | Account holder's billing city. |
| region | Account holder's billing state, province, or region. |
| country | Account holder's billing country code (for example, "US"). |
| phone | Account holder's phone number |
| Account holder's email address | |
| postal | Account holder's billing postal or ZIP code. |
| cvv2 | Card verification value (CVV/CVC) printed on the card, used for card-not-present and 3-D Secure transactions. |
| accttype | Account type (for example, card brand like "VISA" or ACH type such as "ESAV" for savings). |
| termid | Terminal Device ID, must be exactly 8 characters long |
| orderid | Merchant’s order or invoice identifier for the transaction. |
| orderdate | For most industries, the delivery date for the order, in the format YYYYMMDD |
| invoiceid | Optional invoice ID |
| batchid | Optional batch identifier associated with the authorization for reporting and settlement. |
| batchsource | Optional source or system identifier for the batch. |
| capture | Flag indicating whether to capture the funds immediately (for example, "y" or "Y") or authorize only. |
| receipt | Flag indicating whether a receipt should be generated for the transaction. "Y" or "json" for yes, "N" for no (default) |
| tokenize | Flag indicating whether to create and return a token for the account (for example, "y" to tokenize). |
| userfields | Custom user-defined fields; either an object or array of name/value pairs for additional metadata. |
| profile | Specify as "Y" to simultaneously create a profile using the account information provided during the transaction |
| ecomind | E-commerce indicator describing how the transaction was initiated (for example, "E" for e-commerce). |
| cof | Stored credential indicator: identifies Cardholder-Initiated ("C") vs Merchant-Initiated ("M") transactions. |
| cofscheduled | Indicates whether the stored-credential transaction is a one-time or scheduled recurring payment ("Y" or "N"). |
| cofpermission | Optional flag indicating whether the account holder gave consent to store and reuse their payment credentials. |
| track | Payment card track data captured using a supported card reader device. Can be unencrypted Track 1 or Track 2 data, or encrypted swipe data (containing Track 1 and/or Track 2) data |
| bin | Specify as "Y" to return BIN lookup fields |
| auoptout | When the profile parameter is enabled, specify "Y" to opt out of signing up the profile for automatic card updates. Defaults to "N" (no) |
| signature | JSON-escaped, Base64-encoded, Gzipped, BMP of signature data (from a signature-capable terminal) |
| taxexempt | Specify as "Y" if the order is tax exempt |
| taxamnt | The tax amount for the order, either in decimal or in currency minor units (i.e. USD Pennies, MXN Centavos) |
| frtamnt | Total freight amount for the order |
| dutyamnt | Total duty amount for the order (non-US orders only) |
| discamnt | Discount amount for the order |
| shiptozip | The customer/recipient's postal code. Must be 5 or 10 digits (including hyphen) if "shiptocountry":"US"; otherwise, any alphanumeric string is accepted |
| shipfromzip | The merchant/sender's postal code. Must be 5 or 10 digits (including hyphen) if "shiptocountry":"US"; otherwise, any alphanumeric string is accepted |
| shiptocountry | The customer/recipient's country code |
| ponumber | A customer purchase order number, also referred to as the "Customer Code," which should be an identifier that the customer can use to identify the order |
| secureflag | 3-D Secure ECI value from the authentication provider, indicating authentication status. |
| securevalue | 3-D Secure CAVV or equivalent authentication value returned by the 3DS provider. |
| securedstid | 3-D Secure transaction identifier (for example, Directory Server Transaction ID). |
| secureexemption | Optional 3-D Secure exemption indicator (for example, low-risk or low-value exemptions in SCA flows). |
| items[...] | An array including one or more items, used to provide line item details for each item |

