Introduction

APIKey is used to authenticate and identity account info.

SecretKey is used as a security measure. Only use it on the server side and do NOT share it.

Tokenize a Credit Card

Description:

This is used to mask a credit card on the front end using javascript. This is meant to be called via javascript on the client's browser. It uses an object called LBPayments brought in from the included script. It will create a customer and token (payment method) in the payment service. If you only want to add a token to an existing customer pass in the CustID return from this method (tokenize()) from the first time you called it. If the request's meta.serviceStatus == Success it will always return a CustID and a Token.


There is a method called tokenize on it that accepts two parameters. LBPayments.tokenize(data,callback);. The first parameter, "data", is a object of the parameters specified below. The second parameter is callback function name. When the function is executed it will use the callback to give you the response back to you. it will only return JSON


Include these scripts, in this order:

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://test.csipay.com/services/api.proxynization.js"></script>
<script src="https://devwebservice.liftbrands.com/scripts/LBPayments/1.1/LBPayments.js"></script>

Parameters:

Type Max Len Required
MerchantAcct: GUID 36 Yes
Last4: Int 4 No
CardType: String 4 No
VSCC VISA 4111111111111111
MSCC MasterCard 5555555555554444
AECC AmericanExpress 378282246310005
DICC Discover 6011111111111117
ExpMonth: Int 2 No
Conditiionally required if Type == CC.
ExpYear: Int 4 No
Conditiionally required if Type == CC.
Number: String 20 Yes
Credit Card Number Value.
FirstName: String 150 No
LastName: String 150 No
Type: String 2 Yes
BA = Bank Account
CC = Credit Card
RoutingNum: String 2 Yes
Conditiionally required if Type == BA.
CustID: String 32 No
Is returned by tokenize(). The next time you call tokenize for one of your customers, you can pass that CustID in and we will only add a token NOT a customer and a token.
CustRef: String 36 No
Key to your customer record, for auditing purposes. If passed in, it must be unique amongst all your customers.

Example:

$(function(){

		$("#myForm").on("submit",function(e){

			e.preventDefault();
    
            var accountNumber = LBPayments.getRawNumber(("#accountNumber").val());

			LBPayments.tokenize({
				APIKey : '[[API KEY HERE]]'
				,MerchantAcct: '[[MERCHANT ACCCOUNT KEY HERE]]'
				,last4:LBPayments.getLastFour(accountNumber)
				,number:accountNumber // credit card or bank account
				,cardType:LBPayments.getType(accountNumber)
				,type:'CC'
				,expMonth:'01'
				,expYear:'2015'
				,firstName:'John'
				,lastName:'Doe'
			},'mycallback');

		});

	});

	window.mycallback = function(data){

		$("#token").val(data.result.token);

		$("#myForm").get(0).submit();

	};

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{
        token:'CC4201401042119'
    }
}

Update a Token

Description:

Update the expiration date of a token. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/updateToken/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
Token String 50 Yes
ExpMonth: Int 2 No
Conditiionally required if the token's Type == CC.
ExpYear: Int 4 No
Conditiionally required if the token's Type == CC.

Example:

//url
'/api/paymentservice/updateToken/[[API KEY HERE]]'
//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
SecretKey = '[[YOUR SECRETKEY HERE]]'
Token = 'CC4201401042119'
ExpMonth = 12
ExpYear = 2020
    

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{}
}

Authorize a Sale

Description:

Authorize a sale to check if they have sufficient funds. It will create a pending charge on there account. After 24 hours the pending charge will be removed if it is not committed. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/authSale/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
Token String 50 Yes
Amount Int 32 Yes
Amount in cents. $1.00 == 100. You can force a response code in test mode by passing a "Force Amount" from the the "Response Codes" page.
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranRef String 36 No
Key to your transaction/payment record, for auditing purposes. If passed in, it must be unique amongst all your transactions.

Example:

//url
'/api/paymentservice/authSale/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
Token = 'CC4201401042119'
Amount = 100
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranRef = '456'

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{
       transactionID:123
       ,transactionDate:'2014-04-02T13:17:32.1912361Z'
       ,referenceCode:'456'
    }
}

