NAV

Introduction

Welcome to the Slyce Plugin! The Plugin is a hosted payment interface for taking card details.

Setup

Base URI: https://plugin.slycepay.com

Current Version: 2.13.0

Authentication

Slyce plugin makes use of a token for loading the plugin. This token ensures request data is masked from the end user.

To generate a token, send a POST request to https://plugin.slycepay.com/api/request with the request parameters. Our server will then respond with a single-use token which you can use in your iframe or script method in calling the payment form.

Request Parameters

PHP Token Request

<?php
// Data
$params = array(
  'api_key' => 'YOUR_SECRET_KEY',
  'data' => array(
     'version' => 'standard',
     'key' => 'Slyce_Key_Here',
     'amount' => '1'
  )
);
$ch = curl_init();
curl_setopt_array($ch, array(
   CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
   CURLOPT_SSL_VERIFYPEER => false,
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_POSTFIELDS => http_build_query($params)
));
$res = json_decode(curl_exec($ch));
curl_close($ch);
$token = $res->error ?: $res->response_data->token;
?>

Return

YOUR_TOKEN_HERE

Usage: Iframe Method

<iframe src='https://plugin.slycepay.com/?token=YOUR_TOKEN_HERE'></iframe>

Usage: Script Method

<script src="https://plugin.slycepay.com/js/slice.js" data-token="YOUR_TOKEN_HERE"></script>
Field Name Required Type Description
api_key yes string API key provided by CMS.
data yes array Required Fields.

Refer to Additional Options supported.

Versions

Here are the versions supported.

Standard

Standard Request

<?php
  // Data
  $params = array(
    'api_key' => 'YOUR_SECRET_KEY',
    'data' => array(
       'version' => 'standard',
       'key' => 'Slyce_Key_Here',
       'amount' => '1',
       'name' => 'test',
       'custid' => '123',

    )
  );
  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
     CURLOPT_SSL_VERIFYPEER => false,
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_POSTFIELDS => http_build_query($params)
  ));
  $res = json_decode(curl_exec($ch));
  curl_close($ch);
  $token = $res->error ?: $res->response_data->token;
?>

version: standard

This is the full version of SLYCE. It has several payment options including one-time payments, card vault payments, and payment plans. This version is intended for merchant-facing applications. Due to the ability to refund transactions, it should not be used for customer-facing applications.

This version is integrated with Kount when enabled. Sending additional data is recommended. See Kount for more info.

Portal

Portal Request

<?php
  // Data
  $params = array(
    'api_key' => 'YOUR_SECRET_KEY',
    'data' => array(
       'version' => 'portal',
       'key' => 'Slyce_Key_Here',
       'amount' => '1',
    )
  );
  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
     CURLOPT_SSL_VERIFYPEER => false,
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_POSTFIELDS => http_build_query($params)
  ));
  $res = json_decode(curl_exec($ch));
  curl_close($ch);
  $token = $res->error ?: $res->response_data->token;
?>

version: portal

This version of SLYCE is meant for customer-facing sites where management of payment plans and vaulted card data would not make sense. This interface will simply ask for the card information and run a one-time transaction.

This version is integrated with Kount when enabled. Sending additional data is recommended. See Kount for more info.

Portal Version Fields

Field Name Required Type Description
swipe no boolean Pass the value swipe=yes to enable Card Swipe or Chip transactions through the portal version.

ACH

ACH Request

<?php
  // Data
  $params = array(
    'api_key' => 'YOUR_SECRET_KEY',
    'data' => array(
       'version' => 'ach',
       'key' => 'Slyce_Key_Here',
       'amount' => '1',
       'custid' => '123',
    )
  );
  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
     CURLOPT_SSL_VERIFYPEER => false,
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_POSTFIELDS => http_build_query($params)
  ));
  $res = json_decode(curl_exec($ch));
  curl_close($ch);
  $token = $res->error ?: $res->response_data->token;
?>

version: ach

Similar to the Portal version. This version initializes SLYCE only for an ACH payment.

Refund

Refund Request

