Post by X-Rayden » Mon Mar 17, 2008 11:34 pm

Ok, let states facts :

i'm developping a new paiement method that work kinda like paypal, but it doesn't callback, so i have to take the order, and IF the user click continue avec the process will have a process pending with an email.

here the timeline i wanna do :
  • the user is at /index.php?controller=checkout_confirm
  • user clicks continue.
  • THEN an order MUST be register in the cart as "Paid_Unconfirmed" (without email confirmation)
  • then posted the same form to the paiement api.
  • after the paiment is done in the API if the user click on "continue", then the process would change "paid_unconfirmed" to "pending" with an email confirmation of the order to the user.
the problem is :

if in the feild(); i use a $this->order->process to make the "paid unconfirmed", it works!
but I dont want that, it will register an order for EVERYONE that goes to /index.php?controller=checkout_confirm even if they just go away...

so i've created a javascript reloading page dans will recreate the form and post it... it work, it post to the api fine... but when trying to process, fail to even write something in the database!



i've told the script to go to the "callback" function in the checkout... but this code wont work :

index.php?controller=checkout_process&action=callback&payment=isecureca

Code: Select all

$this->config->set('config_email_send', false); #disabling email so there is no confirmations.

$sql = "select `order_status_id` from `order_status` where `name` = '?' and `language_id` = '?'";

$parsed = $this->database->parse($sql, $this->language->get('order_status_paid_unconfirmed'), $this->language->getId()); 

$results = $this->database->getRow($parsed);

if ($results) {

  $this->order->process($results['order_status_id']);

} else {

  die('Configuration error ' . $parsed);

}


$ouput = '<html><body onload="document.forms[0].submit();">';

$ouput .= '<form action="https://secure.internetsecure.com/process.cgi" name="ISSendpost" method="POST">'."\n";

$ouput .= '<input type="hidden" name="MerchantNumber" value="' . $this->request->get('MerchantNumber', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="language" value="' . $this->request->get('language', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxName" value="' . $this->request->get('xxxName', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxCompany" value="' . $this->request->get('xxxCompany', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxAddress" value="' . $this->request->get('xxxAddress', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxCity" value="' . $this->request->get('xxxCity', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxProvince" value="' . $this->request->get('xxxProvince', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxPostal" value="' . $this->request->get('xxxPostal', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxCountry" value="' . $this->request->get('xxxCountry', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxEmail" value="' . $this->request->get('xxxEmail', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxVar1" value="' . $this->request->get('xxxVar1', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="ReturnCGI" value="http://www.accestelecom.ca/index.php?controller=checkout_process" />' . "\n";

$ouput .= '<input type="hidden" name="Products" value="' . $this->request->get('Products', 'post') . '" />'."\n";

$ouput .= '<input type="hidden" name="xxxVar2" value="' . $this->request->get('xxxVar2', 'post') . '" />' . "\n";

$ouput .= '<input type="hidden" name="xxxVar3" value="' . $this->request->get('xxxVar3', 'post') . '" /></form>'."\n".'</body></html>' . "\n";

echo $ouput;
normaly it should process the order withing this page, then post the form to the api.

but NOTHING happens,

i've tried echoing something where the process should take place,
it's echoing normaly, so all if tend to go to the right place, but it doesn't process the order!

how should i proceed to find THE problem?

User avatar
New member

Posts

Joined
Sat Jan 12, 2008 3:54 am
Location - Québec, Qc, Canada

Post by bruce » Mon Mar 24, 2008 10:11 am

I would suggest that you do not really have an order unless the customer has paid first, as per the normal workflow. Otherwise, the customer has no way to get to your payment section a second time if, for example, their session is lost while on your payment page.

There is an example in the payment contributions (securepay) that may help you. There is also another posting http://forum.opencart.com/index.php/top ... tml#msg600 about payment gateways where the programmer put an additional controller in the workflow to capture the payment details.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm
Who is online

Users browsing this forum: No registered users and 2 guests