360Works Plastic User Guide

The CreditCardProcessor provides easy credit card processing capabilities for FileMaker Pro.

Using the plugin

Consult the "CreditCardProcessor Example.fp7" Filemaker file which contains examples of plugin usage.

You must have an active merchant account with a company such as authorize.net or PayPal/Verisign to use this plugin.

Note: authorize.net test accounts will not work, you must have a full account. Once you have an account, obtain a transaction key in the Account/Security Settings/Transaction Key area on the accounts.authorize.net website.

Selecting a gateway provider

Before you begin processing charges, you need to tell the plugin what type of gateway account you are using. This is done by calling CCSetGateway and passing in your gateway type. If you skip this step, it is assumed you are using an authorize.net account.
CCSetGateway("Authorize.net") // for authorize.net accounts (the default)
CCSetGateway("PayPal") // for paypal/verisign accounts

Running Charges

Once your merchant account is set up correctly, running charges can be done in one quick step. Here is an example of its usage:

CCProcessPayment(
merchantAccount;
transactionKey;
chargeAmount;
cardNumber;
expDate
)
The above method will process a payment transaction for a card, and return the gateway transactionID for the transaction, or the word "ERROR", if the transaction fails for some reason. For additional information about the failure, call CCLastError.

It is important that you store this resulting transactionID, you may need it to VOID the transaction later.

The minimum amount of information needed to process a transaction is:

There are numerous additional optional parameters you can provide such as addresses, email, po number, etc. These are not usually required to process an order, but can be useful for address verification purposes or linking a transaction with a customer or invoice. To supply additional parameters, add them as extra parameters onto the end of your function call in the form 'key=value', like this:
CCProcessPayment(
merchantAccount;
transactionKey;
chargeAmount;
cardNumber;
expDate;
"chargeDescription=" & description;
"cardType=" & cardType;
"verificationCode=" & securityCode
)
Here is a list of all valid additional parameters:
firstName
First (given) name of the credit card holder
lastName
Last (surname) of the credit card holder
chargeDescription
brief description of the charges
verificationCode
the numeric verification code on the credit card
cardType
the type of credit card being processed (visa, mastercard, etc)
invoiceNumber
an arbitrary invoice number for your records
poNumber
an arbitrary purchase order number for your records
customerId
an arbitrary customer id for your records
address
the billing address street address
unitNumber
the billing unit/apt no.
city
the billing address city
state
the billing address state
zip
the billing address zip
country
the billing address country
phone
the cardholder's phone numer
fax
the cardholder's fax numer
email
the cardholder's email address
currency
currency of the transaction amount (USD, for example)
track1
track1 data from a card reader*.
track2
track2 data from a card reader*.
user
if you set up one or more additional users on the account, this value is the ID of the user authorized to process transactions (PayPal/Verisign only)
partner
The ID provided to you by the authorized PayPal Reseller who registered you for the Payflow Pro service. If you purchased your account directly from PayPal, use PayPal. Currently used for PayPal/Verisign only.
tender
Set The tender type (method of payment) **.

Track1 and track2 param

track1 and track2 should only be provided for card-present transactions. Note: setting a track1 or track2 will cause the plugin to use a different URL for communicating with authorize.net. You must have a card-present account with authorize.net to use this feature. If you wish to support both card-present and card-not-present, you currently need two accounts.

SWIPE (card-present transactions) are not supported by the PayPal processor.

Tender param options (PayPal/Verisign only)

A = Automated clearinghouse
C = Credit card
D = Pinless debit
E = Electronic check
K = Telecheck
P = PayPal

Voiding previous transactions

To void a transaction, you need the transactionID which was returned by the CCProcessPayment function. Pass this (along with other payment info) to the CCVoidPayment function.

CCVoidPayment(
    settings::merchantAccount ;
    settings::transactionKey ;	// your transaction key or password
    "1321353789" ;	// the transactionID being voided
    "1234123412341234" ; // the credit card number
    Date(12, 1, 2010) ; // credit card expiration date
    "John" ; // card holder first name
    "Doe" ; // card holder last name
)

Crediting / Refunding previous transactions

To credit a transaction, you need the transactionID which was returned by the CCProcessPayment function. Pass this (along with other payment info) to the CCRefund function. This is similar to the void process, but accepts a dollar amount.

CCRefund(
    settings::merchantAccount ;
    settings::transactionKey ;	// your transaction key or password
    "1321353789" ; // the transactionID being credited
    "1234123412341234" ; // the credit card number
    0.02 ; // the amount of the refund
    Date(12, 1, 2010) ; // credit card expiration date
    "John" ; // card holder first name
    "Doe" ; // card holder last name
)

ECommerce Sample File

The Credit Card Processor plugin comes with a simple ECommerce database. This is designed to serve as an example of how the plugin is used in a real-world situation, and can also be used as a starting point for an Instant Web Publishing ECommerce site.

To try it out, open the ECommerce.fp7 file and follow the directions on the main menu.

Installation

Requirements

FileMaker version 7 or higher.

