Package com.braintreegateway.util

Examples of com.braintreegateway.util.NodeWrapper


        escrowStatus = EnumUtils.findByName(EscrowStatus.class, node.findString("escrow-status"));
        gatewayRejectionReason = EnumUtils.findByName(GatewayRejectionReason.class, node.findString("gateway-rejection-reason"));
        id = node.findString("id");
        merchantAccountId = node.findString("merchant-account-id");
        orderId = node.findString("order-id");
        NodeWrapper paypalNode = node.findFirst("paypal");
        if (paypalNode != null) {
            paypalDetails = new PayPalDetails(paypalNode);
        }
        planId = node.findString("plan-id");
        processorAuthorizationCode = node.findString("processor-authorization-code");
View Full Code Here


        this.http = http;
        this.configuration = configuration;
    }

    public Result<Transaction> cloneTransaction(String id, TransactionCloneRequest request) {
        NodeWrapper response = http.post("/transactions/" + id + "/clone", request);
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

     * Please use gateway.transparentRedirect().confirmTransaction() instead
     */
    @Deprecated
    public Result<Transaction> confirmTransparentRedirect(String queryString) {
        TransparentRedirectRequest trRequest = new TransparentRedirectRequest(configuration, queryString);
        NodeWrapper node = http.post("/transactions/all/confirm_transparent_redirect_request", trRequest);
        return new Result<Transaction>(node, Transaction.class);
    }
View Full Code Here

     * Creates a credit {@link Transaction}.
     * @param request the request.
     * @return a {@link Result}
     */
    public Result<Transaction> credit(TransactionRequest request) {
        NodeWrapper response = http.post("/transactions", request.type(Type.CREDIT));
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

     * Refunds all or part of a previous sale {@link Transaction}.
     * @param id the id of the (sale) {@link Transaction} to refund.
     * @return a {@link Result}.
     */
    public Result<Transaction> refund(String id) {
        NodeWrapper response = http.post("/transactions/" + id + "/refund");
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

        return new Result<Transaction>(response, Transaction.class);
    }

    public Result<Transaction> refund(String id, BigDecimal amount) {
        TransactionRequest request = new TransactionRequest().amount(amount);
        NodeWrapper response = http.post("/transactions/" + id + "/refund", request);
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

     * Creates a sale {@link Transaction}.
     * @param request the request.
     * @return a {@link Result}.
     */
    public Result<Transaction> sale(TransactionRequest request) {
        NodeWrapper response = http.post("/transactions", request.type(Type.SALE));
        return new Result<Transaction>(response, Transaction.class);
    }
View Full Code Here

     * Finds all Transactions that match the query and returns a {@link ResourceCollection}.
     * See: <a href="http://www.braintreepayments.com/gateway/transaction-api#searching" target="_blank">http://www.braintreepaymentsolutions.com/gateway/transaction-api#searching</a>
     * @return a {@link ResourceCollection} or raises a {@link DownForMaintenanceException}.
     */
    public ResourceCollection<Transaction> search(TransactionSearchRequest query) {
        NodeWrapper node = http.post("/transactions/advanced_search_ids", query);
        if (node.getElementName() == "search-results") {
          return new ResourceCollection<Transaction>(new TransactionPager(this, query), node);
        } else {
          throw new DownForMaintenanceException();
        }
    }
View Full Code Here

        }
    }

    List<Transaction> fetchTransactions(TransactionSearchRequest query, List<String> ids) {
        query.ids().in(ids);
        NodeWrapper response = http.post("/transactions/advanced_search", query);

        List<Transaction> items = new ArrayList<Transaction>();
        for (NodeWrapper node : response.findAll("transaction")) {
            items.add(new Transaction(node));
        }

        return items;
    }
View Full Code Here

     * @param id of the transaction to cancel release from escrow of.
     * @return a {@link Result}.
     */
    public Result<Transaction> cancelRelease(String id) {
        TransactionRequest request = new TransactionRequest();
        NodeWrapper response = http.put("/transactions/" + id + "/cancel_release", request);
        return new Result<Transaction>(response, Transaction.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.