<?php
  // Data
  $params = array(
    'api_key' => 'YOUR_SECRET_KEY',
    'data' => array(
       'version' => 'refund',
       'key' => 'Slyce_Key_Here',
       'amount' => '1',
       'refnum' => '1001',

    )
  );
  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
     CURLOPT_SSL_VERIFYPEER => false,
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_POSTFIELDS => http_build_query($params)
  ));
  $res = json_decode(curl_exec($ch));
  curl_close($ch);
  $token = $res->error ?: $res->response_data->token;
?>

version: refund

This version initializes SLYCE to refund a single transaction. To use it, specify version=“refund” to your code snippet as well as providing the reference number refnum=“”. This number can be found in the payment history of SLYCE.

Refund Version Fields

Field Name Required Type Description
refnum yes string Transaction reference number.

Add Card

Add Card Request

<?php
  // Data
  $params = array(
    'api_key' => 'YOUR_SECRET_KEY',
    'data' => array(
       'version' => 'save',
       'key' => 'Slyce_Key_Here',
       'name' => 'test',
       'custid' => '123',

    )
  );
  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
     CURLOPT_SSL_VERIFYPEER => false,
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_POSTFIELDS => http_build_query($params)
  ));
  $res = json_decode(curl_exec($ch));
  curl_close($ch);
  $token = $res->error ?: $res->response_data->token;
?>

version: save

This “Add Card” version initializes SLYCE for the purpose of tokenizing card data. If a custID is included in the list of parameters, the card will be added to the card vault for that customer. If no custID is included, a token will be returned that can be used in place of a card number in our API.

This version is integrated with Kount when enabled. Sending additional data is recommended. See Kount for more info.

Pay Plan Portal

Pay Plan Portal Request

<?php
  // Data
  $params = array(
    'api_key' => 'YOUR_SECRET_KEY',
    'data' => array(
       'version' => 'payplan-portal',
       'key' => 'Slyce_Key_Here',
       'amount' => '500',
       'payplanduration' => '6',
       'payplanfrequency' => 'monthly'

    )
  );
  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
     CURLOPT_SSL_VERIFYPEER => false,
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_POSTFIELDS => http_build_query($params)
  ));
  $res = json_decode(curl_exec($ch));
  curl_close($ch);
  $token = $res->error ?: $res->response_data->token;
?>

version: payplan-portal

This version is intended as a customer facing interface for creating Pay Plans.

Pay Plan Portal Version Fields

Field Name Required Values Description
payplanduration yes Integer Number of times the plan should run.
payplanfrequency yes monthly, yearly, biweekly Frequency for which the plan is run

Options

Below is the list of options and each corresponding description.

Required

Field Name Type Description
version string Refer to Versions supported with corresponding fields.
key string Slyce Key provided by CMS.
amount numeric Amount to be charged.

Refer to Additional Options supported.

Customer

A number of Slyce functionalities revolve around the use of customers. The first time a unique custID value is passed to Slyce, a customer will be created with the below field values. All future times the custID is passed, the data will be retrieved automatically from our system. As such, the below fields are only applicable to the initial creation of the customer. To update a customer’s details, please refer to the API methods.

Name Type Description
custid string Unique customer reference. This value is used to refer to a customer in the Slyce system. This attribute is required for Card Vault and Payplan tabs in the standard version, along with the Payplan Portal version.
name string The customer name. This is only applicable to saved customers.
lastname string The customer’s last name. This is only applicable to saved customers.
address1 string Address 1
address2 string Address 2
city string City
state string State
zip string Zip
country string Country

Custom Fields

Name Type Description
custom (1-10) string Use this if you would like to generate reporting based on a custom value (like a product type).
(anystring) string SLYCE will treat any unreserved string that is passed during the initialization as a custom parameter. This will be included in transaction details sent to the URL provided in webhookurl. IMPORTANT: Since SLYCE is backwards-compatible, please use unique strings that will not be used as reserved fields by SLYCE in future versions.These values are not reflected in reporting.

Lineitems

Standard request with lineitems

