/// <summary> /// Create a new <charge-and-ship-order> API request message /// </summary> /// <param name="merchantID">Google Checkout Merchant ID</param> /// <param name="merchantKey">Google Checkout Merchant Key</param> /// <param name="env">A String representation of /// <see cref="EnvironmentType"/></param> /// <param name="googleOrderNumber">The Google Order Number</param> public ChargeAndShipOrderRequest(string merchantID, string merchantKey, string env, string googleOrderNumber) : base(merchantID, merchantKey, env, googleOrderNumber) { ItemShippingInformation = new ItemShippingInformation(); TrackingDataList = new TrackingDataList(); }
/// <summary> /// Get the Xml Needed to make the request. /// </summary> /// <returns></returns> public override byte[] GetXml() { AutoGen.ChargeAndShipOrderRequest retVal = new AutoGen.ChargeAndShipOrderRequest(); retVal.googleordernumber = GoogleOrderNumber; if (Amount > decimal.MinValue && _currency != null) { retVal.amount = new AutoGen.Money(); retVal.amount.currency = _currency; retVal.amount.Value = Amount; } retVal.sendemail = SendEmail; retVal.sendemailSpecified = true; //Both of these items can't be set at the same time. //TODO do we validate that one of the two items are set? var shippingInfo = ItemShippingInformation.ToArray(); if (shippingInfo != null && shippingInfo.Length > 0) { retVal.itemshippinginformationlist = shippingInfo; } var trackingData = TrackingDataList.ToArray(); if (trackingData != null && trackingData.Length > 0) { retVal.trackingdatalist = trackingData; } return(EncodeHelper.Serialize(retVal)); }
/// <summary> /// Create a new <charge-and-ship-order> API request message /// </summary> /// <param name="merchantID">Google Checkout Merchant ID</param> /// <param name="merchantKey">Google Checkout Merchant Key</param> /// <param name="env">A String representation of /// <see cref="EnvironmentType"/></param> /// <param name="googleOrderNumber">The Google Order Number</param> /// <param name="currency">The Currency used to charge the order</param> /// <param name="amount">The Amount to charge</param> public ChargeAndShipOrderRequest(string merchantID, string merchantKey, string env, string googleOrderNumber, string currency, decimal amount) : base(merchantID, merchantKey, env, googleOrderNumber) { ItemShippingInformation = new ItemShippingInformation(); TrackingDataList = new TrackingDataList(); _currency = currency; this.Amount = amount; }
/// <summary> /// Create a new <charge-and-ship-order> API request message /// using the configuration settings /// </summary> /// <param name="googleOrderNumber">The Google Order Number</param> public ChargeAndShipOrderRequest(string googleOrderNumber) : base(googleOrderNumber) { ItemShippingInformation = new ItemShippingInformation(); TrackingDataList = new TrackingDataList(); }