示例#1
0
        public ResultImpl(NodeWrapper node, IBraintreeGateway gateway)
        {
            if (node.IsSuccess())
            {
                Target = newInstanceFromResponse(node, gateway);
            }
            else
            {
                Errors = new ValidationErrors(node);
                NodeWrapper verificationNode = node.GetNode("verification");
                if (verificationNode != null) {
                    CreditCardVerification = new CreditCardVerification(verificationNode, gateway);
                }

                NodeWrapper transactionNode = node.GetNode("transaction");
                if (transactionNode != null)
                {
                    Transaction = new Transaction(transactionNode, gateway);
                }

                NodeWrapper subscriptionNode = node.GetNode("subscription");
                if (subscriptionNode != null)
                {
                    Subscription = new Subscription(subscriptionNode, gateway);
                }
                Parameters = node.GetNode("params").GetFormParameters();
                Message = node.GetString("message");
            }
        }
示例#2
0
 public static void Escrow(BraintreeService service, string transactionId)
 {
   NodeWrapper response = new NodeWrapper(service.Put(service.MerchantPath() + "/transactions/" + transactionId + "/escrow"));
   Assert.IsTrue(response.IsSuccess());
 }
示例#3
0
 private void MakePastDue(Subscription subscription, int numberOfDays)
 {
     BraintreeService service = new BraintreeService(gateway.Configuration);
     NodeWrapper response = new NodeWrapper(service.Put("/subscriptions/" + subscription.Id + "/make_past_due?days_past_due=" + numberOfDays));
     Assert.IsTrue(response.IsSuccess());
 }
示例#4
0
 public static string Create3DSVerification(BraintreeService service, string merchantAccountId, ThreeDSecureRequestForTests request)
 {
   string url = "/three_d_secure/create_verification/" + merchantAccountId;
   NodeWrapper response = new NodeWrapper(service.Post(service.MerchantPath() + url, request));
   Assert.IsTrue(response.IsSuccess());
   return response.GetString("three-d-secure-token");
 }
示例#5
0
 private void Settle(String transactionId)
 {
     NodeWrapper response = new NodeWrapper(service.Put("/transactions/" + transactionId + "/settle"));
     Assert.IsTrue(response.IsSuccess());
 }
示例#6
0
 public static void SettlementPending(BraintreeService service, String transactionId)
 {
   NodeWrapper response = new NodeWrapper(service.Put("/transactions/" + transactionId + "/settlement_pending"));
   Assert.IsTrue(response.IsSuccess());
 }
示例#7
0
 public static NodeWrapper Settle(BraintreeService service, String transactionId)
 {
   NodeWrapper response = new NodeWrapper(service.Put("/transactions/" + transactionId + "/settle"));
   Assert.IsTrue(response.IsSuccess());
   return response;
 }
示例#8
0
 public static void SettlementDecline(BraintreeService service, string transactionId)
 {
   NodeWrapper response = new NodeWrapper(service.Put(service.MerchantPath() + "/transactions/" + transactionId + "/settlement_decline"));
   Assert.IsTrue(response.IsSuccess());
 }