4D Payments SDK 2016 .NET Edition

Questions / Feedback?

EncryptedPIN Property

DUKPT DES encrypted pin block, retrieved from a PIN pad.


public string EncryptedPIN { get; set; }
Public Property EncryptedPIN As String

Default Value



A 16-byte encrypted PIN and associated KSN are required for all debit Sale and Credit transactions. These values must be retrieved from a certified DUKPT DES pin pad device.

The EncryptedPIN and KSN are not required for ReverseLastTransaction transactions.

The following code snippet shows how to send a simple debit sale transaction with all required properties.

  FDMSDebit1.MerchantNumber = "YOURNUMBER"
  FDMSDebit1.MerchantTerminalNumber = "YOURTERMID"
  FDMSDebit1.DatawireId = "YOURDID"
  FDMSDebit1.URL = "https://staging1.datawire.net/sd"; // test server
  FDMSDebit1.TransactionNumber = 4;
  FDMSDebit1.TransactionAmount = "100";
  FDMSDebit1.Card.EntryDataSource = edsTrack2;
  FDMSDebit1.Card.MagneticStripe = "9876543210012341234=12041200000001"; // (pin 1234)
  FDMSDebit1.EncryptedPIN = "0082943935BA205D";
  FDMSDebit1.KSN = "8765432109003000012";
  FDMSDebit1.ReceiptNumber = "123456";
If the transaction is successful, the ApprovalCode will start with "AP", and the CaptureFlag will be true. Even though debit transactions are on-line transactions, it is still necessary to settle them with First Data. The following example shows how to send a simple settlement. The first thing to do is to set up the FDMSSettle component's properties with the same information used for the debit sale:
  FDMSSettle1.MerchantNumber = FDMSDebit1.MerchantNumber;
  FDMSSettle1.MerchantTerminalNumber = FDMSDebit1.MerchantTerminalNumber;
  FDMSSettle1.DatawireId = FDMSDebit1.DatawireId;
  FDMSSettle1.URL = FDMSDebit1.URL;
  FDMSSettle1.MerchantServiceNumber = "8001234567";
  FDMSSettle1.BatchSequenceNumber = "101";  
  FDMSSettle1.IndustryType = itRetail;
Then all that needs to be done is add the detail record from the debit sale to the settlement component and call the SendSettlement method.
  FDMSSettle1.DetailRecords.Add(new FDMSRecordType(FDMSDebit1.GetDetailAggregate());
Note that in a live system you would store detail records in a database and send multiple records in a single batch at the end of the business day.

Copyright (c) 2021 4D Payments Inc. - All rights reserved.
4D Payments SDK 2016 .NET Edition - Version 16.0 [Build 8017]