Page 1 of 1

Authorize Net Payment Gateway Setup

Posted: Thu Feb 21, 2013 10:20 pm
by mota_nginya
Maestros,

First of all let me begin by apologizing to the entire forum for the lengthy request. I just do not have enough time to research this and I know some of you have already integrated it successfully. I have looked at the documentation and I must admit that I just can't get it working. I am not the smartest guy in the block and like most of you, I am also new broadleafer.

I have setup my accounts successfully and have managed to put in all the necessary configuration to perform and advance checkout. But when I try to that, I get the following error:

Code: Select all

java.lang.IllegalArgumentException: Must set the Request Parameter Map on the PaymentInfo instance.
   at org.springframework.util.Assert.isTrue(Assert.java:65)
   at org.broadleafcommerce.payment.service.module.AuthorizeNetPaymentModule.authorizeAndDebit(AuthorizeNetPaymentModule.java:94)
   at org.broadleafcommerce.core.payment.service.PaymentServiceImpl.authorizeAndDebit(PaymentServiceImpl.java:74)
   at org.broadleafcommerce.core.payment.service.workflow.PaymentActivity.execute(PaymentActivity.java:67)
   at org.broadleafcommerce.core.workflow.SequenceProcessor.doActivities(SequenceProcessor.java:62)
   at org.broadleafcommerce.core.payment.service.workflow.CompositeActivity.execute(CompositeActivity.java:35)
   at org.broadleafcommerce.core.workflow.SequenceProcessor.doActivities(SequenceProcessor.java:62)
   at org.broadleafcommerce.core.payment.service.CompositePaymentServiceImpl.executePayment(CompositePaymentServiceImpl.java:55)
   at org.broadleafcommerce.core.checkout.service.workflow.PaymentServiceActivity.execute(PaymentServiceActivity.java:46)
   at org.broadleafcommerce.core.workflow.SequenceProcessor.doActivities(SequenceProcessor.java:62)
   at org.broadleafcommerce.core.checkout.service.CheckoutServiceImpl.performCheckout(CheckoutServiceImpl.java:75)
   at org.broadleafcommerce.core.web.controller.checkout.BroadleafCheckoutController.completeSecureCreditCardCheckout(BroadleafCheckoutController.java:401)
   at com.sakotek.controller.checkout.CheckoutController.completeSecureCreditCardCheckout(CheckoutController.java:123)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
   at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
   at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100)
   at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604)
   at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565)
   at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
   at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
   at org.broadleafcommerce.cms.web.URLHandlerFilter.doFilterInternal(URLHandlerFilter.java:74)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
   at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:166)
   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.broadleafcommerce.profile.web.core.security.SessionFixationProtectionFilter.doFilter(SessionFixationProtectionFilter.java:90)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.broadleafcommerce.core.web.order.security.CartStateFilter.doFilter(CartStateFilter.java:105)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.broadleafcommerce.profile.web.core.security.CustomerStateFilter.doFilter(CustomerStateFilter.java:147)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.broadleafcommerce.common.security.handler.CsrfFilter.doFilter(CsrfFilter.java:83)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
   at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:166)
   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
   at org.broadleafcommerce.common.web.BroadleafRequestFilter.doFilterInternal(BroadleafRequestFilter.java:152)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
   at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
   at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
   at java.lang.Thread.run(Thread.java:680)


This is what I have done so far:
1. I used CheckoutController and changed it to extend AuthorizeNetCheckoutController
2. I did not change the UI in anyway as I would like to use the checkout features and just hook Authorizenet for processing
3. The documentation say something about replacing the PaymentInfo but does not say anything on how and where to hook the paymentInfo. I know I am missing something and will be glad to take the help from anyone.

Please walk me through the process and I will owe you a big one.

Thanks

Re: Authorize Net Payment Gateway Setup

Posted: Thu Feb 21, 2013 10:27 pm
by phillipuniverse
You are actually required to change the UI indirectly; you have to modify the Thymeleaf templates so that the checkout form actually posts to Authorize.net. You did not change the action attribute on the form parameter, and thus you still have the form submitting to Broadleaf, which is incorrect.

Take again at steps 2 and 3 of the Authorize.net quickstart: http://docs.broadleafcommerce.org/curre ... Start.html

Re: Authorize Net Payment Gateway Setup

Posted: Fri Feb 22, 2013 9:27 am
by mota_nginya
Thanks a bunch for your timely response. I am working on following your recommendations but would like to ask whether that would also provision for order information like the current flow.

Thanks again

Re: Authorize Net Payment Gateway Setup

Posted: Fri Feb 22, 2013 11:36 am
by phillipuniverse
What do you mean by "provision for order information like the current flow"?

Re: Authorize Net Payment Gateway Setup

Posted: Fri Feb 22, 2013 12:47 pm
by mota_nginya
So the current flow actually stores the order in the database so that customers can comeback later and check the state and also view all previous orders in their profile. Using the checkout process with authorize.net that does not happen any more. Is this something one would have to add in the checkout workflow and if how is that done?

Re: Authorize Net Payment Gateway Setup

Posted: Fri Feb 22, 2013 2:47 pm
by phillipuniverse
So you're saying that the order status is not changed to submitted? And you have completed all of the steps on the quick start page?

This is how authorize.net is setup to work:
  1. User puts in billing information
  2. User hits submit on the billing information form which submits to the Authorize.net server to actually take the credit card information
  3. Authorize.net sends a POST to the Broadleaf application (at the url specified by the authorizenet.relay.response.url property in your properties file)
  4. In processing this request from Authorize.net, the Broadleaf application changes the order to submitted and goes through the checkout workflow (which is what happens in BroadleafAuthorizeNetController. processAuthorizeNetAuthorizeAndDebit(), which should be invoked in the controller that responds to the authorizenet.relay.response.url)
  5. Broadleaf then tells the Authorize.net system that the Order has been checked out correctly
  6. The user is then redirected to the confirmation page

All of this should automatically happen if you follow the steps on the page that I linked. After following all of those steps, does this still not work?

Re: Authorize Net Payment Gateway Setup

Posted: Fri Feb 22, 2013 3:21 pm
by mota_nginya
Thanks that was helpful and I have successfully set it up.