<?php
    // Data
    $params = array(
      'api_key' => 'YOUR_SECRET_KEY',
      'data' => array(
         'version' => 'standard',
         'key' => 'Slyce_Key_Here',
         'name' => 'test',
         'custid' => '123',
         'amount' => 1293.92,
         'lineitem1productRefNum' => "",
         'lineitem1sku' => "fg454",
         'lineitem1productName' => "DeWALTD 25113K",
         'lineitem1description' => "",
         'lineitem1unitCost' => 458.99,
         'lineitem1qty' => 1,
         'lineitem1tax' => 10.00,
         'lineitem1unitPrice' => 504.89,
         'lineitem2productRefNum' => "",
         'lineitem2sku' => 6564,
         'lineitem2productName' => "Bosch GST80PB",
         'lineitem2description' => "",
         'lineitem2unitCost' => 500.00,
         'lineitem2qty' => 1,
         'lineitem2tax' => 10.00,
         'lineitem2unitPrice' => 550.00,
         'lineitem3productRefNum' => "",
         'lineitem3sku' => "67622",
         'lineitem3productName' => "Bosch GBH222",
         'lineitem3description' => "",
         'lineitem3unitCost' => 217.30,
         'lineitem3qty' => 1,
         'lineitem3tax' => 10.00,
         'lineitem3unitPrice' => 239.03
      )
    );
    $ch = curl_init();
    curl_setopt_array($ch, array(
       CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
       CURLOPT_SSL_VERIFYPEER => false,
       CURLOPT_RETURNTRANSFER => true,
       CURLOPT_POSTFIELDS => http_build_query($params)
    ));
    $res = json_decode(curl_exec($ch));
    curl_close($ch);
    $token = $res->error ?: $res->response_data->token;
?>

These are the individual items in the transaction. For multiple lineitems, use the format of prefix ‘lineitem’, followed by an increasing number per row or set of lineitems data. For your complete guide, refer to the example request given.

Name Type Description
productRefNum string Unique Product ID.
sku string Stock-Keeping Unit.
productName string Name of the product.
description string Description of the product.
unitCost decimal Individual price of the product. This value does not affect the amount Slyce Plugin charges.
qty integer Quantity of the product.
tax decimal Tax percentage of the item.
unitPrice decimal The calculated price based on qty plus the calculated tax based on tax percentage.

Other Fields

Name Type Description
invoice string Set the invoice number (this is auto-generated by default)
description text Set the description
orderid text Set the order ID
webhookurl url If provided, SLYCE will send the transaction details to this URL. Please refer to the Response Fields section for complete details.
repid integer The ID of the Representative tied to the transaction. See Representatives in the API documentation for how to create a ID.

Customization

Name Type Description
opttabs string Only listed tabs are shown. Possible values: onetime, cardvault, payplan
optach boolean Disables ACH Payments
optreceipt boolean Disables Receipts
optonetimecheck boolean Removes Check radial button
optonetimecash boolean Removes Cash radial button
opteditableamount boolean Removes editable amount input box

Button

These options are for JS script implementation only.

Name Type Description
buttonLabel string The text used in a SLYCE button. Default is “Pay Now”.
buttonId string SLYCE button ID attribute.
buttonClass string SLYCE button class attribute.

Modes

These values can be passed through the parameter mode=value to adjust the behavior of the Plugin.

Value Description
authonly Transactions will be run as an Auth Only. Refer to the Capture Sale method in the API to process the transaction.

Response

Response Fields

Response Format

{
    "responseMessage": {
        "status": {
            "result": "approved",
            "resultCode": "A",
            "status": "pending",
            "statusCode": "P",
            "avsResponseCode": "00",
            "cvvResponseCode": "00",
            "error": "",
            "message": ""
        },
        "details": {
            "amount": "231.00",
            "type": "sale",
            "transactionDate": "2017-08-20 17:09:53",
            "batchID": 303700,
            "invoice": 1503274191,
            "orderID": null,
            "repID": null,
            "description": "Onetime Sale",
            "callbackURL": "CALLBACK_URL",
            "submittedBy": "139970",
            "comments": null,
            "custom": [],
            "userCustom": [],
            "lineitems": [],
            "currencyCode": "USD",
            "refNum": 125964565,
            "authCode": "600401"
        },
        "customer": null,
        "paymentDetails": {
            "method": "card",
            "cardNum": "XXXXXXXXXXXX2224",
            "token": "ijhl-wiwf-n08w-52hd",
            "cardType": "visa",
            "source": "usaepay"
        },
        "info": {
            "tranToken": "92b8511221f3856a646dfe8696f8a23c",
            "gatewayID": 1,
            "gateway": "usaepay",
            "referrer": "REFFERER_URL",
            "clientIP": "203.177.167.72",
            "mid": "513485010000008",
            "userID": 4,
            "userKey": "9ypnPRT9v2ChPCQv",
            "processTime": "1646.03"
        }
    }
}

