Difference between revisions of "Celero"

From 360Works Product Documentation Wiki
Jump to navigation Jump to search
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Working with Plug-ins==
 
==Working with Plug-ins==
  
Plastic 2 is a plug-in for FileMaker Pro and FileMaker Server that processes secure payments within FileMaker.
+
Plastic is a plug-in for FileMaker Pro and FileMaker Server that processes secure payments within FileMaker.
  
 
{{Template:Plugin Basics}}
 
{{Template:Plugin Basics}}
Line 13: Line 13:
 
If you do not already have a gateway or merchant account, you can sign up for a Celero account at the following:
 
If you do not already have a gateway or merchant account, you can sign up for a Celero account at the following:
  
https://www.celerocommerce.com/card-processing
+
https://celerocommerce.com/360works/
  
You'll provide your '''API Key''' as the first parameter for every plug-in function call that performs a transaction. Celero doesn't require a second parameter to interact with the API, however the function signatures do require it, so an empty string must be provided to allow the functions to execute.  In the function signature template, you may see the terms ''merchant account name'' and ''transaction key''; this is due to the fact that Plastic 2 supports many gateways that use different definitions of log-in credentials.  
+
You'll provide your '''API Key''' as the first parameter for every plug-in function call that performs a transaction. You will want to generate and provide a private key to Plastic.  It should start with "api_"". Celero doesn't require a second parameter to interact with the API, however the function signatures do require it, so an empty string must be provided to allow the functions to execute.  In the function signature template, you may see the terms ''merchant account name'' and ''transaction key''; this is due to the fact that Plastic supports many gateways that use different definitions of log-in credentials.  
  
 
  Set Variable [ $result; Value:
 
  Set Variable [ $result; Value:
Line 21: Line 21:
 
  merchantAPILoginID;
 
  merchantAPILoginID;
 
  merchantTransactionKey; ...) ]
 
  merchantTransactionKey; ...) ]
 +
 +
Getting credentials in the gateway.
 +
 +
Step 1:
 +
 +
[[File:CeleroGetCredentials1.png|500px|]]
 +
 +
Step 2:
 +
 +
[[File:CeleroGetCredentials2.png|500px|]]
  
 
=== Setting the Gateway ===
 
=== Setting the Gateway ===
Line 30: Line 40:
 
'''Returns''': 1 if a valid gateway is provided, ERROR otherwise.
 
'''Returns''': 1 if a valid gateway is provided, ERROR otherwise.
  
{{Template:Emulators}}
+
==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 parameter.  You can provide an empty string for transaction key.
 +
 
 +
Set Variable [$result Value:
 +
CCListTerminals(
 +
merchantAccount;
 +
transactionKey;
 +
)]
 +
 
 +
This method will return a JSON array of objects. The shape of the return JSON structure is below.
 +
 
 +
[
 +
  {
 +
    "description":"SANDBOX 360 WORKS",
 +
    "serial_number":"1181948765558",
 +
    "id":"c8tqau46lrsdf3d939g",
 +
    "status":"active"
 +
  }
 +
]
 +
 
 +
===Using the Terminals===
 +
 
 +
Terminals 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(
 +
merchantAccount;
 +
transactionKey;
 +
chargeAmount;
 +
cardNumber;
 +
expDate)]
  
 
==Processing Payments==
 
==Processing Payments==
Line 42: Line 85:
 
You must provide the following information for a credit card payment transaction:
 
You must provide the following information for a credit card payment transaction:
 
*merchant account name (API key)
 
*merchant account name (API key)
*transaction key (Empty string)
+
*transaction key (Must provide an empty string)
 
*dollar amount
 
*dollar amount
 
*credit card number
 
*credit card number
Line 59: Line 102:
 
  chargeAmount;
 
  chargeAmount;
 
  cardNumber;
 
  cardNumber;
  expDate)]
+
  expDate;
 +
"methodOfPayment=" & TERMINAL;
 +
"terminalID=" & Payment::yourTerminalID;)]
  
 
'''Returns''': a transaction ID from the payment gateway service if the order is successful, or "ERROR" if there was a problem
 
'''Returns''': a transaction ID from the payment gateway service if the order is successful, or "ERROR" if there was a problem
Line 75: Line 120:
 
  expDate;
 
  expDate;
 
  "methodOfPayment=" & Payment::methodOfPayment;
 
  "methodOfPayment=" & Payment::methodOfPayment;
  "paymentToken" & Payment::paymentToken]
+
  "paymentToken=" & Payment::paymentToken]
  
 
====Additional Parameter Listing====
 
====Additional Parameter Listing====
 
{{Template:Celero Optional Parameters}}
 
{{Template:Celero Optional Parameters}}
 
=== Processing ACH Payments ===
 
 
{{Template:Processing ACH payments|{{ANma}}|{{ANpw}}}}
 
 
For Authorize.NET payments, you MUST also pass in an achType as a key value parameter. 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 a 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.
 
====Additional Parameter Listing====
 
{{Template:AuthorizeNet Optional Parameters}}
 
  
 
===Authorizing and Capturing Payments===
 
===Authorizing and Capturing Payments===
Line 102: Line 137:
  
  
The dollarAmount is not required to process the authorized payment. CCProcessAuthorizedPayment accepts the same optional parameters as CCProcessPayment.
+
The dollarAmount is not required to process the authorized payment.
  
=== Using Card Readers ===
+
=== Voiding Transactions ===
 
 
{{Template:Using Card Readers}}
 
 
 
Set Variable [$result; Value:
 
CCProcessPayment(
 
{{ANma}};
 
{{ANpw}};
 
chargeAmount;
 
"";
 
"";
 
"track1=%B1234123412341234^LAST/FIRST/^1112101000000000011100111000000?")]
 
  
=== Partial Transactions ===
+
Set Variable [$result; Value:
 +
CCVoidPayment (
 +
{{{1|merchantAccount}}} ;
 +
{{{2|transactionKey}}} ;
 +
previousTransactionID)]
  
====Using "isPartialAuthorization=true" and splitTenderId====
+
Void a transaction that is pending settlement. Where applicable, a void will be processed as an auth reversal.  The parameters are similar to the CCProcessPayment function, except dollarAmount is replaced with the addition of the previousTransactionID parameter. The previousTransactionID should be the transaction ID 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.
  
When using CCProcessPayment, specifying the additional parameter  "authMode=AUTH_ONLY" will perform an authorization as opposed to a sale transaction. Specifying the "isPartialAuthorization=true" parameter will tell  the gateway to allow for partial authorizations of pre-paid credit cards,  gift cards and debit cards. Specifying the splitTenderId parameter tells the  gateway that the amount authorized for the current transaction will be  applied toward the remaining balance of a previous transaction identified by the split tender ID.
+
<big>Parameters</big>:
  
When using CCProcessAuthorizedPayment, users can also pass in the splitTenderId instead of the previous transaction ID. This will capture the authorized amount from a previous transaction.
+
'''{{{1|merchantAccount}}}''' - your payment gateway merchant account name (API Key).<br>
 +
'''{{{2|transactionKey}}}''' - your merchant account password OR transaction key (Empty String).<br>
 +
'''previousTransactionID''' - the transactionId of a previously processed transaction.
  
====Charging the Outstanding Balance====
+
Note that CCVoidPayment will only work on orders that have not settled yet, which means that it will generally only work on payments made that same day. To void settled orders, use CCRefund instead.
  
After specifying a partial authorization, you can request the remaining balance and the requested amount by using CCPartialGetRemainingBalance and CCPartialGetRequestedAmount. Both return the dollar amounts, and do not require any additional parameters. You can also retrieve the splitTenderId with CCLastSplitTenderId.
+
'''Returns''': the transactionID from the payment gateway service if the order is successful, or "ERROR" if there was a problem
  
=== Voiding Transactions ===
+
See also: CCLastPaymentTransactionID: the transactionID from the payment gateway service if the order is successful, or "ERROR" if there was a problem (use CCLastError for more detailed information about the nature of the error).
 
 
{{Template:Voiding Transactions|{{ANma}}|{{ANpw}}}}
 
  
 
=== Crediting or Refunding Transactions ===
 
=== Crediting or Refunding Transactions ===
Line 137: Line 165:
 
{{Template:Refunds|{{ANma}}|{{ANpw}}}}
 
{{Template:Refunds|{{ANma}}|{{ANpw}}}}
  
====Unlinked Credits====
+
== Payment Profiles ==
 
 
You can also use CCRefund to do an unlinked credit, which will run a refund of the amount without requiring a transaction ID. Pass in blank values ""; for the previous transaction ID to perform this type of transaction.
 
  
In order to perform these credits using Authorize.Net, a merchant account must be signed up for a value-added service called Extended Credit Capabilities. Merchants should contact their Authorize.Net customer support representative for more information.
+
===Customer Profiles===
  
To do an unlinked credit with Authorize.Net, pass in the blank transaction ID. It will be a little different based on whether it was a swiped or a typed card:
+
Plastic features customer profiles, which allow you to submit customer and payment information to be reused for future transactions. This greatly simplifies PCI compliance, and keeps sensitive information out of your database. To get started, first you'll need to create a customer in the system. This will return an ID that you can then store. After that, attach a payment method to this newly created customer. This will return a payment ID, which together with the customer profile ID, you can run charges against.
 
 
{|
 
|-
 
|''Card Not Present Unlinked Refund''
 
|''Card Present Unlinked Refund''
 
|-
 
||
 
Set Variable [$result Value:
 
CCRefund(
 
{{ANma}};
 
{{ANpw}};
 
"";
 
cardNumber;
 
chargeAmount;
 
"expirationDate=12/13")]
 
||
 
Set Variable [$result Value:
 
CCRefund(
 
{{ANma}};
 
{{ANpw}};
 
"";
 
"";
 
chargeAmount;
 
"track1=4000000000000002^CardUser/John^131210100000019301000000877000000"])
 
|}
 
  
== Subscription Services ==
+
To create a customer in the system, set the following:
  
{{Template:Subscriptions}}
+
Set Variable[$customerID; Value:
 +
CCProfileCreateCustomer (
 +
{{{1|merchantAccountName}}};
 +
{{{2|txKey}}};
 +
customerId)
  
Authorize.Net supports all five subscription functions. Creating and modifying subscriptions all accept the same optional parameters, available in the table below.
+
'''Returns''': the customer profile ID used to reference the newly created profile if successful, or "ERROR" if there was a problem
  
To create a credit card subscription, use '''CCCreateSubscription.''' To create a bank account subscription, use '''CCCreateSubscriptionACH.''' Italicized items are optional.
+
Note: If you provide an empty string to customerId, the gateway will generate and return one.
  
Valid pay periods include days or months. Frequency indicates how often in that period. For example, a biweekly subscription would have a pay period of weekly and a frequency of 2.  
+
After creating a customer, it can also be updated, deleted, or retrieved. Retrieving a customer will return the information the gateway has saved about the customer.
  
 
{| class="wikitable"
 
{| class="wikitable"
| <big>CCCreateSubscription</big>|| <big>CCCreateSubscriptionACH</big>
+
| <big>CCProfileUpdateCustomer</big>
 +
| <big>CCProfileDeleteCustomer</big>
 +
| <big>CCProfileGetCustomer</big>
 
|-
 
|-
|{{ANma}}||{{ANma}}
+
|{{{1|merchantAccountName}}} || {{{1|merchantAccountName}}} || {{{1|merchantAccountName}}}
 
|-
 
|-
|{{ANpw}}||{{ANpw}}
+
|{{{2|txKey (empty string)}}} || {{{2|txKey (empty string)}}} || {{{2|txKey (empty string)}}}
 
|-
 
|-
|dollarAmount||dollarAmount
+
|customerId || customerProfileId || customerProfileId
 
|-
 
|-
|cardNumber||accountNumber
+
|customerProfileId
|-
+
|
|expirationDate||abaRoutingNumber
+
|
|-
 
|''subscriptionName''||''bankName''
 
|-
 
|numberOfInstallments||accountType
 
|-
 
|startDate||accountHolderFirstName
 
|-
 
|payPeriod||accountHolderLastName
 
|-
 
|frequency||''subscriptionName''
 
|-
 
|||numberOfInstallments
 
|-
 
| || startDate
 
|-
 
| ||payPeriod
 
|-
 
| || frequency
 
 
|}
 
|}
  
'''Returns''': 1 on success, or "ERROR" if there was a problem.
+
'''Returns''': 1 if successful, or "ERROR" if there was a problem
  
After a subscription has been created, it can be modified with '''CCModifySubscription'''. If the original subscription was a bank account you'll use '''CCModifySubscriptionACH'''. The optional parameters can be set to "" if you do not need to modify them. The last two, marked with ""; are payPeriod and frequency, which cannot be modified.  
+
On Celero, the functionality of '''CCProfileGetShipping''' and '''CCProfileGetPayment''' are wrapped into '''CCProfileGetCustomer''', which returns a JSON of the profile (referred to a "Customer Vault: in Celero).  '''CCProfileGetCustomer''' returns this JSON. An example of the returned JSON can be found here: https://sandbox.gotnpgateway.com/docs/api/#get-customer-record-by-id
  
The trialOccurrences parameter can only be updated if the trial period has not begun or is in progress.
+
To parse out these values, use FileMaker's built in JSON functions.
 
 
{| class="wikitable"
 
| <big>CCModifySubscription</big>|| <big>CCCreateSubscriptionACH</big>
 
|-
 
|{{ANma}}||{{ANma}}
 
|-
 
|{{ANpw}}||{{ANpw}}
 
|-
 
|previousSubscriptionId||previousSubscriptionId
 
|-
 
|''dollarAmount''||''dollarAmount''
 
|-
 
|''cardNumber''||''accountNumber''
 
|-
 
|''expirationDate''||''abaRoutingNumber''
 
|-
 
|''subscriptionName''||''bankName''
 
|-
 
|''numberOfInstallments''||''accountType''
 
|-
 
|''startDate''||''accountHolderFirstName''
 
|-
 
|"";||''accountHolderLastName''
 
|-
 
|"";||''subscriptionName''
 
|-
 
|||''numberOfInstallments''
 
|-
 
| || ''startDate''
 
|-
 
| ||"";
 
|-
 
| || "";
 
|}
 
  
 
====Additional Parameter Listing====
 
====Additional Parameter Listing====
<center><big>Click Expand to see the list of optional parameters for creating and modifying subscriptions:</big>
+
<center><big>Click Expand to see the list of optional parameters:</big>
  
 
{| class="wikitable mw-collapsible mw-collapsed"
 
{| class="wikitable mw-collapsible mw-collapsed"
Line 259: Line 214:
 
! Description
 
! Description
 
|-
 
|-
|trialOccurrences
+
|description
|The number of installments includes any trial occurrences. If you specify a trial occurrence, you must also specify a trialAmount.
+
|a description for the customer profile
|-
 
|trialAmount
 
|If you specify a trial amount, you must also specify the trialOccurrences.
 
|-
 
|verificationCode
 
|the numeric verification code on the credit card. This is also known as Card Security Code (CSC), Card Verification Value (CVV), Card Verification Value Code (CVVC), Card Verification Code (CVC) or Verification Code (V-Code/V Code)
 
|-
 
|invoiceNumber
 
|an arbitrary invoice number for your records
 
|-
 
|chargeDescription
 
|brief description of the charges
 
|-
 
|customerId
 
|an arbitrary customer ID for your records
 
|-
 
|companyName
 
|the billing company name
 
|-
 
|firstName
 
|First (given) name of the credit card holder
 
|-
 
|lastName
 
|Last (surname) of the credit card holder
 
|-
 
|email
 
|the card holder's email address
 
|-
 
|fax
 
|the card holder's fax number
 
|-
 
|phone
 
|the card holder's phone number
 
|-
 
|address
 
|the billing address
 
|-
 
|city
 
|the billing address city
 
|-
 
|state
 
|the billing address state
 
|-
 
|zip
 
|the billing address zip
 
|-
 
|country
 
|billing address country
 
|-
 
|shipAddress
 
|the shipping street address
 
|-
 
|shipCity
 
|the shipping address city
 
|-
 
|shipCompanyName
 
|the shipping recipient's company name
 
|-
 
|shipCountry
 
|the shipping address country
 
|-
 
|shipFirstName
 
|the shipping recipient's first name
 
 
|-
 
|-
|shipLastName
 
|the shipping recipient's last name
 
|-
 
|shipState
 
|the shipping address state
 
|-
 
|shipZip
 
|the shipping address zip
 
 
|}
 
|}
 
</center>
 
</center>
  
'''Returns''': 1 on success, or "ERROR" if there was a problem.
+
=== Creating Payment Profiles===
  
To cancel a subscription, use '''CCDeleteSubscription''':
+
Payment profiles allow you to save payment information straight to the gateway for future use. Celero allows you to create payment profiles using a credit card or a payment token.  When creating a payment profile with a payment token, you must pass the paymentToken optional parameter with a unexpired payment token.  When the paymentToken optional parameter is passed, the required credit card info fields are ignored.  To create a payment profile, call '''CCProfileCreatePayment'''. Credit cards are created with '''CCProfileCreatePayment''' and updated with '''CCProfileUpdatePayment'''.
  
 
{| class="wikitable"
 
{| class="wikitable"
| <big>CCDeleteSubscription</big>
+
| <big>CCProfileCreatePayment</big>
 +
| <big>CCProfileUpdatePayment</big>
 
|-
 
|-
|merchantAccountName
+
|{{{1|merchantAccount}}}
 +
|{{{1|merchantAccount}}}
 
|-
 
|-
|transactionKey
+
|{{{2|transactionKey}}}
 +
|{{{2|transactionKey}}}
 
|-
 
|-
|previousSubscriptionId
+
|customerProfileId
|}
+
|customerProfileId
 
 
'''Returns''': 1 on success, or "ERROR" if there was a problem.
 
 
 
There are no optional parameters with deleting a subscription.
 
 
 
== Payment Profiles ==
 
 
 
{{Template:Customer profiles|{{ANma}}|{{ANpw}}}}
 
{{Template:Profiles}}
 
 
 
For Authorize.Net, customerId is not required for CCProfileUpdateCustomer.
 
 
 
CCProfileCreateCustomer and CCProfileUpdateCustomer can also accept a profileDescription, which is a brief description of the customer. It also accepts an email address, which is then stored on the gateway's server.
 
 
 
=== Creating Payment Profiles===
 
 
 
{{Template:Payment profiles|{{ANma}}|{{ANpw}}}}
 
 
 
For Authorize.Net, creating and updating payments accept the following:
 
 
 
====Additional Parameter Listing====
 
<center><big>Click Expand to see the list of optional parameters:</big>
 
 
 
{| class="wikitable mw-collapsible mw-collapsed"
 
!Parameters
 
 
|-
 
|-
|firstName
+
|cardNumber
|lastName
+
|paymentProfileId
 
|-
 
|-
|companyName
+
|expirationDate
|address
+
|cardNumber
 
|-
 
|-
|city
+
|
|state
+
|expirationDate
|-
 
|zip
 
|country
 
|-
 
|phone
 
|fax
 
 
|}
 
|}
</center>
 
  
ACH payments are added and updated in much the same way as a credit card. Italicized items are optional, and can accept ""; if not needed. ACH payments can use the same CCProfileGetPayment, CCProfileValidatePayment, and CCProfileDeletePayment as above.
+
'''Returns''': CCProfileCreatePayment or CCProfileCreatePaymentACH returns the payment profile ID used to reference the newly created profile if successful, or "ERROR" if there was a problem.
 +
 
 +
'''Returns''': CCProfileUpdatePayment returns a 1 on success, or ERROR if there was a problem.
 +
 
 +
After creation, payments can be retrieved with '''CCProfileGetPayment'''. Certain gateways can validate a payment with '''CCProfileValidatePayment'''. Payments can be deleted with '''CCProfileDeletePayment'''.
  
 
{| class="wikitable"
 
{| class="wikitable"
| <big>CCProfileCreatePaymentACH</big>||<big>CCProfileUpdatePaymentACH</big>
+
| <big>CCProfileGetPayment</big>
 +
| <big>CCProfileValidatePayment</big>
 +
| <big>CCProfileDeletePayment</big>
 
|-
 
|-
|{{ANma}}||{{ANma}}
+
|{{{1|merchantAccount}}}
 +
|{{{1|merchantAccount}}}
 +
|{{{1|merchantAccount}}}
 
|-
 
|-
|{{ANpw}}||{{ANpw}}
+
|{{{2|transactionKey}}}
 +
|{{{2|transactionKey}}}
 +
|{{{2|transactionKey}}}
 +
 
 
|-
 
|-
|customerProfileId||customerProfileId
+
|customerProfileId
|-
+
|customerProfileId
|accountNumber||paymentProfileId
+
|customerProfileId
|-
+
 
|routingNumber||''accountNumber''
 
 
|-
 
|-
|bankName||''routingNumber''
+
|paymentProfileId
|-
+
|paymentProfileId
|accountType||''bankName''
+
|paymentProfileId
|-
 
|accountHolderFirstName||''accountType''
 
|-
 
|accountHolderLastName||''accountHolderFirstName''
 
|-
 
|||''accountHolderLastName''
 
 
|}
 
|}
 +
 +
'''Returns''': CCProfileValidatePayment and CCProfileDeletePayment return a 1 on success, or ERROR if there was a problem.
  
 
===Creating Shipping Profiles===
 
===Creating Shipping Profiles===
  
After creating customers and payments, shipping information can also be attached to a customer. Items in bold are required.
+
After creating customers and payments, address record information can also be attached to a customer. Address records are only distinguished at billing or shipping when provided as additional parameters billingID or shippingID at the time of a transaction.
 
 
  
 
{| class="wikitable"
 
{| class="wikitable"
 
| <big>CCProfileCreateShipping</big>
 
| <big>CCProfileCreateShipping</big>
 
| <big>CCProfileUpdateShipping</big>
 
| <big>CCProfileUpdateShipping</big>
| <big>CCProfileGetShipping</big>
 
 
| <big>CCProfileDeleteShipping</big>
 
| <big>CCProfileDeleteShipping</big>
 
|-
 
|-
|'''{{ANma}}'''
 
 
|'''{{ANma}}'''
 
|'''{{ANma}}'''
 
|'''{{ANma}}'''
 
|'''{{ANma}}'''
Line 435: Line 293:
 
|-
 
|-
  
|'''{{ANpw}}'''
 
 
|'''{{ANpw}}'''
 
|'''{{ANpw}}'''
 
|'''{{ANpw}}'''
 
|'''{{ANpw}}'''
Line 443: Line 300:
 
|'''customerProfileId'''
 
|'''customerProfileId'''
 
|'''customerProfileId'''
 
|'''customerProfileId'''
|'''customerProfileId'''
 
 
|-
 
|-
| shipFirstName    
+
| firstName    
| shipFirstName    
+
| firstName    
 +
|-
 +
| lastName   
 +
| lastName   
 +
|-
 +
| companyName 
 +
| companyName 
 
|-
 
|-
| shipLastName   
+
| email 
| shipLastName   
+
| email 
 
|-
 
|-
| shipCompanyName 
+
| address   
| shipCompanyName 
+
| address   
 
|-
 
|-
| shipAddress    
+
| address2    
| shipAddress    
+
| address2    
 
|-
 
|-
| shipCity      
+
| city      
| shipCity      
+
| city      
 
|-
 
|-
| shipState
+
| state
| shipState
+
| state
 
|-
 
|-
| shipZip    
+
| zip    
| shipZip    
+
| zip    
 
|-
 
|-
| shipCountry    
+
| country    
| shipCountry    
+
| country    
 
 
 
|-
 
|-
| shipPhone
+
| phone
| shipPhone
+
| phone
 
|-
 
|-
| shipFax
+
| fax
| shipFax
+
| fax
 
|}
 
|}
  
Line 484: Line 345:
  
 
If you want to run authorize only transactions, use '''CCProfileProcessPayment''' and add "authMode=AUTH_ONLY" to the list of parameters. To then capture that transaction, run '''CCProfileProcessAuthorizedPayment'''.
 
If you want to run authorize only transactions, use '''CCProfileProcessPayment''' and add "authMode=AUTH_ONLY" to the list of parameters. To then capture that transaction, run '''CCProfileProcessAuthorizedPayment'''.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
 
| <big>CCProfileProcessPayment</big>
 
| <big>CCProfileProcessPayment</big>
| <big>CCProfileProcessAuthorizedPayment</big>
 
| <big> CCProfileRefund </big>
 
| <big> CCProfileVoidPayment</big>
 
 
|-
 
|-
|'''{{ANma}}'''||'''{{ANma}}'''||'''{{ANma}}'''||'''{{ANma}}'''
+
|'''{{ANma}}'''
 
|-
 
|-
|'''{{ANpw}}'''||'''{{ANpw}}'''||'''{{ANpw}}'''||'''{{ANpw}}'''
+
|'''{{ANpw}}'''
 
|-
 
|-
|'''customerProfileId'''||'''customerProfileId'''||'''customerProfileId'''||'''customerProfileId'''
+
|'''customerProfileId'''
 
|-
 
|-
|'''paymentProfileId'''||'''paymentProfileId'''||'''paymentProfileId'''||'''paymentProfileId'''
+
|'''paymentProfileId'''
 
|-
 
|-
|'''dollarAmount'''||'''previousTransactionId'''||'''previousTransactionId'''||'''previousTransactionId'''
+
|'''dollarAmount'''
 
|-
 
|-
|shippingProfileId||'''dollarAmount''' - pass in ""; if not needed||'''amountToCredit'''
+
|billingAddressID
|-
 
|authMode||shippingProfileId||accountNumber - you can pass in only the last four digits preceded by XXXX
 
|-
 
|verificationCode||verificationCode||routingNumber
 
|-
 
|invoiceNumber||splitTenderId|||invoiceNumber
 
|-
 
|poNumber
 
|
 
|poNumber
 
|-
 
|chargeDescription
 
|
 
|chargeDescription
 
 
|-
 
|-
|isPartialAuthorization
+
|shippingAddressID
 
|-
 
|-
|splitTenderId
+
|authMode
 
|}
 
|}
  

Revision as of 16:37, 16 February 2024

Working with Plug-ins

Plastic is a plug-in for FileMaker Pro and FileMaker Server that processes secure payments within FileMaker.

Requirements

FileMaker 7 or higher, Java Virtual Machine (JVM) 6 or higher, Windows or Mac OS X 10.6. Rosetta on Intel Macs not supported.

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)

Note: 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


Note: 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 = 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 ; 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.

Celero

Celero can process a wide variety of transactions, and supports terminals, payment tokens and profile-based payments. For detailed examples of each of these transactions.

Getting an account

If you do not already have a gateway or merchant account, you can sign up for a Celero account at the following:

https://celerocommerce.com/360works/

You'll provide your API Key as the first parameter for every plug-in function call that performs a transaction. You will want to generate and provide a private key to Plastic. It should start with "api_"". Celero doesn't require a second parameter to interact with the API, however the function signatures do require it, so an empty string must be provided to allow the functions to execute. In the function signature template, you may see the terms merchant account name and transaction key; this is due to the fact that Plastic supports many gateways that use different definitions of log-in credentials.

Set Variable [ $result; Value:
CCProcessPayment (
merchantAPILoginID;
merchantTransactionKey; ...) ]

Getting credentials in the gateway.

Step 1:

CeleroGetCredentials1.png

Step 2:

CeleroGetCredentials2.png

Setting the Gateway

Before processing any payments, you need to tell Plastic which gateway you are using. This is done by calling CCSetGateway.

Set Variable [$gateway; Value:CCSetGateway("Celero"; "cardPresent=true")]

Returns: 1 if a valid gateway is provided, ERROR otherwise.

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 parameter. You can provide an empty string for transaction key.

Set Variable [$result Value: 
CCListTerminals(
merchantAccount; 
transactionKey;
)]

This method will return a JSON array of objects. The shape of the return JSON structure is below.

[
  {
   "description":"SANDBOX 360 WORKS",
   "serial_number":"1181948765558",
   "id":"c8tqau46lrsdf3d939g",
   "status":"active"
  }
]

Using the Terminals

Terminals 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(
merchantAccount; 
transactionKey;
chargeAmount;
cardNumber;
expDate)]

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 (API key)
  • transaction key (Must provide an empty string)
  • dollar amount
  • credit card number
  • credit card expiration date (Format the expiration date as MMYY or MM/YY or MM/DD/YY)

In addition to standard manual entry, Celero allows credit cards to be processed through tokenization and terminals. In those cases, credit card number and credit card expiration date will need to be sent as empty strings. To switch to these payment methods, use the optional parameters specified in the section below.

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(
merchantAccount; 
transactionKey;
chargeAmount;
cardNumber;
expDate;
"methodOfPayment=" & TERMINAL;
"terminalID=" & Payment::yourTerminalID;)]

Returns: a transaction ID from the payment gateway service if the order is successful, or "ERROR" if there was a problem

Note: 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(
merchantAccount; 
transactionKey;
chargeAmount;
cardNumber;
expDate;
"methodOfPayment=" & Payment::methodOfPayment;
"paymentToken=" & Payment::paymentToken]

Additional Parameter Listing

Click Expand to see the list of optional parameters:
Parameter Description
methodOfPayment "CC" or "TERMINAL" or "PAYMENT_TOKEN" (defaults to "CC" if parameter is not provided)
terminalID the ID of the terminal to be used for payment (only read if "Terminal" is selected for methodOfPayment)
paymentToken token provided by API's tokenizer (only read if "PaymentToken" is selected for methodOfPayment)
verificationCode the numeric verification code on the credit card. This is also known as Card Security Code (CSC), Card Verification Value (CVV), Card Verification Value Code (CVVC), Card Verification Code (CVC) or Verification Code (V-Code/V Code). It is not used for paymentTokens
companyName the billing company name
firstName First (given) name of the credit card holder
lastName Last (surname) of the credit card holder
email the card holder's email address
fax the card holder's fax number
phone the card holder's phone number
address the billing address
address2 the second line of the billing address
city the billing address city
state the billing address state
zip the billing address zip
country billing address country (must be ISO 3166 format)
chargeDescription Text field for miscellaneous notes (max 255 characters)
orderID Supports up to 15 alphanumeric characters
poNumber Supports up to 15 alphanumeric characters

Authorizing and Capturing Payments

A sale transaction for credit card contains two parts: an authorization which verifies and places a hold for the amount, and a capture, which actually transfers the funds.

To run an authorization, pass in an additional parameter authMode=AUTH_ONLY.

Set Variable [$result Value:
CCProcessPayment(
merchantAPILoginID,
merchantTransactionKey;
chargeAmount;
cardNumber;
expDate;
authMode=AUTH_ONLY)]

Returns: a verification code from the payment gateway service if the order is successful, or "ERROR" if there was a problem

After running an authorization, run the appropriate CCProcessAuthorizedPayment. Pass in the previousTransactionId from the transaction ID you received from the process with authMode.

Set Variable [$result Value: 
CCProcessAuthorizedPayment(
merchantAPILoginID;
merchantTransactionKey;
previousTransactionId;
dollarAmount)]


The dollarAmount is not required to process the authorized payment.

Voiding Transactions

Set Variable [$result; Value:

CCVoidPayment (
merchantAccount ;
transactionKey ;
previousTransactionID)]

Void a transaction that is pending settlement. Where applicable, a void will be processed as an auth reversal. The parameters are similar to the CCProcessPayment function, except dollarAmount is replaced with the addition of the previousTransactionID parameter. The previousTransactionID should be the transaction ID 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.

Parameters:

merchantAccount - your payment gateway merchant account name (API Key).
transactionKey - your merchant account password OR transaction key (Empty String).
previousTransactionID - the transactionId of a previously processed transaction.

Note that CCVoidPayment will only work on orders that have not settled yet, which means that it will generally only work on payments made that same day. To void settled orders, use CCRefund instead.

Returns: the transactionID from the payment gateway service if the order is successful, or "ERROR" if there was a problem

See also: CCLastPaymentTransactionID: the transactionID from the payment gateway service if the order is successful, or "ERROR" if there was a problem (use CCLastError for more detailed information about the nature of the error).

Crediting or Refunding Transactions

To credit a transaction, you need the transaction ID returned by CCProcessPayment. Pass this (along with other payment info) to the CCRefund function. This is similar to the void process, except it accepts a dollar amount and the credit card number (or the last four digits of the credit card number) used to process the original transaction.

Set Variable [$result; Value:
CCRefund(
  merchantAPILoginID;
  merchantTransactionKey;
  transactionID;
  cardNumber;
  dollarAmount)]

Returns: the transactionID from the payment gateway service if the order is successful, or "ERROR" if there was a problem

Payment Profiles

Customer Profiles

Plastic features customer profiles, which allow you to submit customer and payment information to be reused for future transactions. This greatly simplifies PCI compliance, and keeps sensitive information out of your database. To get started, first you'll need to create a customer in the system. This will return an ID that you can then store. After that, attach a payment method to this newly created customer. This will return a payment ID, which together with the customer profile ID, you can run charges against.

To create a customer in the system, set the following:

Set Variable[$customerID; Value:
CCProfileCreateCustomer (
merchantAccountName;
txKey;
customerId)

Returns: the customer profile ID used to reference the newly created profile if successful, or "ERROR" if there was a problem

Note: If you provide an empty string to customerId, the gateway will generate and return one.

After creating a customer, it can also be updated, deleted, or retrieved. Retrieving a customer will return the information the gateway has saved about the customer.

CCProfileUpdateCustomer CCProfileDeleteCustomer CCProfileGetCustomer
merchantAccountName merchantAccountName merchantAccountName
txKey (empty string) txKey (empty string) txKey (empty string)
customerId customerProfileId customerProfileId
customerProfileId

Returns: 1 if successful, or "ERROR" if there was a problem

On Celero, the functionality of CCProfileGetShipping and CCProfileGetPayment are wrapped into CCProfileGetCustomer, which returns a JSON of the profile (referred to a "Customer Vault: in Celero). CCProfileGetCustomer returns this JSON. An example of the returned JSON can be found here: https://sandbox.gotnpgateway.com/docs/api/#get-customer-record-by-id

To parse out these values, use FileMaker's built in JSON functions.

Additional Parameter Listing

Click Expand to see the list of optional parameters:
Parameter Description
description a description for the customer profile

Creating Payment Profiles

Payment profiles allow you to save payment information straight to the gateway for future use. Celero allows you to create payment profiles using a credit card or a payment token. When creating a payment profile with a payment token, you must pass the paymentToken optional parameter with a unexpired payment token. When the paymentToken optional parameter is passed, the required credit card info fields are ignored. To create a payment profile, call CCProfileCreatePayment. Credit cards are created with CCProfileCreatePayment and updated with CCProfileUpdatePayment.

CCProfileCreatePayment CCProfileUpdatePayment
merchantAccount merchantAccount
transactionKey transactionKey
customerProfileId customerProfileId
cardNumber paymentProfileId
expirationDate cardNumber
expirationDate

Returns: CCProfileCreatePayment or CCProfileCreatePaymentACH returns the payment profile ID used to reference the newly created profile if successful, or "ERROR" if there was a problem.

Returns: CCProfileUpdatePayment returns a 1 on success, or ERROR if there was a problem.

After creation, payments can be retrieved with CCProfileGetPayment. Certain gateways can validate a payment with CCProfileValidatePayment. Payments can be deleted with CCProfileDeletePayment.

CCProfileGetPayment CCProfileValidatePayment CCProfileDeletePayment
merchantAccount merchantAccount merchantAccount
transactionKey transactionKey transactionKey
customerProfileId customerProfileId customerProfileId
paymentProfileId paymentProfileId paymentProfileId

Returns: CCProfileValidatePayment and CCProfileDeletePayment return a 1 on success, or ERROR if there was a problem.

Creating Shipping Profiles

After creating customers and payments, address record information can also be attached to a customer. Address records are only distinguished at billing or shipping when provided as additional parameters billingID or shippingID at the time of a transaction.

CCProfileCreateShipping CCProfileUpdateShipping CCProfileDeleteShipping
merchantAPILoginID merchantAPILoginID merchantAPILoginID
merchantTransactionKey merchantTransactionKey merchantTransactionKey
customerProfileId customerProfileId customerProfileId
firstName firstName
lastName lastName
companyName companyName
email email
address address
address2 address2
city city
state state
zip zip
country country
phone phone
fax fax

Returns: CCCreateShipping returns the shipping ID on success, "ERROR" on failure. CCProfileGetShipping returns the shipping ID on success. Other functions return 1 on success, or "ERROR" if there was a problem.

Running Charges Against Profiles

You can process a payment, authorize a payment, capture an authorized payment, void, and refund transactions. Please note that for unlinked credits with CCProfileRefund, do not pass in an accountNumber or routingNumber.

If you want to run authorize only transactions, use CCProfileProcessPayment and add "authMode=AUTH_ONLY" to the list of parameters. To then capture that transaction, run CCProfileProcessAuthorizedPayment.

CCProfileProcessPayment
merchantAPILoginID
merchantTransactionKey
customerProfileId
paymentProfileId
dollarAmount
billingAddressID
shippingAddressID
authMode

Getting Response Information and Using Helper Functions

Plastic includes a number of helper functions that allow users to retrieve data from the gateway or Plastic.

To execute any of these functions inside of a script, use a Set Field or Set Variable script step.

  • CCGetCardIssuer(cardNumber) - returns the card issuer for a given card number, either: VISA, MASTERCARD, AMEX, DINERS, DISCOVER, JCB. Returns an error if the card number is from another issuer.
  • CCGetLast (name) - returns a value from the most recent transaction response that corresponds with the name parameter.
  • CCLastAVS- returns the gateway's Address Verification System Response for the last payment which was processed. This response is typically a one letter indicator, meaning the following:
Code Description Network
A Street address matches, but 5-digit and 9-digit postal code do not match. Standard domestic
B Street address matches, but postal code not verified. Standard international
C Street address and postal code do not match. Standard international
D Street address and postal code match. Code "M" is equivalent. Standard international
E AVS data is invalid or AVS is not allowed for this card type. Standard domestic
G Non-U.S. issuing bank does not support AVS. Standard international
I Address not verified. Standard international
M Street address and postal code match. Code "D" is equivalent. Standard international
N Street address and postal code do not match. Standard domestic
P Postal code matches, but street address not verified. Standard international
R System unavailable. Standard domestic
S Bank does not support AVS. Standard domestic
U Address information unavailable. Returned if the U.S. bank does not support non-U.S. AVS or if the AVS in a U.S. bank is not functioning properly. Standard domestic
W Street address does not match, but 9-digit postal code matches. Standard domestic
X Street address and 9-digit postal code match. Standard domestic
Y Street address and 5-digit postal code match. Standard domestic
Z Street address does not match, but 5-digit postal code matches. Standard domestic
  • CCLastCCV- returns the gateway's Card Code Verification Response for the last payment which was processed. This response is typically a one letter indicator, meaning the following:
    • M- CVV2/CVC2 Match - Indicates that the card is authentic. Complete the transaction if the authorization request was approved.
    • N- CVV2 / CVC2 No Match – May indicate a problem with the card. Contact the cardholder to verify the CVV2 code before completing the transaction, even if the authorization request was approved.
    • P- Not Processed - Indicates that the expiration date was not provided with the request, or that the card does not have a valid CVV2 code. If the expiration date was not included with the request, resubmit the request with the expiration date.
    • S- Merchant Has Indicated that CVV2 / CVC2 is not present on card - May indicate a problem with the card. Contact the cardholder to verify the CVV2 code before completing the transaction.
    • U- Issuer is not certified and/or has not provided visa encryption keys
  • CCLastChargeResult - returns the gateway's result code for the last operation.
  • CCLastPaymentAuthCode - returns the gateway's approval code for the last payment which was processed with CCProcessPayment.
  • CCLastPaymentTransactionID- returns the gateway's transaction ID for the last payment which was processed with CCProcessPayment.
  • CCLastRawResponse- returns the gateway's raw text response for the most recent transaction.
  • CCValidateCardNumber (cardNumber) determines if a card number is valid. Does not indicate the validity of the card itself, only its number. Returns either a 1 for valid card, or 0 for invalid cards.
  • CCLastError - returns the text of the last error triggered by a plugin function.
  • CCLicenseInfo - returns information about the license used.
  • CCVersion - returns the version of the credit card plugin which is installed.

Getting Help

If you still need help, there are several resources available! FMForums hosts a support forum for 360Works products. Please look through the posts and see if your question has been posted before making a new topic.

Support is also available via email at plugins@360works.com. You can also call us at 770-234-9293. We offer many services in addition to our plug-ins, so let us know if you'd like a little help integrating the plug-in into your solution. Or if you'd be interested in a customized plug-in or development please let us know!