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(); } }
/// <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.WithAmazonBillingAgreementId(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); }