Beispiel #1
0
        public void ConfirmBillingAgreementApiCall()
        {
            ConfirmBillingAgreementRequest getRequestParameters = new ConfirmBillingAgreementRequest();

            getRequestParameters.WithAmazonBillingreementId(Session["amazonBillingAgreementId"].ToString());

            ConfirmBillingAgreementResponse confirmBillingAgrementResponse = client.ConfirmBillingAgreement(getRequestParameters);

            confirm_response.InnerHtml = "<pre><code>" + confirmBillingAgrementResponse.GetJson() + "</code></pre>";
        }
Beispiel #2
0
        /// <summary>
        /// Sets the Amazon Order Reference ID / Amazon Billing Agreement ID
        /// </summary>
        /// <param name="amazon_reference_id"></param>
        /// <returns>ChargeRequest</returns>
        public ChargeRequest WithAmazonReferenceId(string amazon_reference_id)
        {
            if (!string.IsNullOrEmpty(amazon_reference_id))
            {
                string switchChar = amazon_reference_id;
                switch (switchChar[0])
                {
                case 'P':
                case 'S':
                    chargeType = "OrderReference";
                    getOrderReferenceDetails.WithAmazonOrderReferenceId(amazon_reference_id);
                    setOrderReferenceDetails.WithAmazonOrderReferenceId(amazon_reference_id);
                    confirmOrderReference.WithAmazonOrderReferenceId(amazon_reference_id);
                    authorizeOrderReference.WithAmazonOrderReferenceId(amazon_reference_id);
                    break;

                case 'B':
                case 'C':
                    chargeType = "BillingAgreement";
                    getBillingAgreementDetails.WithAmazonBillingAgreementId(amazon_reference_id);
                    setBillingAgreementDetails.WithAmazonBillingAgreementId(amazon_reference_id);
                    confirmBillingAgreement.WithAmazonBillingreementId(amazon_reference_id);
                    authorizeOnBillingAgreement.WithAmazonBillingAgreementId(amazon_reference_id);
                    break;

                default:
                    throw new InvalidDataException("Invalid Amazon Reference ID");
                }
            }
            else
            {
                throw new MissingFieldException("Amazon Reference ID is a required field and should be a Order Reference ID / Billing Agreement ID");
            }

            return(this);
        }
        public void ConfirmBillingAgreementApiCall()
        {
            ConfirmBillingAgreementRequest getRequestParameters = new ConfirmBillingAgreementRequest();
            getRequestParameters.WithAmazonBillingreementId(Session["amazonBillingAgreementId"].ToString());

            ConfirmBillingAgreementResponse confirmBillingAgrementResponse = client.ConfirmBillingAgreement(getRequestParameters);
            confirm_response.InnerHtml = "<pre><code>" + confirmBillingAgrementResponse.GetJson() + "</code></pre>";
        }