Exemplo n.º 1
0
 /// <summary>Construct a new <see cref="SagePayPaymentGateway" /> that uses the supplied <see cref="IHttpPostTransport" /> to communicate with the remote server.</summary>
 /// <param name="http">An instance of a class implementing <see cref="IHttpPostTransport"/> to provide HTTP POST capabilities.</param>
 /// <param name="vendorName">The vendor name used by this SagePay installation.</param>
 /// <param name="vpsProtocol">The version of the VPS Protocol used by the remote SagePay system.</param>
 /// <param name="mode"></param>
 public SagePayPaymentGateway(IHttpPostTransport http, string vendorName, decimal vpsProtocol, GatewayMode mode)
 {
     this.http = http;
     this.mode = mode;
     this.vendorName = vendorName;
     this.vpsProtocol = vpsProtocol;
 }
 public GatewayInfo(string cloudService, Uri serviceUri, GatewayMode mode, Version gatewayVersion, AssemblyName api)
 {
     CloudService   = cloudService;
     ServiceUri     = serviceUri;
     Mode           = mode;
     GatewayVersion = gatewayVersion;
     Api            = api;
 }
Exemplo n.º 3
0
 private void VerifyPurchasePostUrl(GatewayMode mode, string postUri)
 {
     http.Setup(h => h.Post(new Uri(postUri), It.IsAny<string>())).Returns(MakePostResponse("OK"));
     var sagePay = new SagePayPaymentGateway(http.Object, "myVendor", 2.23m, mode);
     sagePay.Purchase("123", new Money(123.45m, new Currency("GBP")), card);
     http.VerifyAll();
 }
        private GatewayInfo CreateGatewayInfo <TGateway>(ExportFactory <TGateway, CloudGatewayMetadata> export, GatewayMode mode)
        {
            var metadata = export.Metadata;

            return(new GatewayInfo(metadata.CloudService, metadata.ServiceUri, mode, export.CreateExport().Value.GetType().Assembly.GetName().Version, metadata.ApiAssembly));
        }
Exemplo n.º 5
0
 private void VerifyPurchasePostUrl(GatewayMode mode, string postUri)
 {
     http.Setup(h => h.Post(new Uri(postUri), It.IsAny<string>()));
     var sagePay = new SagePayPaymentGateway(http.Object, "myVendor", 2.23m, mode);
     sagePay.Purchase("123", 123.45m, "GBP", card);
     http.VerifyAll();
 }