Plastic includes a number of helper functions that allow users to retrieve data from the gateway or Plastic.
Simply set a variable or a field to use the calculation.
- 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:
|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. For Authorize.Net, these are 1- Approved, 2- Declined, or 3- error. PayPal returns 0 on success or a negative value on failure.
- 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. 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.
- CCSetErrorCapture- Toggles error dialogs on or off. When something unexpected happens, the plug-in will pop up a dialog displaying the error message. 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 with a parameter of true. That will suppress the error dialog from appearing to the user.
- CCLicenseInfo - returns information about the license used.
- CCRegister ( licenseKey, registeredTo) - registers Plastic using the license key and registered to name found in the receipt email. Plastic will run for 2 hours in demo mode before FileMaker Pro will need to be restarted. Returns a 1 on success or a 0 on failure.
- CCVersion - returns the version of the credit card plugin which is installed.
- CCSetTestMode - Tells the gateway to flag the account into test mode, which will not let any real charges occur but allow for test transactions. If using our credentials in the demo file with Authorize.Net, these transactions will go to the test server. Returns a 1 on success or ERROR on failure. To send your transactions and account to the test server instead of live with a test flag, use the url parameter instead. See below.
If you would like to use an emulator with Plastic, call the CCSetGateway function with the additional parameter url, whose value would correspond to the emulator's endpoint URL.
Set Variable [$result; Value:CCSetGateway ("Authorize.Net" ; "url=http://YourMerchantParnetURL.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.