Examples of PaymentMethod


Examples of com.brienwheeler.svc.authorize_net.PaymentMethod

   
    List<PaymentMethod> paymentMethods = new ArrayList<PaymentMethod>();
    for (PaymentProfile paymentProfile : result.getCustomerPaymentProfileList()) {
      for (Payment payment : paymentProfile.getPaymentList()) {
        if (payment.getCreditCard() != null) {
          paymentMethods.add(new PaymentMethod(paymentProfile.getCustomerPaymentProfileId(),
              payment.getCreditCard().getCreditCardNumber()));
        }
      }
    }
   
View Full Code Here

Examples of com.brienwheeler.svc.authorize_net.PaymentMethod

    String customerProfileId = userAttributeService.getAttribute(userId, ATTR_PROFILE_ID);
    if (customerProfileId == null)
      throw new OperationDisallowedException(userId + " has no Authorize.Net customer profile");
   
    List<PaymentMethod> paymentMethods = getPaymentMethods(userId, customerProfileId);
    PaymentMethod paymentMethodToUse = null;
    for (PaymentMethod paymentMethod : paymentMethods)
      if (paymentMethod.getPaymentProfileId().equals(paymentProfileId)) {
        paymentMethodToUse = paymentMethod;
        break;
      }
View Full Code Here

Examples of com.niyamit.spreedly.paymentmethods.PaymentMethod

        final String accessSecret = "accessSecret";
        final SpreedlyInvoker spreedlyInvoker = new SpreedlyInvoker(environmentKey, accessSecret, client);
        final String targetUrl = "http://target.url";
        final String method = "POST";
        final Transaction transaction = new Transaction();
        final PaymentMethod returnPaymentMethod = new PaymentMethod();
       
        //set up mocks
        final WebTarget webTarget = mock(WebTarget.class);
        when(client.target(targetUrl)).thenReturn(webTarget);
        final Invocation.Builder builder = mock(Invocation.Builder.class);
        when(webTarget.request()).thenReturn(builder);
        when(builder.header(anyString(), any())).thenReturn(builder);
        final Response response = mock(Response.class);
        when(builder.method(eq(method), any(Entity.class))).thenReturn(response);
        when(response.getStatus()).thenReturn(200); //success response
        when(response.readEntity(PaymentMethod.class)).thenReturn(returnPaymentMethod);
       
        //method under test
        final PaymentMethod responsePaymentMethod = spreedlyInvoker.invoke(targetUrl, method, transaction, PaymentMethod.class);
       
        //assertions
        assertNotNull(responsePaymentMethod);
        assertEquals(returnPaymentMethod, responsePaymentMethod);
       
View Full Code Here

Examples of com.niyamit.spreedly.paymentmethods.PaymentMethod

    }
   
    @Test
    public void testAdd() {
        //set up data
        final PaymentMethod paymentMethod = objectFactory.createPaymentMethod();
        paymentMethod.setEmail("jpicard@ufp.net");
        final CreditCard creditCard = objectFactory.createCreditCard();
        creditCard.setFirstName("Jean-Luc");
        creditCard.setLastName("Picard");
        creditCard.setNumber("5555555555554444");
        creditCard.setVerificationValue("423");
        creditCard.setMonth("3");
        creditCard.setYear("2032");
        paymentMethod.setCreditCard(creditCard);
//        paymentMethod.setData("<paymentMethodId>448</paymentMethodId>");
        paymentMethod.setRetained(Boolean.TRUE);

        //call method under test
        final Transaction transaction = spreedlyPaymentMethodService.add(paymentMethod);

        //assertions
View Full Code Here

Examples of com.niyamit.spreedly.paymentmethods.PaymentMethod

    public Transaction createTransaction() {
        return new Transaction();
    }

    public PaymentMethod createPaymentMethod() {
        return new PaymentMethod();
    }
View Full Code Here

Examples of com.suarte.core.PaymentMethod

    public String edit() {
        if (id != null) {
            paymentMethod = paymentMethodManager.get(id);
        } else {
            paymentMethod = new PaymentMethod();
        }

        return "edit";
    }
View Full Code Here

Examples of com.suarte.core.PaymentMethod

        return "edit";
    }

    public String add() {
        paymentMethod = new PaymentMethod();

        return "add";
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.