Laravel 4 - Payment System Architecture
That will be a little hard do explain, but let me try:
I'm building an online store using Laravel 4 and now I have to create the
payment methods and they might be completely different from each other and
for each one of them I'll have to build a different number of pages
(views), wich could be, as examples:
Credit Card
Get the credit card data (to, first, create a token).
Nice! It was accepted by the company and your token was created, would you
really like to pay?
It was paid, thanks!
Credit Card
Get the debit card data.
It was paid, thanks!
Paypal
Jump to paypal site and wait for it to get back.
Stripe
Gosh, we still doesn't have it in Brazil. :(
Billet (Banking) I think this is something we only have in Brazil. It's is
a document (like a bill or a fracture, here's an example: Billet) you can
print at home (it has a barcode) and pay at your bank (online or in
person). Payment is received in our bank account a couple of days after
payment, so there's nothing we can do, just show the document and wait for
a payment that may never happen:
Just open a new window with it, customer may print it or not.
And, of course, for each step there might be decisions to make, problems,
error messages, retries in case of errors (credit card may say "try again"
and I must ask the user if he wants to do it).
So how would you achitecture this, in terms of (mainly) views, controllers
and services (or repositories or libraries...), the way we can at anytime
add more payment methods to the list. Are there any Design Patterns (to
add to the Repository Pattern) wich would help to design this kind of
interaction?
No comments:
Post a Comment