Package com.braintreegateway.exceptions

Examples of com.braintreegateway.exceptions.NotFoundException


        return new Result<UnknownPaymentMethod>();
    }

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

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

        if (response.getElementName() == "paypal-account") {
            return new PayPalAccount(response);
View Full Code Here


     * @return the {@link CreditCard} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public CreditCard find(String token) {
        if(token.trim().equals("") || token == null)
            throw new NotFoundException();

        return new CreditCard(http.get("/payment_methods/credit_card/" + token));
    }
View Full Code Here

     * @return the {@link CreditCard} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public CreditCard fromNonce(String nonce) {
        if(nonce.trim().equals("") || nonce == null)
            throw new NotFoundException();

        try {
          return new CreditCard(http.get("/payment_methods/from_nonce/" + nonce));
        } catch (NotFoundException e) {
          throw new NotFoundException("Payment method with nonce " + nonce + " locked, consumed or not found");
        }
    }
View Full Code Here

     */
    public Result<PaymentMethodNonce> forward(PaymentMethodForwardRequest forwardRequest) {
        String receivingMerchantId = forwardRequest.getReceivingMerchantId();
        String token = forwardRequest.getToken();
        if (token.trim().equals("") || token == null)
            throw new NotFoundException("Token is required");
        if(receivingMerchantId.trim().equals("") || receivingMerchantId == null)
            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

        return new Result<UnknownPaymentMethod>();
    }

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

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

        if (response.getElementName() == "paypal-account") {
            return new PayPalAccount(response);
View Full Code Here

     * @return the {@link CreditCard} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public CreditCard find(String token) {
        if(token.trim().equals("") || token == null)
            throw new NotFoundException();

        return new CreditCard(http.get("/payment_methods/" + token));
    }
View Full Code Here

     * @return the {@link CreditCard} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public CreditCard fromNonce(String nonce) {
        if(nonce.trim().equals("") || nonce == null)
            throw new NotFoundException();

        try {
          return new CreditCard(http.get("/payment_methods/from_nonce/" + nonce));
        } catch (NotFoundException e) {
          throw new NotFoundException("Payment method with nonce " + nonce + " locked, consumed or not found");
        }
    }
View Full Code Here

     * @param id the id of the {@link Subscription}.
     * @return the {@link Subscription} or raises a {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public Subscription find(String id) {
        if(id == null || id.trim().equals(""))
            throw new NotFoundException();
        return new Subscription(http.get("/subscriptions/" + id));
    }
View Full Code Here

     * @return the {@link Customer} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public Customer find(String id) {
        if(id == null || id.trim().equals(""))
            throw new NotFoundException();

        return new Customer(http.get("/customers/" + id));
    }
View Full Code Here

     * @return the {@link CreditCard} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public CreditCard fromNonce(String nonce) {
        if(nonce == null || nonce.trim().equals(""))
            throw new NotFoundException();

        try {
          return new CreditCard(http.get("/payment_methods/from_nonce/" + nonce));
        } catch (NotFoundException e) {
          throw new NotFoundException("Payment method with nonce " + nonce + " locked, consumed or not found");
        }
    }
View Full Code Here

TOP

Related Classes of com.braintreegateway.exceptions.NotFoundException

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.