static void Main(string [] args) { try { var options = new Options(); try { if (!CommandLine.Parser.Default.ParseArguments(args, options)) { // Display the default usage information System.Console.WriteLine(options.GetUsage()); return; } } catch (Exception ex) { System.Console.WriteLine("Inccorect Parameters. " + ex); System.Console.WriteLine(options.GetUsage()); return; } //TODO: We need to remove this statement after we are able to validate Visa ssl certificate during handshake ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, errors) => { return(true); }; VisaInvoker = new VisaInvoker(NoRetryPolicy.Instance); System.Console.WriteLine("Proxy Info: " + VisaInvoker.GetProxyInfo()); Task task = null; if (options.VisaMethod == VisaMethod.SearchMerchantDetailsByAttribute) { task = SearchMerchantDetailsByAttributeAsync(); } //user cmd line parameter "-m 2" to invoke createOffer else if (options.VisaMethod == VisaMethod.CreateOffer) { task = CreateOfferAsync(); //task = CreateOfferAlreadyExistSameNameDifferenIdAsync(); //task = CreateOfferAlreadyExistDifferentNameSameIdAsync(); //fails when we use external offer id //task = RejectOfferAsync("a12b8356-3bda-418b-b845-dc15523c26fa"); //succedd when we use visa offer id //task = RejectOfferAsync("4661273"); } task?.Wait(); } catch (Exception ex) { System.Console.Write(ex); } }
/// <summary> /// Gets the object to use to perform operations on users. /// </summary> /// <param name="performanceInformation"> /// The object through which performance information can be added and obtained. /// </param> /// <param name="visaInvokerOverride"> /// The specific VisaInvoker object to return, if not null. /// </param> /// <param name="config"> /// The config object. /// </param> public static IVisaInvoker BuildVisaInvoker(PerformanceInformation performanceInformation, IVisaInvoker visaInvokerOverride, CommerceConfig config) { IVisaInvoker result = new VisaInvoker(); result.PerformanceInformation = performanceInformation; if (config.UseMockPartnerDependencies) { result = LateBinding.BuildObjectFromLateBoundAssembly <IVisaInvoker>("MockVisaInvoker", LateBoundMocksAssemblyTypes); } // If the override object is not null, return it instead. if (visaInvokerOverride != null) { result = visaInvokerOverride; } return(result); }