Package com.braintreegateway.util

Examples of com.braintreegateway.util.NodeWrapper


     * @param request
     *            the request.
     * @return a {@link Result}.
     */
    public Result<Customer> update(String id, CustomerRequest request) {
        NodeWrapper node = http.put("/customers/" + id, request);
        return new Result<Customer>(node, Customer.class);
    }
View Full Code Here


    public BusinessDetails(NodeWrapper node) {
        dbaName = node.findString("dba-name");
        legalName = node.findString("legal-name");
        taxId = node.findString("tax-id");
        NodeWrapper addressNode = node.findFirst("address");
        if (addressNode != null)
            this.address = new Address(addressNode);
        else
            this.address = null;
    }
View Full Code Here

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

     * @param request
     *            the request.
     * @return a {@link Result}.
     */
    public Result<CreditCard> create(CreditCardRequest request) {
        NodeWrapper node = http.post("/payment_methods", request);
        return new Result<CreditCard>(node, CreditCard.class);
    }
View Full Code Here

            throw new NotFoundException("Token is required");
        if(receivingMerchantId == null || receivingMerchantId.trim().equals(""))
            throw new NotFoundException("Receiving merchant ID is required");

        try {
          NodeWrapper node = http.post("/payment_methods/forward", forwardRequest);
          return new Result<PaymentMethodNonce>(node, PaymentMethodNonce.class);
        } catch (NotFoundException e) {
          throw new NotFoundException("Receiving merchant or payment metod not found");
        }
    }
View Full Code Here

     * @param request
     *            the request.
     * @return a {@link Result}.
     */
    public Result<CreditCard> update(String token, CreditCardRequest request) {
        NodeWrapper node = http.put("/payment_methods/credit_card/" + token, request);
        return new Result<CreditCard>(node, CreditCard.class);
    }
View Full Code Here

     * Returns a {@link ResourceCollection} of all expired credit cards.
     *
     * @return a {@link ResourceCollection}.
     */
    public ResourceCollection<CreditCard> expired() {
        NodeWrapper response = http.post("/payment_methods/all/expired_ids");
        return new ResourceCollection<CreditCard>(new ExpiredCreditCardPager(this), response);
    }
View Full Code Here

    }

    List<CreditCard> fetchExpiredCreditCards(List<String> ids) {
        IdsSearchRequest query = new IdsSearchRequest().ids().in(ids);

        NodeWrapper response = http.post("/payment_methods/all/expired", query);

        List<CreditCard> items = new ArrayList<CreditCard>();
        for (NodeWrapper node : response.findAll("credit-card")) {
            items.add(new CreditCard(node));
        }

        return items;
    }
View Full Code Here

     *
     * @return a {@link ResourceCollection}.
     */
    public ResourceCollection<CreditCard> expiringBetween(Calendar start, Calendar end) {
        String queryString = dateQueryString(start, end);
        NodeWrapper response = http.post("/payment_methods/all/expiring_ids?" + queryString);
        return new ResourceCollection<CreditCard>(new ExpiringCreditCardPager(this, queryString), response);
    }
View Full Code Here

    }

    List<CreditCard> fetchExpiringCreditCards(List<String> ids, String queryString) {
        IdsSearchRequest query = new IdsSearchRequest().ids().in(ids);

        NodeWrapper response = http.post("/payment_methods/all/expiring?" + queryString, query);

        List<CreditCard> items = new ArrayList<CreditCard>();
        for (NodeWrapper node : response.findAll("credit-card")) {
            items.add(new CreditCard(node));
        }

        return items;
    }
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.