Status

object: status

Field Type Description
result string Transaction result. (Approved, Declined, Error)
resultCode char Character representation of result. (A, D, E)
status string Status of transaction. (Pending, Settled, Voided, Refunded)
statusCode char Character representation of status. (P, S, V, R)
avsResponseCode int Indicates an AVS(ZIP code and Address) match. See table here for values.
cvvResponseCode int Indicates a CVV match. See table here for values.
error This field is depreciated and no longer used.
message string Description of error or decline.

Details

object: details

Field Type Description
amount double Amount to be charged.
type string Transaction type. (Sale, Refund, Recurring, AuthOnly)
refNum int Transaction reference number.
authCode string Authorization code.
transactionDate datetime Date and time the transaction was run.
batchID int Batch identification number.
invoice string Invoice number.
orderID string Order ID number.
repID int Representative ID number.
description string Description of transaction.
callbackURL string URL webhook response was sent to.
submittedBy string User who submitted transaction.
userCustom array Array of user defined custom fields (these are not recorded).

Comments

object: details.comments

Field Type Description
id int ID of comment
message string Comment Message.

Lineitems

object: details.lineitems

Field Type Description
id int ID of lineitem.
sku string Lineitem SKU.
name string Lineitem name.
description string Lineitem description.
totalCost double Total cost of lineitem.
quantity int Quantity of the lineitem.

Custom Fields

object: details.custom

Field Type Description
custom1-10 string Custom field value.

Customers

object: customers

Field Type Description
custID string Unique customer ID.
name string First and last name of customer.
company string Customer company.

paymentDetails

object: paymentDetails

Field Type Description
payID int ID of payment option.
method string Type of payment option. (Card, ACH)
cardHolder string Card holder name if available.
cardNum string Truncated card number.
cardType string Card holder association. (Visa, Mastercard, Etc.)
expiration date Expiration date if available.
account string ACH account number.
routing string ACH routing number.
checkNum int Check number.

Recurring

object: recurring

Field Type Description
id int Recurring plan ID.
status string Status of plan. (Ongoing, Completed)
type string Type of plan. (Subscription, Payplan)
scheme string Recurring scheme. (Monthly, Yearly, Bi-Weekly, Weekly)
amount double Amount to be charged for each payment.
total double Total recurring plan amount. Payplans only.
duration int Duration of recurring plan. Payplans only.
startDate date Date of first payment.
completedDate date Date of final payment.
nextDueDate date Next payment date.
paidCount int Number of payments made.

Info

object: info

Field Type Description
gatewayID int ID of gateway.
gateway string Name of gateway.
referrer string Domain slyce plugin was run from.
clientIP string IP of client running slyce plugin.
mid int Merchant ID.
userID int ID of Slyce user.
userKey string Key used by Slyce user.
processTime int Time it took to process.

Fraud

object: fraud

See Kount for more info on Kount integrations.

Field Type Description
fraudDecision string Recommendation from fraud system. Possible values are declined and approved.
fraudRules object Rule Id and Description of triggered rules. Values are unique to your Kount account. For More info see Kount’s documentation.

Webhook

The purpose of the webhook script will be to get transaction data back to your system. In order to take advantage of this feature, you will need to create a web script that can interpret a POST request. After every transaction, including monthly payment plans, SLYCE will send transactional data to the URL you designate in the webhookurl option.

Message Event

Message Event Sample

window.addEventListener('message', handleSlyceResponse, false);

