Payment Device Request
A code sample of PaymentDeviceRequest for Sale transaction can be seen below.
PosClientService _posClientService = new PosTcpClientService(ipAddress: "127.0.0.1", port: 5002);
//Optional: TransactionConfig can also be set via configuration files, see "Configuration files" documentation for more information.
_posClientService.TransactionConfig = new Credential
{
CustomerCode = "ABF",
Site = "PXP000000001",
Workstation = "001",
Merchant = "1234567890",
Username = "PXPUser",
Password = "Testing",
Culture = "en"
};
//Optional: PedConfig can also be set via configuration files, see "Configuration files" documentation for more information.
_posClientService.PedConfig = new PedEndpointAddress
{
EndpointAddressType = PedEndpointAddressType.Serial,
SerialEndpointAddress = new SerialEndpointAddress
{
ComPort = "com9"
}
};
var paymentDeviceRequest = new PaymentDeviceRequest {
Workstation = "001",
AuthorisationType = AuthorisationConnectionType.OnlineAuthorization,
Amount = 10.50M,
DateTime = DateTime.Now,
TransactionReference = "PaymentDevice",
TransactionType = TransactionType.Sale,
KeyedOnPed = false,
CustomerPresent = false
};
var paymentDeviceResponse = await _posClientService.ProcessAsync(paymentDeviceRequest);
Console.WriteLine(paymentDeviceResponse.ResponseCode);
Console.WriteLine(paymentDeviceResponse.ResponseMessage);
Console.WriteLine(paymentDeviceResponse.FaultResponseCode);
Console.WriteLine(paymentDeviceResponse.CaptureMethod);
Console.WriteLine(paymentDeviceResponse.AuthorityCode);
Console.WriteLine(paymentDeviceResponse.AuthorityMethod);
Console.WriteLine(paymentDeviceResponse.TokenisedCardNumber);
Console.WriteLine(paymentDeviceResponse.TransactionReference);
Console.WriteLine(paymentDeviceResponse.PEDSerialNumber);
Console.WriteLine(paymentDeviceResponse.Token);
Console.WriteLine(paymentDeviceResponse.ReceiptXML);
The following tables contain PaymentDeviceRequest objects and their detailed definitions. The field definitions are divided into request fields and response fields.
PaymentDeviceRequest
Field Name | Type (C#) | Mandatory | Description |
---|---|---|---|
Workstation | string | Yes | This is the workstation number, a unique workstation ID allocated to a workstation when the service is set up |
AuthorisationType | Enum | Yes |
This is the authorisation type to distinguish if the transaction is processed online or offline, including: OnlineAuthorisation is used with Sale/Refund/PreAuthorisation OfflineAuthorisation is used with Sale/Refund ForcedFailOver is used with Sale/Refund/PreAuthorisation |
Currency | string | Yes | This is the currency of the transaction. This is the currency code. A three-letter alphabetic code in accordance with ISO 4217 |
Amount | decimal | Yes | This is the monetary value of the transaction in minor units |
DateTime | DateTime | Yes | This is the current date and time of the transaction on the computer, expressed as the local time |
TransactionReference | string | Yes | This is the merchant's own unique reference for the transaction |
TransactionType | Enum | Yes |
This is a transaction type of the transaction, including: Sale Refund Preauthorisation |
KeyOnPed | bool | No | This is the object to define if the transaction is processed using key on ped method or not. If not sent or sent as false, activate PED as normal. If sent as true, activate PED in Key mode |
CustomerPresent | bool | No | This is to define if the customer presents when transaction is made or not |
PaymentDeviceResponse
Field Name | Type (C#) | Mandatory | Description |
---|---|---|---|
ResponseCode | string | Yes | This is the response code indicating the result of the processing operation |
FaultResponseCode | int | Yes | This is the code indicating the reason when the response code is an "Error" |
ResponseMessage | string | Yes | This is the human readable message from either the acquirer or the ANYpay service that describes the Response Code |
AuthorityCode | string | Yes | This is the authorization code provided by the acquirer, card issuer or ANYpay |
AuthorityMethod | string | Yes | This is the method used to authorize the transaction |
CaptureMethod | Enum | Yes | The card data capture method |
TokenisedCardNumber | string | Yes | This is the tokenized card number to uniquely identify a card number |
TransactionReference | string | Yes | This is the merchant's own unique reference for the request |
Token | string | Yes | This is the token generated by ANYpay to uniquely identify a transaction |
PEDSerialNumber | string | Yes | This is the serial number of PIN Entry Device |
ReceiptXML | string | Yes | This is an XML receipt which complies EMV receipt requirement. This following page lists objects and their detailed definitions of each XML parameter. |
Updated 2 months ago