public void SettleRequest_OnValidRequestWithOptions_ReturnObjects() { // arrange const string posRefId = "test"; const string merchantReceiptHeader = ""; const string merchantReceiptFooter = "merchantfooter"; const string customerReceiptHeader = "customerheader"; const string customerReceiptFooter = ""; var options = new TransactionOptions(); options.SetMerchantReceiptFooter(merchantReceiptFooter); options.SetCustomerReceiptHeader(customerReceiptHeader); // act var request = new SettleRequest(posRefId); request.Options = options; var msg = request.ToMessage(); // assert Assert.Equal(merchantReceiptHeader, msg.GetDataStringValue("merchant_receipt_header")); Assert.Equal(merchantReceiptFooter, msg.GetDataStringValue("merchant_receipt_footer")); Assert.Equal(customerReceiptHeader, msg.GetDataStringValue("customer_receipt_header")); Assert.Equal(customerReceiptFooter, msg.GetDataStringValue("customer_receipt_footer")); }
public void SettleRequest_OnValidRequest_ReturnObjects() { // arrange const string posRefId = "test"; // act var request = new SettleRequest(posRefId); var msg = request.ToMessage(); // assert Assert.Equal("settle", msg.EventName); Assert.Equal(posRefId, request.Id); }
public void SettleRequest_OnValidRequestWithOptionsNone_ReturnObjects() { // arrange const string posRefId = "test"; // act var request = new SettleRequest(posRefId); var msg = request.ToMessage(); // assert Assert.Equal("", msg.GetDataStringValue("merchant_receipt_header")); Assert.Equal("", msg.GetDataStringValue("merchant_receipt_footer")); Assert.Equal("", msg.GetDataStringValue("customer_receipt_header")); Assert.Equal("", msg.GetDataStringValue("customer_receipt_footer")); }
public void SettleRequest_OnValidRequestWithConfig_ReturnObjects() { // arrange const string posRefId = "test"; var config = new SpiConfig(); config.PrintMerchantCopy = true; config.PromptForCustomerCopyOnEftpos = true; config.SignatureFlowOnEftpos = true; // act var request = new SettleRequest(posRefId); request.Config = config; var msg = request.ToMessage(); // assert Assert.True(msg.GetDataBoolValue("print_merchant_copy", false)); Assert.False(msg.GetDataBoolValue("prompt_for_customer_copy", false)); Assert.False(msg.GetDataBoolValue("print_for_signature_required_transactions", false)); }