function handleSlyceResponse(e) {
   if(e.origin == 'https://plugin.slycepay.com') {
      //Example use, do whatever you want below here
      console.log("Received Data: " + JSON.stringify(e.data.data));
      if(e.data.data.resultCode == 'A') {
         for(var mData in e.data.data)
         {
            document.getElementById('eventDiv').innerHTML += (mData + "=" + e.data.data[mData] + '<br>');
         }
      }
   }
}             

An additional way to get back transaction data is the message event. Every time a transaction is submitted, SLYCE sends out a message event that can be picked up with JavaScript. This method allows you to collect the transaction data in the page that calls SLYCE. The data fields in the message event match that of the Webhook. The list can be found here .

In the Message Event Sample, we are first creating a JavaScript event listener for the message event. Upon receiving a message event, the function “handleSlyceResponse” is called. Within this function, you can pull the data from the event and, for example, store it in a database.

Authenticate Response

Every transaction response has a “tranToken” parameter. To verify if the transaction is valid, the following method is used:

tranToken = md5(refNum + YOUR_SECRET_KEY)

As described in the Client-Side Encryption section, the secret key is a key that we will give you and should only be used in server-side code.

AVS and CVV Response Codes

AVS Response Codes

Code Description
00 Address: Match and ZIP: Match
01 Address: Match and ZIP: No match
02 Address: No Match and ZIP: Match
03 Address: No Match and ZIP: No Match

CVV Response Codes

Code Description
00 Match
01 No Match

Kount

Kount is a third party Fraud prevention system. When Kount is enabled for an account we collect a number of data points and send it over to Kount for evaluation. Kount will then, based on a set of rules, give us a recommendation about the transaction.

Example Response with Kount fields when adding a card.

{
 "name": "transaction_object",
 "data": {
  "customer": {
   "custID": "0001",
   "name": "Andy Rogers",
   "company": "Complete Merchant Solutions"
  },
  "paymentDetails": {
   "method": "card",
   "cardNum": "XXXXXXXXXXXX2232",
   "cardType": "discover",
   "source": "tokenex",
   "token": "aaaa111-bb22-cc33-dd44-eeeeee555555",
   "expir": "0919"
  },
  "info": {
   "gatewayID": 111,
   "gateway": "usaepayx",
   "clientIP": "11.11.111.11",
   "mid": "100000",
   "userID": 1000,
   "userKey": "bbBBHHaaa0001111",
   "processTime": "0.00"
  },
  "fraud": {
   "fraudDecision": "declined",
   "fraudRules": {
    "1155555": "Test Card Decline"
   }
  }
 }
}

Customer

One of the data points that we send to Kount is is the full customer billing address. For the best results with Kount it is highly recommended that customers be created in the Slyce system with accurate billing info. These customers should then be referenced when running a transaction or saving a card.

See the Customer Section for more details.

Behavior

Running a transaction through Kount will result in three types of recommendations.

See Response Fields for info on the parameters for Kount that detail these recommendations.

How to get it

Talk with your account manager to get access to Kount.

CSS

Request with StyleSheet:

<?php
// Data
$params = array(
  'api_key' => 'YOUR_SECRET_KEY',
  'data' => array(
     'version' => 'standard',
     'key' => 'Slyce_Key_Here',
     'amount' => '1'
     'stylesheet' => 'URL_LOCATION_TO_STYLESHEET_FILE'
  )
);
$ch = curl_init();
curl_setopt_array($ch, array(
   CURLOPT_URL => 'https://plugin.slycepay.com/api/request',
   CURLOPT_SSL_VERIFYPEER => false,
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_POSTFIELDS => http_build_query($params)
));
$res = json_decode(curl_exec($ch));
curl_close($ch);
$token = $res->error ?: $res->response_data->token;
?>
Field Type Description
stylesheet string The url location of the stylesheet file.
ex: https://yourdomain.com/css/slyce.css

With several different color scheme options, SLYCE offers the ability to customize its appearance based on your color preferences. This way, SLYCE can maintain the aesthetics and fluidity of your software.

Refer to the sample request as your basis on how to pass a stylesheet file:

For your guide, here are the main elements you can style.

Stylesheet Element Guide