Post a Sale

Description:

Finalize the pending charge on the account. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/commitSale/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranID Int 32 Yes
TranID is returned from AuthSale() or Sale().

Example:

//url
'/api/paymentservice/commitSale/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranID = 123

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{}
}

Authorize and Post a Sale Combined

Description:

Authorize and attempt to commit a charge in one webservice call. It will create a pending charge on there account. After 24 hours the pending charge will be removed if it is not committed. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/sale/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
Token string 50 Yes
Amount Int 32 Yes
Amount in cents. $1.00 == 100. You can force a response code in test mode by passing a "Force Amount" from the the "Response Codes" page.
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranRef String 36 No
Key to your transaction/payment record, for auditing purposes. If passed in, it must be unique amongst all your transactions.

Example:

//url
'/api/paymentservice/sale/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
Token = 'CC4201401042119'
Amount = 100
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranRef = '456'

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{
       transactionID:123
       ,transactionDate:'2014-04-02T13:17:32.1912361Z'
       ,referenceCode:'456'
    }
}

Refund a Sale

Description:

Refund a previously committed transaction. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/refundSale/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranID Int 32 Yes

Example:

//url
'/api/paymentservice/refundSale/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranID = 123

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{}
}

Void a Sale

Description:

Void a previously committed transaction. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/voidSale/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranID Int 32 Yes
TranID is returned from AuthSale() or Sale().

Example:

//url
'/api/paymentservice/voidSale/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranID = 123

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{}
}

Authorize a Credit

Description:

Authorize a credit to check if the account exists. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/authCredit/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
Token string 50 Yes
Amount Int 32 Yes
Amount in cents. $1.00 == 100. You can force a response code in test mode by passing a "Force Amount" from the the "Response Codes" page.
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranRef String 36 No
Key to your transaction/payment record, for auditing purposes. If passed in, it must be unique amongst all your transactions.

Example:

//url
'/api/paymentservice/authCredit/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
Token = 'CC4201401042119'
Amount = 100
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranRef = '456'

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{
       transactionID:123
       ,transactionDate:'2014-04-02T13:17:32.1912361Z'
       ,referenceCode:'456'
    }
}

Post a Credit

Description:

Finalize the pending credit on the account. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/commitCredit/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranID Int 32 Yes
TranID is returned from AuthCredit() or Credit().

Example:

//url
'/api/paymentservice/commitCredit/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranID = 123

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{}
}

Authorize and Post a Credit Combined

Description:

Authorize and attempt to commit a credit in one webservice call. It will create a pending charge on there account. After 24 hours the pending credit will be removed if it is not committed. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/credit/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
Token String 50 Yes
Amount Int 32 Yes
Amount in cents. $1.00 == 100. You can force a response code in test mode by passing a "Force Amount" from the the "Response Codes" page.
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranRef String 36 No
Key to your transaction/payment record, for auditing purposes. If passed in, it must be unique amongst all your transactions.

Example:

//url
'/api/paymentservice/credit/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
Token = 'CC4201401042119'
Amount = 100
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranRef = '456'

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{
       transactionID:123
       ,transactionDate:'2014-04-02T13:17:32.1912361Z'
       ,referenceCode:'456'
    }
}

Void a Credit

Description:

Void a previously committed transaction. This is a POST web service call that is used with your SecretKey that is meant to be called server side.

URL:

/api/paymentservice/voidCredit/[[API KEY HERE]]

Parameters:

Type Max Len Req.
MerchantAcct GUID 36 Yes
SecretKey GUID 36 Yes
Do NOT share your secret key and only use it on the server side.
TranID Int 32 Yes
TranID is returned from AuthCredit() or Credit().

Example:

//url
'/api/paymentservice/voidCredit/[[API KEY HERE]]'

//parameters
MerchantAccount = '[[YOUR SECRETKEY HERE]]'
SecretKey = '[[YOUR SECRETKEY HERE]]'
TranID = 123

Result:

{
    meta: {
        responseCode:{
            code: 'A01'
            ,description: 'Accepted'
        }
        , serviceStatus: 'Success'
    }
    , result:{}
}