PiLink 1.0.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package PiLink --version 1.0.11                
NuGet\Install-Package PiLink -Version 1.0.11                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PiLink" Version="1.0.11" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PiLink --version 1.0.11                
#r "nuget: PiLink, 1.0.11"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PiLink as a Cake Addin
#addin nuget:?package=PiLink&version=1.0.11

// Install PiLink as a Cake Tool
#tool nuget:?package=PiLink&version=1.0.11                

Payment Innovators

Pi Link DLL provides a library to integrate with Pi Plus. Pi Link DLL allows a simple implementation of Pi Plus in card-present and card-not-present environments with a library call.

Anatomy:

PiLink contains a class called PiPlusLink, which in turn includes all objects, methods, and classes you will need.

Methods:

LaunchPiPlus Method

This public method instantiates all objects and classes.

Transaction Methods

These are the accepted transaction types you can call from PiLink.dll:

creditsale creditauth creditreturn gettoken creditcapture creditvoid creditadjust paynow payform paystatus paycancel

The followings are public methods to perform transactions:

CreditSale() : Perform a credit sale transaction

CreditAuth() : Performs a credit auth transaction

CreditReturn() : Performs a credit return transaction

CreditVoid() : Performs a credit void transaction

CreditCapture() : Performs a credit capture transaction on an auth

CreditAdjust() : Performs a credit adjust transaction

GetToken() : Performs a request token transaction

PayNow(string server="live") : Returns a response which includes a payment link to be sent to your customers to accept a payment for a card-on-file. While in test mode send stage for the sever value.

PayForm(string server="live") : Returns a response which includes a payment link to be sent to your customers to use a Hosted-Payment-Form and make a payment. While in test mode send stage for the sever value.

**PayStatus: Returns the transactions for the selected date range

Classes:

The following classes represent objects that store and return field values in requests and responses:

Transaction Fields (Request): Class name: TransFields

Field Description
Account Valid Pi Account number
Serial Device Serial Number
Ticket Ticket Id,or Invoice Id
Token Valid card token
Ptk Pi Transaction Key
Zip Zip Code
Address Street Address
Userid User or Clerk Id
Email Email address for receipt
Format Output file format. xml or txt ONLY
Amount Transaction amount
TipReq Send tip amount along with the sales amount.
Only 0 or 1. Default = 0
Tip Send tip amount along with the sales amount.
Path Path to where you want to save the response file
FirstName Customer first name
LastName Customer last name
Executable Path to PiPlus executable
Receipt receipt request. True or False
ShowUI Show or Hide PiPlus Window. True or False
AutoRun Automatically run the transaction on the
terminal. True or False
Startdate Use this field to identify the start date for a PayStatus transaction
Enddate Use this field to identify the end date for a PayStatus transaction
Lastfour use it when you perform a PayNow, or PayForm transaction
Cardbrand send it when you perform a PayNow, or PayForm transaction

Response fields are grouped into three separate groups:

  • TransactionFields
  • EMVFields
  • ReceiptFields

Transaction Details (Response)

Class name: TransactionFields

Class name: StatusFields

Class name: PayNowResponse

Field Description
TransactionResult Returns Transaction result true or false
TransactionType Returns the transaction type
Description Returns the response message
ApprovalCode Returns the transaction approval code
CardHolder Returns the cardholder name (name on card)
LastFour Returns the last four digits the card
Expiration Returns the card’s expiration date (mm/yy)
Ptk Returns Pi Transaction Key
CardType Returns the card type (VISA, MASTERCARD...)
Amount Returns the requested amount of the transaction
ApprovedAmount Returns the approved amount by the processor
TipAmount Returns tip amount
Swiped Returns card-present or card-Not-Present status
Token Returns card token generated by the processor
Surcharge Returns Transaction surcharge amount. If set to
apply on the terminal
AVSResult Address Verification results

Receipt Fields (Response)

Class name: ReceiptFields

Field Description
ReceiptAC Application Cryptogram
ReceiptAID Application Identifier
ReceiptAL Application Label
ReceiptAPN Application Preferred Name
ReceiptATC Application Transaction Counter
ReceiptApprovalCode Approval Code
ReceiptResponseCode Authorization Response Code
ReceiptCardNumber Card Number
ReceiptCardType Card Type (Visa, Mastercard...)
ReceiptUser User or Clerk
ReceiptEntry Entry Legend
ReceiptMethod Entry Method
ReceiptMerchantId Merchant ID
ReceiptPinText Pin Verification Text
ReceiptNumber Receipt Number
ReceiptSalesTax Receipt Sales Tax
ReceiptSignature Receipt Signature text
ReceiptSubTotal Sub Total
ReceiptTVR Terminal Verification Result
ReceiptTip Tip Amount
ReceiptTotalAmount Total Amount
ReceiptDateTime Receipt Date/Time
ReceiptTransactionId Transaction Id
ReceiptTransactionRef Transaction Reference Number
ReceiptTransactionStatus Transaction Status Information
ReceiptTransactionType Transaction Type
ReceiptVerbiage Receipt Verbiage

