Exemplo n.º 1
0
        public async static Task <HttpResponse> AuthorizeOrder(string OrderId)
        {
            var request = new OrdersAuthorizeRequest(OrderId);

            request.Prefer("return=representation");
            request.RequestBody(new AuthorizeRequest());
            var response = await PayPalClient.client().Execute(request);

            return(response);
        }
Exemplo n.º 2
0
        //Below function can be used to create an order with minimum payload.
        public async static Task <HttpResponse> CreateOrderWithMinimumFields()
        {
            Console.WriteLine("Create Order with minimum payload..");
            var request = new OrdersCreateRequest();

            request.Headers.Add("prefer", "return=representation");
            request.RequestBody(BuildRequestBodyWithMinimumFields());
            var response = await PayPalClient.client().Execute(request);

            return(response);
        }
Exemplo n.º 3
0
        //Below function can be used to create an order with complete payload.
        public async static Task <HttpResponse> CreateOrder(List <CartItem> carts, string Add, string host)
        {
            var request = new OrdersCreateRequest();

            request.Prefer("return=representation");
            request.RequestBody(BuildRequestBody(carts, Add, host));
            var response = await PayPalClient.client().Execute(request);

            var result = response.Result <Order>();

            return(response);
        }