Page 3 of 7

Re: Wire payment module or offline transaction module

Posted: Thu Aug 08, 2013 10:21 am
by hiteshsingla
Where should check this condition that which paymentInfoType is there?? In Controllers??
And how can I do this thing that on wire payment AcceptAndPassThroughModule should be instantiated and on Paypal PayPalPaymentModule should be instantiated?

I think you are aware of my xml changes for wire,here are the changes for Paypal:

Code: Select all

<bean id="blPayPalPaymentService" class="org.broadleafcommerce.core.payment.service.PaymentServiceImpl">
    <property name="paymentModule" ref="blPayPalModule"/>
</bean>

<bean id="blPayPalModule" class="org.broadleafcommerce.payment.service.module.PayPalPaymentModule">
    <property name="payPalPaymentService" ref="blPayPalVendorOrientedPaymentService"/>
</bean>

And now the blAuthorizeAnDebitWorkflow looks like this:

Code: Select all

<bean id="blAuthorizeAndDebitWorkflow" class="org.broadleafcommerce.core.workflow.SequenceProcessor">
      <property name="processContextFactory">
         <bean class="org.broadleafcommerce.core.payment.service.workflow.PaymentProcessContextFactory">
            <property name="paymentActionType" value="AUTHORIZEANDDEBIT"/>
         </bean>
      </property>
      <property name="activities">
         <list>
         <bean class="org.broadleafcommerce.core.payment.service.workflow.PaymentActivity">
            <property name="paymentService" ref="blWirePaymentService"/>
         </bean>
         <bean class="org.broadleafcommerce.core.payment.service.workflow.PaymentActivity">
                <property name="paymentService" ref="blPayPalPaymentService"/>
                <property name="userName" value="web"/>
            </bean>
      </list>
      </property>
      <property name="defaultErrorHandler" ref="blDefaultErrorHandler"/>
   </bean>


Thanks & Reagards
Hitesh Singla

Re: Wire payment module or offline transaction module

Posted: Thu Aug 08, 2013 10:38 am
by elbertbautista
The checks are handled by the framework. The workflow looks at all the payment infos in your order and executes the payment modules that are valid for that particular payment info.

Re: Wire payment module or offline transaction module

Posted: Mon Aug 12, 2013 1:55 am
by hiteshsingla
Yeah even I thought that this would be handled by the framework itself.
I am unable to understand that if I un-comment that PaymentSevieActivity bean in the Checkout Workflow, why do I get a Payment Exception , a Checkout Exception and a Workflow Exception in case of the wire payment whereas i have defiend all the beans for the Wire payment in the applicationContext.xml?
I am unable to find out that what else I need to do?
Please help me to get through this hurdle.

Thanks & Regards
Hitesh Singla

Re: Wire payment module or offline transaction module

Posted: Mon Aug 12, 2013 8:04 am
by Anky
Thanks elbert!
its working for me as well.
Now if i Want to store the paymenttype information in my database like whether the payment type is wire or paypal?
Records are coming for only paypal transaction in table blc_order_payment.
if i do wired transaction then there is not record entry for this transaction.
How Can I reflect changes in table blc_order_payment for wired payment type as well?

Thanks and Regards,
Ankit Aggarwal

Re: Wire payment module or offline transaction module

Posted: Mon Aug 12, 2013 12:33 pm
by elbertbautista
You have to set up the PaymentInfo yourself with the appropriate payment type before calling checkoutService.performCheckout(). That should save either a payment info of type PayPal or Wire

Re: Wire payment module or offline transaction module

Posted: Tue Aug 13, 2013 12:57 am
by Anky
I have defined the payment type before checkoutService.performCheckout().

Code: Select all

public String completeCheckout(HttpServletRequest request, HttpServletResponse response, Model model,
@ModelAttribute("billingInfoForm") BillingInfoForm billingForm,
BindingResult result) throws CheckoutException, PricingException, ServiceException {
Order order=CartState.getCart();
System.out.println(order.getPaymentInfos());
if (order != null)
{
Map<PaymentInfo, Referenced> payments = new HashMap<PaymentInfo, Referenced>();
PaymentInfo wire = paymentInfoService.create();
String uniqueReferenceNumber=String.valueOf(order.getId());
wire.setType(PaymentInfoType.WIRE);
wire.setOrder(order);
wire.setAmount(order.getTotal());
wire.setReferenceNumber(uniqueReferenceNumber);
initializeOrderForCheckout(order);
payments.put(wire, wire.createEmptyReferenced());
CheckoutResponse checkoutResponse = checkoutService.performCheckout(order,payments);
return getConfirmationView(order.getOrderNumber());
}

return getCartPageRedirect();
}


But this is not working for me.
If I do transaction from paypal then that order entry is being reflected in the database under table blc_order_payment.
But if I am doing transaction from wire then its entry is not coming in table blc_order_payment??
I have defined the payment_type wire in the checkout controller.
Can you please guide where I am going wrong?

Thanks and Regards
Ankit Aggarwal

Re: Wire payment module or offline transaction module

Posted: Tue Aug 13, 2013 10:14 am
by elbertbautista

Code: Select all

...
order.getPaymentInfos().add(wire);
CheckoutResponse checkoutResponse = checkoutService.performCheckout(order,payments);
...

Re: Wire payment module or offline transaction module

Posted: Wed Aug 14, 2013 12:57 am
by Anky
Thanks Elbert!
Its working... :)

Re: Wire payment module or offline transaction module

Posted: Mon Oct 21, 2013 4:15 am
by prashant
Hi,

I am also looking for cash on delivery payment option.
Has anybody implemented this feature?
If yes please share the details.

Regards,
Prashant