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"); } }
public static void Escrow(BraintreeService service, string transactionId) { NodeWrapper response = new NodeWrapper(service.Put(service.MerchantPath() + "/transactions/" + transactionId + "/escrow")); Assert.IsTrue(response.IsSuccess()); }
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()); }
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"); }
private void Settle(String transactionId) { NodeWrapper response = new NodeWrapper(service.Put("/transactions/" + transactionId + "/settle")); Assert.IsTrue(response.IsSuccess()); }
public static void SettlementPending(BraintreeService service, String transactionId) { NodeWrapper response = new NodeWrapper(service.Put("/transactions/" + transactionId + "/settlement_pending")); Assert.IsTrue(response.IsSuccess()); }
public static NodeWrapper Settle(BraintreeService service, String transactionId) { NodeWrapper response = new NodeWrapper(service.Put("/transactions/" + transactionId + "/settle")); Assert.IsTrue(response.IsSuccess()); return response; }
public static void SettlementDecline(BraintreeService service, string transactionId) { NodeWrapper response = new NodeWrapper(service.Put(service.MerchantPath() + "/transactions/" + transactionId + "/settlement_decline")); Assert.IsTrue(response.IsSuccess()); }