Click or drag to resize

LoyaltyPartnerClientTransaction Method

Submit a Partner Reward Transaction.

The updated Card Ponts Balance is returned.

Remarks
  • The Transaction generated requires to be approved. Approval is completed via the Administration End Point Service Method: ApproveTransaction
  • TransactionID is optional. If no TransactionID is submitted, then a unique TransactionID is returned by the Service
  • Transaction Value must be between a configurable Minimum and Maximum value
  • The submitted Transaction Date must be Less Than or Equal to the current Date and Time
Syntax
C#
public ResultOfTransactionProduct Transaction(
	ManagementGroupRequestOfPartnerRewardTransaction request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfPartnerRewardTransaction

Return Value

Type: ResultOfTransactionProduct
Examples
C#
using (var svc = new LoyaltyService.LoyaltyPartnerClient())
{
  var request = new LoyaltyService.ManagementGroupRequestOfPartnerRewardTransaction();
  request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin
  request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin

  var partnerRewardTransaction = new LoyaltyService.PartnerRewardTransaction();
  partnerRewardTransaction.TransactionID = "Transaction ID"; //Optional - Must be unique. Will be generated if not supplied
  partnerRewardTransaction.PartnerRSN = new Guid("db56960d-1ac5-48f5-bb60-6d1ff3b29340");;//Required - RSN of partner
  partnerRewardTransaction.TerminalID = "Terminal_ID_1"; //Optional
  partnerRewardTransaction.CashierCode = "Cashier_Code_1"; //Optional
  partnerRewardTransaction.ClientVersion = "Client_Version"; //Optional
  partnerRewardTransaction.CardNumber = "21000005"; //Required
  partnerRewardTransaction.TransactionDate = DateTime.Now; //Required - cannot be a future date
  partnerRewardTransaction.TransactionSaleValue = 1234.56M; //Required - must be a value between -100000.00 and 100000.00
  partnerRewardTransaction.TransactionNotes = "Please process transaction with haste"; //Optional

  var lineItem = new LoyaltyService.SaleTransactionLine();
  lineItem.ProductCode = "Product_123"; //Optional
  lineItem.ItemDescription = "Red Bag"; //Optional
  lineItem.Quantity = 2; //Optional
  lineItem.Department = "Bags"; //Optional
  lineItem.DiscountReason = "Loyal customer"; //Optional
  lineItem.Category = "Products";//Optional
  lineItem.LineID = "RedBag_123";//Optional
  lineItem.LineValue = 50.0m;//Optional
  lineItem.ProductBrand = "Bag Makers";//Optional
  lineItem.UnitValue = 25.0m;//Optional

  var lineItemCustomFields = new LoyaltyService.ProfileCustomFieldValues();
  lineItemCustomFields.CustomText_1 = string.Empty; //Optional CustomText_2 - CustomText_15 available
  lineItemCustomFields.CustomBoolean_1 = false; //Optional CustomBoolean_2 - CustomBoolean_20 available
  lineItemCustomFields.CustomDate_1 = DateTime.MinValue; //Optional CustomDate_2 - CustomDate_15 available
  lineItemCustomFields.CustomDecimal_1 = 0.0M; //Optional CustomDecimal_2 - CustomDecimal_5 available
  lineItemCustomFields.CustomInteger_1 = 0; //Optional CustomInteger_2 - CustomInteger_10 available
  lineItem.CustomFieldValues = lineItemCustomFields;//Optional

  //add line items to transaction
  partnerRewardTransaction.TransactionLines = new LoyaltyService.SaleTransactionLine[] { lineItem };

  //add transaction to request
  request.Value = partnerRewardTransaction;

  LoyaltyService.ResultOfTransactionProduct result = svc.Transaction(request);

  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed
    throw new Exception(result.FaultDescription);
  }
}
See Also