Java Virtual Machine (JVM) version 1.4.2 or later. If you are running a JVM earlier than 1.4.2, you should upgrade. Download a JVM from http://www.java.com/en/download/. If you are not sure what version of Java you have installed, you can do 'java -version' on the command line in Windows or OS X.

Windows, or Mac OS X version 10.4 or higher.

Note to intel Mac users: running this plugin under Rosetta is not supported. Upgrade to FileMaker 8.5 to run our plugin in native Intel mode.

Install Steps for FileMaker Pro

Drag the plugin from the MAC or WIN folder into your FileMaker extensions, and restart FileMaker. You will need to enter your license key before you can use it. After FileMaker starts up with the plugin installed, open FileMaker preferences, click on the Plug-ins tab, select the plugin from the list, and click the Configure button. Enter your license key and company name in this dialog. You will only need to do this once on a given machine. Alternately, you can use the registration function to register the plugin during a startup script.

This will also enable the plugin for use with Instant Web Publishing from the FileMaker Pro client software.

If the plugin does not load correctly, double-check that you meet the system requirements.

Install steps for FileMaker Web Publishing Engine / Instant Web Publishing

You do not need to do this step unless you plan on using the plugin with Instant Web Publishing or Custom Web Publishing with FileMaker Server Advanced. You will need an Enterprise License to use this feature.

For installing into the Web Publishing Engine with FileMaker 9 Server or FileMaker Server Advanced, drag the plugin from the MAC or WIN folder into the FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins folder. If there is no 'Plugins' folder inside the 'wpc' folder, then create it manually. Restart FileMaker Web Publishing, and now the plugins should be ready to go.

Note that you must use the registration function to register the plugin, since there is no preferences dialog in the FileMaker Web Publishing Engine to enter the license key and company name.

Note that due to a bug which we and other plugin vendors have reported to FileMaker, web plugins do not work in FileMaker Web Publishing Engine 8.0v4 on Mac OS X. You will need to use a later version, like 9, or an earlier version, like 8.0v3. The Windows FileMaker Server 8.0v4 does not have this bug, and will work correctly.

The easiest way to test whether the plugin is working is to have a calculation which calls the version function of the plugin, and display that on an IWP layout. If it shows "?", then the plugin is not working. If it shows a number, then the plugin has been installed successfully.

Install steps for FileMaker Server 9

You do not need to do this step unless you plan on using the plugin with scheduled script triggering, a new feature in FileMaker Server 9. You will need an Enterprise License to use this feature.

  1. Drag the plugin from the MAC or WIN folder into the FileMaker Server/Database Server/Extensions folder (older versions of server use the path FileMaker Server/Extensions/Plugins).
  2. Verify that the permissions on the plugin give the fmserver / fmsadmin user all access
  3. Restart FileMaker Server. In the Server Admin application, go to Configuration -> Database Server->Server Plug-ins.
  4. Check the box that says 'Enable FileMaker Server to use plug-ins', and then check the 'enabled' box for this plugin. You should now be able to write schedules that trigger scripts which use the plugin.

Note that you must use the registration function to register the plugin, since there is no preferences dialog in FileMaker Server to enter the license key and company name.

Feedback

We love to hear your suggestions for improving our products! If you are experiencing problems with this plugin, or have a feature request, or are happy with it, we'd appreciate hearing about it. Send us a message on our website, or email us!

Function Summary

Function Detail

CCLastAVS

Returns the gateway's Address Verification System Response for the last payment which was processed with CCProcessPayment. To use this, you must first process a payment. If you call this without processing a payment first, it will return the following error:
You must process a payment with the CCProcessPayment function before calling this function

The code will be one of the following:
A = Address (Street) matches, ZIP does not
B = Address information not provided for AVS check
E = AVS error
G = Non-U.S. Card Issuing Bank
N = No Match on Address (Street) or ZIP
P = AVS not applicable for this transaction
R = Retry Ð System unavailable or timed out
S = Service not supported by issuer
U = Address information is unavailable
W = 9 digit ZIP matches, Address (Street) does not
X = Address (Street) and 9 digit ZIP match
Y = Address (Street) and 5 digit ZIP match
Z = 5 digit ZIP matches, Address (Street) does not

Note: This feature is currently only implemented for the authorize.net gateway.


CCLastChargeResult

Returns the gateway's result code for the last operation. This is a numeric response where the code equals a status type. For authorize.net, the codes are:
  1. Approved
  2. Declined
  3. Error
For PayPal / Verisign, a '0' indicates success; a negative value indicates a failure.


CCLastError

Returns the text of the last CC-related error which occurred. This should be called any time that a plugin function returns "ERROR" to get a user-readable description of the error.

Returns: Error text, or "" if there was no error.

CCLastPaymentAuthCode

Returns the gateway's approval code for the last payment which was processed with CCProcessPayment. You must process a payment before calling this function.

Returns: a transaction ID

CCLastPaymentTransactionID

Returns the gateway's transaction ID for the last payment which was processed with CCProcessPayment. This number identifies the transaction in the system and can be used to submit a modification of this transaction at a later time, such as voiding or crediting the transaction.

