Ejemplo n.º 1
0
        public static void GetOrderReferenceDetailsApiCall(string amazonBillingAgreementId, string addressConsentToken = null)
        {
            GetBillingAgreementDetailsRequest getRequestParameters = new GetBillingAgreementDetailsRequest();

            getRequestParameters.WithAmazonBillingAgreementId(amazonBillingAgreementId)
            .WithaddressConsentToken(null);

            BillingAgreementDetailsResponse getOrderReferenceDetailsResponse = client.GetBillingAgreementDetails(getRequestParameters);

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

            apiResponse["getBillingAgreementDetailsResponse"] = JObject.Parse(getOrderReferenceDetailsResponse.GetJson()).ToString();
        }
Ejemplo n.º 2
0
        public static void SetOrderReferenceDetailsApiCall(string amazonBillingAgreementId)
        {
            SetBillingAgreementDetailsRequest setRequestParameters = new SetBillingAgreementDetailsRequest();

            setRequestParameters.WithAmazonBillingAgreementId(amazonBillingAgreementId)
            .WithSellerNote("Note");

            BillingAgreementDetailsResponse setResponse = client.SetBillingAgreementDetails(setRequestParameters);

            if (!setResponse.GetSuccess())
            {
                apiResponse["setBillingAgreementDetailsResponse"] = "SetBillingAgreementDetails API call Failed" + Environment.NewLine + setResponse.GetJson();
            }
            else
            {
                apiResponse["setBillingAgreementDetailsResponse"] = setResponse.GetJson();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Parse the Notification into API Response objects.
        /// </summary>
        private void GetIpnResponseObjects()
        {
            string xml;

            xml = this.ToXml();

            if (Enum.IsDefined(typeof(NotificationType), this.GetNotificationType()))
            {
                switch ((NotificationType)Enum.Parse(typeof(NotificationType), this.GetNotificationType()))
                {
                case NotificationType.OrderReferenceNotification:
                    orderReferenceDetailsObject = new OrderReferenceDetailsResponse(xml);
                    break;

                case NotificationType.BillingAgreementNotification:
                    billingAgreementDetailsObject = new BillingAgreementDetailsResponse(xml);
                    break;

                case NotificationType.PaymentAuthorize:
                    authorizeResponseObject = new AuthorizeResponse(xml);
                    break;

                case NotificationType.PaymentCapture:
                    captureResponseObject = new CaptureResponse(xml);
                    break;

                case NotificationType.PaymentRefund:
                    refundResponseObject = new RefundResponse(xml);
                    break;

                case NotificationType.ProviderCredit:
                    providerCreditResponseObject = new GetProviderCreditDetailsResponse(xml);
                    break;

                case NotificationType.ProviderCreditReversal:
                    providerCreditReversalResponseObject = new GetProviderCreditReversalDetailsResponse(xml);
                    break;

                case NotificationType.ChargebackDetailedNotification:
                    chargebackResponseObject = new ChargebackResponse(xml);
                    break;
                }
            }
        }