public void TestAddMerchantOrderNumberRequest()
        {
            AddMerchantOrderNumberRequest req = new AddMerchantOrderNumberRequest(ORDER_NUMBER, MERCHANT_ORDER_NUMBER);

            AutoGen.AddMerchantOrderNumberRequest D
                = EncodeHelper.Deserialize(req.GetXml()) as AutoGen.AddMerchantOrderNumberRequest;

            Assert.AreEqual(req.GoogleOrderNumber, D.googleordernumber);
            Assert.AreEqual(MERCHANT_ORDER_NUMBER, D.merchantordernumber);

            req = new AddMerchantOrderNumberRequest(MERCHANT_ID, MERCHANT_KEY, "Sandbox", ORDER_NUMBER, MERCHANT_ORDER_NUMBER);
            D   = EncodeHelper.Deserialize(req.GetXml()) as AutoGen.AddMerchantOrderNumberRequest;

            Assert.AreEqual(req.GoogleOrderNumber, D.googleordernumber);
            Assert.AreEqual(MERCHANT_ORDER_NUMBER, D.merchantordernumber);
        }
コード例 #2
0
        public static void AddMerchantOrderNumber(GoogleCheckout instance, string googleOrderNumber, string acOrderNumber)
        {
            string env         = instance.UseTestMode ? "Sandbox" : "Production";
            string merchantId  = instance.MerchantID;
            string merchantKey = instance.MerchantKey;

            AddMerchantOrderNumberRequest onReq =
                new AddMerchantOrderNumberRequest(merchantId, merchantKey, env, googleOrderNumber, acOrderNumber);

            Util.GCheckoutResponse resp = onReq.Send();

            if (resp.IsGood)
            {
                Utility.Logger.Debug("Add Merchant Order Number Request initiated successfuly. GoogleOrderNumber=" + googleOrderNumber
                                     + " AC OrderNumber=" + acOrderNumber);
            }
            else
            {
                Utility.Logger.Debug("Add Merchant Order Number Request could not be initiated. ErrorMessage=" + resp.ErrorMessage);
            }
        }