Beispiel #1
0
        public GeekRefundQueryTest()
        {
            GeekSign geekSign = new GeekSign(AppProperties.GeekPublicKey, AppProperties.PrivateKey);

            HttpClient httpClient = new HttpClient();

            geekEndPoint = new GeekEndPoint(httpClient, geekSign);

            uriComponents = new GeekUriComponents(GeekPaymentProperties.Scheme, GeekPaymentProperties.Host, geekSign);

            responseParser = new RefundInfoResponseParser();
        }
        private GeekRefund GetRefund()
        {
            GeekSign geekSign = new GeekSign(AppProperties.GeekPublicKey, AppProperties.PrivateKey);

            HttpClient   httpClient   = new HttpClient();
            GeekEndPoint geekEndPoint = new GeekEndPoint(httpClient, geekSign);

            GeekUriComponents uriComponents = new GeekUriComponents(GeekPaymentProperties.Scheme, GeekPaymentProperties.Host, geekSign);

            HttpResponseParser <RefundInfo> responseParser = new RefundInfoResponseParser();

            return(new GeekRefund(geekEndPoint, uriComponents, responseParser, AppProperties.AppID));
        }
Beispiel #3
0
        private GeekOrderClose GetClose()
        {
            GeekSign geekSign = new GeekSign(AppProperties.GeekPublicKey, AppProperties.PrivateKey);

            HttpClient   httpClient   = new HttpClient();
            GeekEndPoint geekEndPoint = new GeekEndPoint(httpClient, geekSign);

            GeekUriComponents uriComponents = new GeekUriComponents(GeekPaymentProperties.Scheme, GeekPaymentProperties.Host, geekSign);

            HttpResponseParser <OrderInfo> responseParser = new OrderInfoResponseParser();

            return(new GeekOrderClose(uriComponents, geekEndPoint, responseParser, AppProperties.AppID));
        }
        public static void Main(string[] args)
        {
            GeekSign geekSign = new GeekSign(AppProperties.GeekPublicKey, AppProperties.PrivateKey);

            ServiceProvider serviceProvider = new ServiceCollection()
                                              .AddLogging()
                                              .AddSingleton <ChannelOrderQuery>(new GeekOrderQuery(new GeekUriComponents(GeekPaymentProperties.Scheme, GeekPaymentProperties.Host, geekSign),
                                                                                                   new GeekEndPoint(new HttpClient(), geekSign), new OrderInfoResponseParser(), AppProperties.AppID))
                                              .AddSingleton(typeof(RetailOrderService))
                                              .BuildServiceProvider();

            serviceProvider.GetService <ILoggerFactory>()
            .AddConsole(LogLevel.Debug);

            ILogger <AppBoot> logger = serviceProvider.GetService <ILoggerFactory>()
                                       .CreateLogger <AppBoot>();

            logger.LogDebug("Start application");

            RetailOrderService retailOrderService = serviceProvider.GetService <RetailOrderService>();
            OrderInfo          orderInfo          = retailOrderService.Find("ORDER636881837081923670");

            logger.LogDebug("end application");
        }
Beispiel #5
0
 static GeekChannelOrderFactory()
 {
     httpClient   = new HttpClient();
     geekSign     = new GeekSign(AppProperties.GeekPublicKey, AppProperties.PrivateKey);
     geekEndPoint = new GeekEndPoint(httpClient, geekSign);
 }