Payment setup and processing API #16

Open
jedateach opened this Issue Jul 1, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Collaborator

jedateach commented Jul 1, 2012

Thinking about things from a developer's perspective, can we simplify this:

$paymentController = Payment_Controller::factory($paymenttype);
return $paymentController->processRequest($form, $data);

to this:

return PaymentProcessor::process($paymentType,$data, $redirectto = null); //redirecto is optional

...where $data can also be a Payment model, if desired. Might trigger redirect

or perhaps also allow a broken up approach:

$processor = PaymentProcessor::get($paymenttype);
$processor->auth($data); //does intial prep work, and might even send of an initial request to the gateway
$processor->setRedirect($this->Link('complete'));
$processor->capture(); //might trigger a redirect
if($processor->redirectedTo()){
     return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment