Package net.authorize.cim

Examples of net.authorize.cim.Transaction


    DbValidationUtils.assertPersisted(user);
   
    CustomerProfile customerProfile = CustomerProfile.createCustomerProfile();
    customerProfile.setMerchantCustomerId(Long.toString(userId.getId()));

    Transaction transaction = createTransaction(TransactionType.CREATE_CUSTOMER_PROFILE);
    transaction.setCustomerProfile(customerProfile);

    Result<Transaction> result = executeTransaction("create profile", userId, transaction);
    final String createdCustomerProfileId = result.getCustomerProfileId();
    log.info("created Authorize.Net customer profile " + createdCustomerProfileId + " for " + user);
   
View Full Code Here


    return getPaymentMethods(userId, customerProfileId);
  }
 
  private List<PaymentMethod> getPaymentMethods(DbId<User> userId, String customerProfileId)
  {
    Transaction transaction = createTransaction(TransactionType.GET_CUSTOMER_PROFILE);
    transaction.setCustomerProfileId(customerProfileId);
   
    Result<Transaction> result = executeTransaction("get payment methods", userId, transaction);
   
    List<PaymentMethod> paymentMethods = new ArrayList<PaymentMethod>();
    for (PaymentProfile paymentProfile : result.getCustomerPaymentProfileList()) {
View Full Code Here

    paymentTransaction.setCustomerPaymentProfileId(paymentProfileId);
    paymentTransaction.setOrder(order);
    if (cardCode != null)
      paymentTransaction.setCardCode(cardCode);
   
    Transaction transaction = createTransaction(TransactionType.CREATE_CUSTOMER_PROFILE_TRANSACTION);
    transaction.setPaymentTransaction(paymentTransaction);
    transaction.setCustomerProfileId(customerProfileId);
   
    Result<Transaction> result = executeTransaction("authorize", userId, amountToAuthorize, transaction);

    Map<ResponseField,String> responseMap = result.getDirectResponseList().get(0).getDirectResponseMap();
    ResponseReasonCode responseReasonCode = ResponseReasonCode.findByReasonCode(responseMap.get(ResponseField.RESPONSE_REASON_CODE));
View Full Code Here

    PaymentTransaction paymentTransaction = PaymentTransaction.createPaymentTransaction();
    paymentTransaction.setTransactionType(net.authorize.TransactionType.PRIOR_AUTH_CAPTURE);
    paymentTransaction.setTransactionId(transactionId);
    paymentTransaction.setOrder(order);

    Transaction transaction = createTransaction(TransactionType.CREATE_CUSTOMER_PROFILE_TRANSACTION);
    transaction.setPaymentTransaction(paymentTransaction);
    transaction.setCustomerProfileId(customerProfileId);
   
    Result<Transaction> result = executeTransaction("settle", userId, amountToSettle,transaction);

    Map<ResponseField,String> responseMap = result.getDirectResponseList().get(0).getDirectResponseMap();
    ResponseReasonCode responseReasonCode = ResponseReasonCode.findByReasonCode(responseMap.get(ResponseField.RESPONSE_REASON_CODE));
View Full Code Here

      throw new AuthorizeNetException(responseReasonCode.getReasonText());
  }
 
  private void cleanupProfileId(String customerProfileId)
  {
    Transaction transaction = createTransaction(TransactionType.DELETE_CUSTOMER_PROFILE);
    transaction.setCustomerProfileId(customerProfileId);
    BasicXmlDocument response = net.authorize.util.HttpClient.executeXML(environment, transaction);
    Result<Transaction> result = Result.createResult(transaction, response);
    if (!result.isOk()) {
      recordInterventionRequest("failed to clean up Authorize.Net customer profile id " + customerProfileId + " " +
          createErrorMessage(result));
View Full Code Here

    }
  }
 
  private Transaction createTransaction(TransactionType transactionType)
  {
    Transaction transaction = merchant.createCIMTransaction(transactionType);
    transaction.setValidationMode(validationMode);
    return transaction;
  }
View Full Code Here

TOP

Related Classes of net.authorize.cim.Transaction

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.