Ejemplo n.º 1
0
        /// <summary>
        /// async send a pre-debit notification to your shopper
        /// </summary>
        /// <param name="notifyShopperRequest"></param>
        /// <returns>Task<NotifyShopperResult></returns>
        public async Task <NotifyShopperResult> NotifyShopperAsync(NotifyShopperRequest notifyShopperRequest)
        {
            var jsonRequest  = Util.JsonOperation.SerializeRequest(notifyShopperRequest);
            var jsonResponse = await _notifyShopper.RequestAsync(jsonRequest);

            return(Util.JsonOperation.Deserialize <NotifyShopperResult>(jsonResponse));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// send a pre-debit notification to your shopper
        /// </summary>
        /// <param name="notifyShopperRequest"></param>
        /// <returns>NotifyShopperResult</returns>
        public NotifyShopperResult NotifyShopper(NotifyShopperRequest notifyShopperRequest)
        {
            var jsonRequest  = Util.JsonOperation.SerializeRequest(notifyShopperRequest);
            var jsonResponse = _notifyShopper.Request(jsonRequest);

            return(Util.JsonOperation.Deserialize <NotifyShopperResult>(jsonResponse));
        }
        public void NotifyShopperTest()
        {
            Client client                = base.CreateMockTestClientNullRequiredFieldsRequest("Mocks/recurring/notifyShopper-success.json");
            var    recurring             = new Service.Recurring(client);
            NotifyShopperRequest request = CreateNotifyShopperRequest();
            NotifyShopperResult  result  = recurring.NotifyShopper(request);

            Assert.IsNotNull(result);
            Assert.AreEqual("Example displayed reference", result.DisplayedReference);
            Assert.AreEqual("8516167336214570", result.PspReference);
            Assert.AreEqual("Request processed successfully", result.Message);
            Assert.AreEqual("Example reference", result.Reference);
            Assert.AreEqual("Success", result.ResultCode);
            Assert.AreEqual("IA0F7500002462", result.ShopperNotificationReference);
        }