EMV Fields (Response)

Class name: EMVFields

Field Description
TC Transaction Certificate
TVR Transaction Verification Result
AID Application Identification
TSI Transaction Status Information
ATC Application Transaction Counter
APPLAB Application Laboratory
APPPN Application Preferred Name
IAD Issuer Application Data
ARC Authorization Response Cryptogram
CID Cryptogram Information Data

StatusFields (Response)

Class name: StatusFields

id Unique ID for the response
status returns the response status from the customer action values are EXPIRED, APPROVED, DECLINED, REFUSED, PENDING, and CLICKED
date is the transaction date
account is the merchant's Pi account
response is Pi's standard JSON response. You need to use this field and build your desired response

PayNowResponse (Response)

Class name: PayNowResponse ptk is Pi unique transaction key account is the merchant's Pi account number url is the link to access an HPF form or pay with a card-on-file status is the current stayus of the transaction. Default is PENDING

### Installation

Pi Link DLL requires .Net Framework version 4.7 or higher.
_This guide explains adding the Pi Link DLL to your .Net application in the Visual Studio environment._

1. Download the Pi Link from our website, and copy it to a folder in your development system.
2. In VS, open your project, and in the Solution Explorer, right-click on the project name.
3. Select Add, and then from the next menu options, select Existing item.
4. Browse to the location where you saved the PiLink.dll file. Select the file and click on the Add
    button.
5. After the file is added to your project, select it, and go to its properties windows.
6. In the Copy to Output Directory property, select the Copy always.
That's it!


If your application uses a setup program, make sure to include the PiLink.dll to your setup application.
In your code, you must name the DLL and request its import:

using PiLink;

#### Usage:

link contains a class called PiPlusLink, which in turn includes all objects, methods, and classes you
will need.
Start by creating an instance of PiPlusLink in your code:

PiPlusLink myLink = new PiPlusLink();

Call the LaunchPiPlus() Public method to set everything up:

myLink.LaunchPiPlus();

Next, you will need to build a request object. The following code shows how to build a request for a
credit sale transaction:

myLink.transFields.Amount = Convert.ToDouble(textAmount);
myLink.transFields.Ticket = textTicket ;
myLink.transFields.Ptk = textPTK ;
myLink.transFields.Address = textAddress ;
myLink.transFields.Email = textEmail ;
myLink.transFields.Executable = textExe ;
myLink.transFields.FirstName = textFname ;
myLink.transFields.LastName = textLname ;
myLink.transFields.Path = textPath ;
myLink.transFields.Serial = textSerial ;
myLink.transFields.Token = textToken ;
myLink.transFields.Userid = textUser ;
myLink.transFields.Zip = textZip ;

Let’s call the credit sale method:

myLink.CreditSale();

This method performs the credit sale transaction and returns a Boolean value that indicates whether
the transaction succeeded or not.


Assuming that you have a control to show the transaction results, the following code snippet will
provide you with the transaction results:

"Transaction Type: " + myLink.transactionDetails.TransactionType
"Transaction Result: " + myLink.transactionDetails.TransactionResult
"Amount: " + myLink.transactionDetails.Amount
"Approved Amount: " + myLink.transactionDetails.ApprovedAmount
"Tip Amount: " + myLink.transactionDetails.TipAmount
"Approval Code: " + myLink.transactionDetails.ApprovalCode
"Token: " + myLink.transactionDetails.Token
"Card Type: " + myLink.transactionDetails.CardType
"Card Holder: " + myLink.transactionDetails.CardHolder
"Description: " + myLink.transactionDetails.Description
"PTK: " + myLink.transactionDetails.Ptk
"Last four: " + myLink.transactionDetails.LastFour
"Expiration: " + myLink.transactionDetails.Expiration
"Surcharge: " + myLink.transactionDetails.Surcharge
"Avs Result: " + myLink.transactionDetails.AvsResult

In addition, you can call **myLink.receiptDetails** to extract response receipt fields and call
**myLink.emvDetails** to get EMV fields from the response.



For more information, please visit our website at paymentinnovators.com or contact us :
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Latest version with updates for Pi Plus WPF . PayStatus report bug has been fixed!