public void Setup() { _paymentRequest = new TokenPaymentRequest { Amount = 30, OrderNumber = "abc123", Token = new Token { Code = "abcdefghujk-000122999-asdfjlkasd8ha8shdfo8hasdfha", Name = "John Doe" } }; _executer = new Mock<IWebCommandExecuter>(); }
/// <summary> /// Pre-authorize a payment. Use this if you want to know if a customer has sufficient funds /// before processing a payment. A real-world example of this is pre-authorizing at the gas pump /// for $100 before you fill up, then end up only using $60 of gas; the customer is only charged /// $60. The final payment is used with PreAuthCompletion(). /// /// The PreAuth is used with tokenized payments with a token generated from the Legato Javascript service. /// </summary> /// <returns>The response, in particular the payment ID that is needed to complete the purchase.</returns> /// <param name="paymentRequest">Payment request.</param> public PaymentResponse PreAuth(TokenPaymentRequest paymentRequest) { Gateway.ThrowIfNullArgument (paymentRequest, "paymentRequest"); return PreAuthInternal (paymentRequest); }