Generally, the CCProcessPayment function returns this value as well. This function is here as a convenience if you're not able to retrieve that value due to chaining multiple functions together.

You must process a payment before calling this function.

Returns: a transaction ID

CCLicenseInfo

Returns information about the license used.

Returns: The type of license the plugin is registered under.

CCProcessPayment ( merchantAccountName ; txKey ; dollarAmount ; cardNumber ; expirationDate {; key1=value1; key2=value2; ...} )

This is the primary function used to process credit card charges. The initial seven parameters are required values for every transaction.

The second parameter (txKey) should be your merchant account password OR your 16-digit authorize.net transaction key. You can obtain an authorize.net transactionKey by logging into https://account.authorize.net/ and going to the Account / Settings / Transaction key section. If the txKey is not exactly 16 digits, it is assumed to be your authorize.net merchant account password. Using your account password to approve transactions is not recommended.

PayPal only supports passwords, not transaction keys. If you have a PayPal merchant account, simply use your paypal account password for the second parameter to this function.

To pass in additional parameters, see the documentation and examples at the top of this document.

If successful, this function returns the unique transactionID for the payment (as assigned by the payment gateway). If you wish to void the payment later with the CCVoidPayment function, you will need this number!

Note: if test mode is enabled, a successful authorize.net transaction will return 123456789. detailed information about the nature of the error).

Parameters:
merchantAccountName - your payment gateway merchant account name
txKey - your merchant account password OR authorize.net transaction key.
dollarAmount - the amount of the transaction
cardNumber - the credit card account number to charge for the transaction
expirationDate - the expiration date of the credit card being charged. Format the expiration date as MMYY or MM/YY or MM/DD/YY
Returns: a verification code from the payment gateway service if the order is successful, or "ERROR" if there was a problem (use CCLastError for more

CCRefund ( merchantAccountName ; txKey ; previousTransactionID ; cardNumber ; amountToCredit {; key1=value1; key2=value2; ...} )

This transaction is also referred to as a ÒRefundÓ and indicates to the gateway that money should flow from the merchant to the customer. The gateway will accept a credit or a refund request if the transaction submitted meets the following conditions:

To pass in additional parameters, see the documentation and examples at the top of this document.

card number, or just the last 4 digits. passed the absolute value is used. detailed information about the nature of the error).

Parameters:
merchantAccountName - your payment gateway merchant account name
txKey - your merchant account password OR authorize.net transaction key.
previousTransactionID - the transactionId of a previously processed transaction.
cardNumber - the credit card account number to credit for the transaction. For credits, you may either pass the entire
amountToCredit - the amount to credit, as a positive number. Must be less than the original transaction amount. If a negative number is
Returns: the transactionID from the payment gateway service if the order is successful, or "ERROR" if there was a problem (use CCLastError for more

CCRegister ( licenseKey ; registeredTo )

Registers the CreditCardProcessor Plugin.

Parameters:
licenseKey - a valid license key string, or the literal string "DEMO" to run in demo mode.
registeredTo - the company name for the license key used.
Returns: 1 on success, or "ERROR" on failure.

CCSetGateway ( gatewayName )

Switch which gateway to use (the default is authorize.net).

The following gateways are supported:

Parameters:
gatewayName - one of the supported gateway names.
Returns: 1 if a valid gateway is providded, ERROR otherwise.

CCSetTestMode ( testModeSetting )

Puts the credit card plugin into test mode. Pass in a 1 for test mode or 0 for real mode. When in test mode, all credit card charges will be sent to a special test server that runs the normal verification process, but does not run real charges.

Returns: 1 on success, "ERROR" on failure.

CCValidateCardNumber ( cardNumber )

Utility function for validating whether a credit card number is valid. This only checks the format of the card number, not whether it is an active account.

This can be very handy for "validated by calculation" fields, to ensure that only valid credit cards are entered.

Parameters:
cardNumber - credit card number, containing numbers and optional dashes
Returns: 1 if the card is valid, 0 if invalid

CCVersion

Returns the version of the regex plugin which is installed.

Returns: an integer version number.

CCVoidPayment ( merchantAccountName ; txKey ; previousTransactionID{; key1=value1; key2=value2; ...} )

Voids a previously processed payment. The parameters are similar to the CCProcessPayment function, except dollarAmount is replaced with the addition of the previousTransactionID parameter. The previousTransactionID should be the transactionID of the transaction you wish to void. This value is returned by the CCProcessPayment function. Alternately, you can use the CCLastPaymentTransactionID function to get the transactionID of the last processed payment.

To pass in additional parameters, see the documentation and examples at the top of this document.

information about the nature of the error).

Parameters:
merchantAccountName - your payment gateway merchant account name
txKey - your merchant account password OR authorize.net transaction key.
previousTransactionID - the transactionId of a previously processed transaction.
Returns: the transactionID from the payment gateway service if the order is successful, or "ERROR" if there was a problem (use CCLastError for more detailed