Example #1
0
        public void ToXML_EnsuresUSLocaleForDecimals()
        {
            System.Globalization.CultureInfo existingCulture = System.Globalization.CultureInfo.CurrentCulture;

            try
            {
                System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("it-IT");

                TransactionRequest transactionRequest = new TransactionRequest
                {
                    Amount = 100.0M
                };

                SubscriptionRequest subscriptionRequest = new SubscriptionRequest
                {
                    Price = 200.0M,
                };

                SubscriptionTransactionRequest subscriptionTransactionRequest = new SubscriptionTransactionRequest
                {
                    Amount = 300.0M
                };

                ModificationRequest modificationRequest = new ModificationRequest
                {
                    Amount = 400.0M
                };

                TestHelper.AssertIncludes("<amount>100.0</amount>", transactionRequest.ToXml());
                TestHelper.AssertIncludes("<price>200.0</price>", subscriptionRequest.ToXml());
                TestHelper.AssertIncludes("<amount>300.0</amount>", subscriptionTransactionRequest.ToXml());
                TestHelper.AssertIncludes("<amount>400.0</amount>", modificationRequest.ToXml("root"));
            }
            finally
            {
                System.Threading.Thread.CurrentThread.CurrentCulture = existingCulture;
            }
        }
  private Result<Transaction> RetryCharge(SubscriptionTransactionRequest txnRequest) {
     XmlNode response = service.Post(service.MerchantPath() + "/transactions", txnRequest);
     return new ResultImpl<Transaction>(new NodeWrapper(response), gateway);
 }
  private Result<Transaction> RetryCharge(SubscriptionTransactionRequest txnRequest) {
     XmlNode response = Service.Post("/transactions", txnRequest);
     return new Result<Transaction>(new NodeWrapper(response), Service);
 }
        private async Task <Result <Transaction> > RetryChargeAsync(SubscriptionTransactionRequest txnRequest)
        {
            XmlNode response = await service.PostAsync(service.MerchantPath() + "/transactions", txnRequest).ConfigureAwait(false);

            return(new ResultImpl <Transaction>(new NodeWrapper(response), gateway));
        }
        private Result <Transaction> RetryCharge(SubscriptionTransactionRequest txnRequest)
        {
            XmlNode response = service.Post(service.MerchantPath() + "/transactions", txnRequest);

            return(new ResultImpl <Transaction>(new NodeWrapper(response), gateway));
        }
Example #6
0
        private Result <Transaction> RetryCharge(SubscriptionTransactionRequest txnRequest)
        {
            XmlNode response = Service.Post("/transactions", txnRequest);

            return(new ResultImpl <Transaction>(new NodeWrapper(response), Service));
        }