private static GetOrderReferenceDetailsResponse InvokeGetOrderReferenceDetails(OffAmazonPaymentsServicePropertyCollection propertiesCollection,
            IOffAmazonPaymentsService service, string orderReferenceId, string addressConsentToken)
        {
            GetOrderReferenceDetailsRequest getOrderRequest = new GetOrderReferenceDetailsRequest();
            getOrderRequest.SellerId = propertiesCollection.MerchantID;
            getOrderRequest.AmazonOrderReferenceId = orderReferenceId;
            getOrderRequest.AddressConsentToken = addressConsentToken;

            GetOrderReferenceDetailsResponse response = service.GetOrderReferenceDetails(getOrderRequest);
            return response;
        }
        public static void GetOrderReferenceDetailsApiCall(string amazonOrderReferenceId, string addressConsentToken = null)
        {
            GetOrderReferenceDetailsRequest getRequestParameters = new GetOrderReferenceDetailsRequest();
            getRequestParameters.WithAmazonOrderReferenceId(amazonOrderReferenceId)
                .WithaddressConsentToken(null);

            OrderReferenceDetailsResponse getOrderReferenceDetailsResponse = client.GetOrderReferenceDetails(getRequestParameters);

            // IResponse is an interface method for common response methods for each response class
            IResponse interfaceresp = (IResponse)getOrderReferenceDetailsResponse;
            apiResponse["getOrderReferenceDetailsResponse"] = JObject.Parse(getOrderReferenceDetailsResponse.GetJson()).ToString();
        }
        private static GetOrderReferenceDetailsResponse InvokeGetOrderReferenceDetails(OffAmazonPaymentsServicePropertyCollection propertiesCollection,
                                                                                       IOffAmazonPaymentsService service, string orderReferenceId, string addressConsentToken)
        {
            GetOrderReferenceDetailsRequest getOrderRequest = new GetOrderReferenceDetailsRequest();

            getOrderRequest.SellerId = propertiesCollection.MerchantID;
            getOrderRequest.AmazonOrderReferenceId = orderReferenceId;
            getOrderRequest.AddressConsentToken    = addressConsentToken;

            GetOrderReferenceDetailsResponse response = service.GetOrderReferenceDetails(getOrderRequest);

            return(response);
        }
        public static void GetOrderReferenceDetailsApiCall(string amazonOrderReferenceId, string addressConsentToken = null)
        {
            GetOrderReferenceDetailsRequest getRequestParameters = new GetOrderReferenceDetailsRequest();

            getRequestParameters.WithAmazonOrderReferenceId(amazonOrderReferenceId)
            .WithaddressConsentToken(null);

            OrderReferenceDetailsResponse getOrderReferenceDetailsResponse = client.GetOrderReferenceDetails(getRequestParameters);

            // IResponse is an interface method for common response methods for each response class
            IResponse interfaceresp = (IResponse)getOrderReferenceDetailsResponse;

            apiResponse["getOrderReferenceDetailsResponse"] = JObject.Parse(getOrderReferenceDetailsResponse.GetJson()).ToString();
        }
示例#5
0
        public OrderReferenceDetails GetOrderReferenceDetails(AmazonPayClient client, string orderReferenceId, string addressConsentToken = null)
        {
            var request = new GetOrderReferenceDetailsRequest();

            request.SellerId = client.Settings.SellerId;
            request.AmazonOrderReferenceId = orderReferenceId;
            request.AddressConsentToken    = addressConsentToken;

            var response = client.Service.GetOrderReferenceDetails(request);

            if (response != null && response.IsSetGetOrderReferenceDetailsResult())
            {
                var detailsResult = response.GetOrderReferenceDetailsResult;

                if (detailsResult.IsSetOrderReferenceDetails())
                {
                    return(detailsResult.OrderReferenceDetails);
                }
            }
            return(null);
        }
示例#6
0
        public IActionResult GetDetails(string orderReferenceId, string amount, string addressConsentToken = null)
        {
            var currencyCode = (Regions.currencyCode)Enum.Parse(typeof(Regions.currencyCode), _config.CurrencyCode);
            var amountValue  = decimal.Parse(amount, CultureInfo.InvariantCulture);


            SetOrderReferenceDetailsRequest setRequestParameters = new SetOrderReferenceDetailsRequest();

            setRequestParameters.WithAmazonOrderReferenceId(orderReferenceId)
            .WithAmount(amountValue)
            .WithCurrencyCode(currencyCode)
            .WithSellerNote("testzahlung")
            .WithStoreName("AmzonPaymentSamply by Roman Wienicke")
            .WithCustomInformation($"{DateTime.Now}")
            .WithSellerOrderId($"{DateTime.Now:yyyy-MM-dd-HH-mm-ss}")
            .WithSellerNote("Note");
            var setResponse = AmazonClient.SetOrderReferenceDetails(setRequestParameters);

            var response = setResponse.GetJson();

            if (setResponse.GetSuccess())
            {
                var session = _httpContextAccessor.HttpContext.Session;
                session.Set(AmazonOrderReferenceId, orderReferenceId);
                session.Set(AmazonOrderAmount, amountValue);

                GetOrderReferenceDetailsRequest getRequestParameters = new GetOrderReferenceDetailsRequest();
                getRequestParameters
                .WithAccessToken(addressConsentToken)
                .WithAmazonOrderReferenceId(orderReferenceId);

                OrderReferenceDetailsResponse getOrderReferenceDetailsResponse = AmazonClient.GetOrderReferenceDetails(getRequestParameters);
                response = getOrderReferenceDetailsResponse.GetJson();
            }

            return(Json(response));
        }
        public OrderReferenceDetails GetOrderReferenceDetails(AmazonPayClient client, string orderReferenceId, string addressConsentToken = null)
        {
            var request = new GetOrderReferenceDetailsRequest();
            request.SellerId = client.Settings.SellerId;
            request.AmazonOrderReferenceId = orderReferenceId;
            request.AddressConsentToken = addressConsentToken;

            var response = client.Service.GetOrderReferenceDetails(request);

            if (response != null && response.IsSetGetOrderReferenceDetailsResult())
            {
                var detailsResult = response.GetOrderReferenceDetailsResult;

                if (detailsResult.IsSetOrderReferenceDetails())
                    return detailsResult.OrderReferenceDetails;
            }
            return null;
        }