org.broadleafcommerce.payment.service.module
Class AuthorizeNetPaymentModule
java.lang.Object
org.broadleafcommerce.payment.service.module.AuthorizeNetPaymentModule
- All Implemented Interfaces:
- org.broadleafcommerce.core.payment.service.module.PaymentModule
public class AuthorizeNetPaymentModule
- extends Object
- implements org.broadleafcommerce.core.payment.service.module.PaymentModule
- Author:
- elbertbautista
|
Method Summary |
org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
authorize(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
authorizeAndDebit(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
balance(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
protected org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
buildBasicDPMResponse(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
credit(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
debit(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
AuthorizeNetPaymentService |
getAuthorizeNetPaymentService()
|
org.broadleafcommerce.profile.core.service.CountryService |
getCountryService()
|
org.broadleafcommerce.profile.core.service.CustomerService |
getCustomerService()
|
org.broadleafcommerce.profile.core.service.StateService |
getStateService()
|
protected void |
initializeEmptyAddress(org.broadleafcommerce.profile.core.domain.Address address)
Sets all the non-nullable fields for an address to empty strings. |
protected boolean |
isBillingAddressField(net.authorize.ResponseField field)
|
protected boolean |
isShippingAddressField(net.authorize.ResponseField field)
|
Boolean |
isValidCandidate(org.broadleafcommerce.core.payment.service.type.PaymentInfoType paymentType)
|
protected boolean |
isValidTransaction(net.authorize.sim.Result result)
|
protected void |
populateShippingAddressOnOrder(org.broadleafcommerce.core.order.domain.Order order,
org.broadleafcommerce.profile.core.domain.Address shippingAddress)
If you pass the shipping address to Authorize.net, there has to be an existing fulfillment group on the order. |
org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
reverseAuthorize(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
protected void |
saveAnonymousCustomerInfo(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
org.broadleafcommerce.core.payment.domain.PaymentResponseItem responseItem,
net.authorize.sim.Result result)
|
void |
setAuthorizeNetPaymentService(AuthorizeNetPaymentService authorizeNetPaymentService)
|
protected void |
setBillingInfo(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
net.authorize.sim.Result result)
|
void |
setCountryService(org.broadleafcommerce.profile.core.service.CountryService countryService)
|
void |
setCustomerService(org.broadleafcommerce.profile.core.service.CustomerService customerService)
|
protected void |
setPaymentInfoAdditionalFields(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
net.authorize.sim.Result result)
|
protected void |
setPaymentResponseAdditionalFields(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
org.broadleafcommerce.core.payment.domain.PaymentResponseItem responseItem,
net.authorize.sim.Result result)
|
protected void |
setShippingInfo(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
net.authorize.sim.Result result)
|
void |
setStateService(org.broadleafcommerce.profile.core.service.StateService stateService)
|
org.broadleafcommerce.core.payment.domain.PaymentResponseItem |
voidPayment(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
authorizeNetPaymentService
protected AuthorizeNetPaymentService authorizeNetPaymentService
stateService
protected org.broadleafcommerce.profile.core.service.StateService stateService
countryService
protected org.broadleafcommerce.profile.core.service.CountryService countryService
customerService
protected org.broadleafcommerce.profile.core.service.CustomerService customerService
entityConfiguration
protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
AuthorizeNetPaymentModule
public AuthorizeNetPaymentModule()
authorize
public org.broadleafcommerce.core.payment.domain.PaymentResponseItem authorize(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
throws org.broadleafcommerce.core.payment.service.exception.PaymentException
- Specified by:
authorize in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
- Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException
reverseAuthorize
public org.broadleafcommerce.core.payment.domain.PaymentResponseItem reverseAuthorize(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
throws org.broadleafcommerce.core.payment.service.exception.PaymentException
- Specified by:
reverseAuthorize in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
- Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException
debit
public org.broadleafcommerce.core.payment.domain.PaymentResponseItem debit(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
throws org.broadleafcommerce.core.payment.service.exception.PaymentException
- Specified by:
debit in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
- Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException
authorizeAndDebit
public org.broadleafcommerce.core.payment.domain.PaymentResponseItem authorizeAndDebit(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
throws org.broadleafcommerce.core.payment.service.exception.PaymentException
- Specified by:
authorizeAndDebit in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
- Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException
credit
public org.broadleafcommerce.core.payment.domain.PaymentResponseItem credit(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
throws org.broadleafcommerce.core.payment.service.exception.PaymentException
- Specified by:
credit in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
- Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException
voidPayment
public org.broadleafcommerce.core.payment.domain.PaymentResponseItem voidPayment(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
throws org.broadleafcommerce.core.payment.service.exception.PaymentException
- Specified by:
voidPayment in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
- Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException
balance
public org.broadleafcommerce.core.payment.domain.PaymentResponseItem balance(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
throws org.broadleafcommerce.core.payment.service.exception.PaymentException
- Specified by:
balance in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
- Throws:
org.broadleafcommerce.core.payment.service.exception.PaymentException
buildBasicDPMResponse
protected org.broadleafcommerce.core.payment.domain.PaymentResponseItem buildBasicDPMResponse(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext)
isValidTransaction
protected boolean isValidTransaction(net.authorize.sim.Result result)
saveAnonymousCustomerInfo
protected void saveAnonymousCustomerInfo(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
org.broadleafcommerce.core.payment.domain.PaymentResponseItem responseItem,
net.authorize.sim.Result result)
setPaymentInfoAdditionalFields
protected void setPaymentInfoAdditionalFields(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
net.authorize.sim.Result result)
setPaymentResponseAdditionalFields
protected void setPaymentResponseAdditionalFields(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
org.broadleafcommerce.core.payment.domain.PaymentResponseItem responseItem,
net.authorize.sim.Result result)
setBillingInfo
protected void setBillingInfo(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
net.authorize.sim.Result result)
setShippingInfo
protected void setShippingInfo(org.broadleafcommerce.core.payment.service.PaymentContext paymentContext,
net.authorize.sim.Result result)
initializeEmptyAddress
protected void initializeEmptyAddress(org.broadleafcommerce.profile.core.domain.Address address)
- Sets all the non-nullable fields for an address to empty strings. This way we won't get any Hibernate exceptions
should a user get past any client-side validations for BLC-required address fields. The correct thing to do is not
to show an error message because the card would have already been successfully charged.
- Parameters:
address -
populateShippingAddressOnOrder
protected void populateShippingAddressOnOrder(org.broadleafcommerce.core.order.domain.Order order,
org.broadleafcommerce.profile.core.domain.Address shippingAddress)
- If you pass the shipping address to Authorize.net, there has to be an existing fulfillment group on the order.
This must be done because of pricing considerations. The fulfillment group must be constructed when adding to the
cart or sometime before calling the gateway. This depends on UX. This default implementation assumes one fulfillment
group per order because Authorize.net only supports a single shipping address. Override this method if necessary.
- Parameters:
order - shippingAddress -
isBillingAddressField
protected boolean isBillingAddressField(net.authorize.ResponseField field)
isShippingAddressField
protected boolean isShippingAddressField(net.authorize.ResponseField field)
isValidCandidate
public Boolean isValidCandidate(org.broadleafcommerce.core.payment.service.type.PaymentInfoType paymentType)
- Specified by:
isValidCandidate in interface org.broadleafcommerce.core.payment.service.module.PaymentModule
getAuthorizeNetPaymentService
public AuthorizeNetPaymentService getAuthorizeNetPaymentService()
setAuthorizeNetPaymentService
public void setAuthorizeNetPaymentService(AuthorizeNetPaymentService authorizeNetPaymentService)
getStateService
public org.broadleafcommerce.profile.core.service.StateService getStateService()
setStateService
public void setStateService(org.broadleafcommerce.profile.core.service.StateService stateService)
getCountryService
public org.broadleafcommerce.profile.core.service.CountryService getCountryService()
setCountryService
public void setCountryService(org.broadleafcommerce.profile.core.service.CountryService countryService)
getCustomerService
public org.broadleafcommerce.profile.core.service.CustomerService getCustomerService()
setCustomerService
public void setCustomerService(org.broadleafcommerce.profile.core.service.CustomerService customerService)
Copyright © 2012. All Rights Reserved.