Page 1 of 1

Register a payment module to the payment workflow

Posted: Thu May 14, 2015 9:55 am
by dlavoie
Hello Guys !

I've been through Braintree simple as hell API and been looking at Broadleaf's Payment Gateway architecture. I can tell that its pretty well designed. I get most of it except for a small part.

The server participation in braintree's payment workflow is pretty limited. All his expected from the server is to confirm the transaction initiated by the JS Client.

My question is the following, should I absolutely fit my Transaction confirmation inside the payment workflow mechanism provided by Broadleaf ? For now, all I have to do is have my JS front end call my specific PaymentGatewayController and call the TransactionService. It is not really generic since the UI is calling directly the controller for braintree.

Thanks for your heads up !

Regards,
Daniel Lavoie

Re: Register a payment module to the payment workflow

Posted: Wed May 20, 2015 12:25 am
by phillipuniverse
With Braintree, you should have a controller that invokes a WebResponseTranslationService that will essentially create an UNCONFIRMED transaction. This interface accepts an HttpServletRequest and expects a PaymentResponseDTO in return that it will use to do this. At this stage you should really be setting things up and verifying that the request actually came from Braintree, etc.

If you do this, then the Broadleaf APIs will automatically try to CONFIRM and UNCONFIRMED transactions on the order in the ValidateAndConfirmPaymentsActivity. It will use a PaymentGatewayTransactionService to do this which it sounds like you are manually invoking from your controller. This confirmed transaction will be the actual AUTHORIZE.

With things like this, you'll end up with the following:

1. A BLC_ORDER_PAYMENT with the amount of the order and a GATEWAY_TYPE of BRAINTREE
2. An UNCONFIRMED BLC_ORDER_PAYMENT_TRANSACTION for the original payment
3. An AUTHORIZE BLC_ORDER_PAYMENT_TRANSACTION whose PARENT_TRANSACTION is the UNCONFIRMED transaction from step 2

Also just a side note: Braintree is one of our commercial modules and we can sell that piecemeal to you if you're interested. Reach out to info AT broadleafcommerce.com if so.

Re: Register a payment module to the payment workflow

Posted: Sun Aug 09, 2015 10:21 am
by dlavoie
Hello Philip !

That is a pretty late reply but I thank you for taking the time. In fact, I ended up making a retro engeering of the nullPayment gateway and managed to figure out the entire workflow !

For now, my client's business forecast are unknown. For this reason, we aren't ready to embrase a commercial solution until our POC is setuped. Also, building a payment module is a great way to learn the BLC Framework. Thank you for your proposal :)