Package com.braintreegateway.util

Examples of com.braintreegateway.util.NodeWrapper


     * @param id of the transaction to hold for escrow.
     * @return a {@link Result}.
     */
    public Result<Transaction> holdInEscrow(String id) {
        TransactionRequest request = new TransactionRequest();
        NodeWrapper response = http.put("/transactions/" + id + "/hold_in_escrow", request);
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here


     * @param id of the transaction to submit for release.
     * @return a {@link Result}.
     */
    public Result<Transaction> releaseFromEscrow(String id) {
        TransactionRequest request = new TransactionRequest();
        NodeWrapper response = http.put("/transactions/" + id + "/release_from_escrow", request);
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

     * @param amount to settle. must be less than or equal to the authorization amount.
     * @return {@link Result}.
     */
    public Result<Transaction> submitForSettlement(String id, BigDecimal amount) {
        TransactionRequest request = new TransactionRequest().amount(amount);
        NodeWrapper response = http.put("/transactions/" + id + "/submit_for_settlement", request);
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

     * Voids the transaction with the given id.
     * @param id of the transaction to void.
     * @return {@link Result}.
     */
    public Result<Transaction> voidTransaction(String id) {
        NodeWrapper response = http.put("/transactions/" + id + "/void");
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

        if (node.isSuccess()) {
            this.target = newInstanceFromNode(klass, node);
        } else {
            this.errors = new ValidationErrors(node);

            NodeWrapper verificationNode = node.findFirst("verification");
            if (verificationNode != null) {
                this.creditCardVerification = new CreditCardVerification(verificationNode);
            }

            NodeWrapper transactionNode = node.findFirst("transaction");
            if (transactionNode != null) {
                this.transaction = new Transaction(transactionNode);
            }
            NodeWrapper subscriptionNode = node.findFirst("subscription");
            if (subscriptionNode != null) {
                this.subscription = new Subscription(subscriptionNode);
            }
            this.parameters = node.findFirst("params").getFormParameters();
            this.message = node.findString("message");
View Full Code Here

        request.groupByCustomField(groupByCustomField);
        return doGenerate(request);
    }

    private Result<SettlementBatchSummary> doGenerate(SettlementBatchSummaryRequest request) {
        NodeWrapper node = http.post("/settlement_batch_summary", request);
        return new Result<SettlementBatchSummary>(node, SettlementBatchSummary.class);
    }
View Full Code Here

    public PaymentMethodGateway(Http http) {
        this.http = http;
    }

    public Result<? extends PaymentMethod> create(PaymentMethodRequest request) {
        NodeWrapper response = http.post("/payment_methods", request);
        return parseResponse(response);
    }
View Full Code Here

        NodeWrapper response = http.post("/payment_methods", request);
        return parseResponse(response);
    }

    public Result<? extends PaymentMethod> update(String token, PaymentMethodRequest request) {
        NodeWrapper response = http.put("/payment_methods/any/" + token, request);
        return parseResponse(response);
    }
View Full Code Here

    public PaymentMethod find(String token) {
        if(token == null || token.trim().equals(""))
            throw new NotFoundException();

        NodeWrapper response = http.get("/payment_methods/any/" + token);

        if (response.getElementName() == "paypal-account") {
            return new PayPalAccount(response);
        } else if (response.getElementName() == "credit-card") {
            return new CreditCard(response);
        } else if (response.getElementName() == "sepa-bank-account") {
            return new SEPABankAccount(response);
        } else {
            return new UnknownPaymentMethod(response);
        }
    }
View Full Code Here

        http.delete("/payment_methods/paypal_account/" + token);
        return new Result<PayPalAccount>();
    }

    public Result<PayPalAccount> update(String token, PayPalAccountRequest request) {
        NodeWrapper response = http.put("/payment_methods/paypal_account/" + token, request);
        return new Result<PayPalAccount>(response, PayPalAccount.class);
    }
View Full Code Here

TOP

Related Classes of com.braintreegateway.util.NodeWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.