Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Payment: example in Cade's Guide

 
Josep Andreas
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In cade's Guide the Payment class does not have an association with the shopping cart.

Does this mean that the order is created by the orderprocessor first; and only then will the payment be called?
Wouldn't it be better to associate the shopping cart with Payment; then you could, for example, first check if the credit card is valid before creating this order?

thanks for your reply
regards,
J
[ January 19, 2005: Message edited by: Josep Andreas ]
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Josep,
Does this mean that the order is created by the orderprocessor first; and only then will the payment be called?
Wouldn't it be better to associate the shopping cart with Payment; then you could, for example, first check if the credit card is valid before creating this order?



A shopping cart involves update and creation of the cart item.

When u do actually check out, it is better to keep the orderEJBAction separate so that all it does is order processing.
A cart shd also not have the credit card ref as that is mainly order processing.
In case of the example of saving unpaid itinerary to DB, this is not even required at the cart end.
Keep payment separate so if need be it is reusable for other components as well.



HTH
Dhiren
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic