Jump to content

Create order after payment confirmation with only cart id


Recommended Posts

Hello,

im working on a payment module and i have issue with creating order after the payment.

 

Payment service provider redirect user after payment on redirection page

but than send a post to notification url (pure backend comunication).

 

Redirect and notification is asynchronous.

 

After processing notification message i know payment result and cart id.

 

Is there any way to create order from backend with only cart id?

Or in other words is there a way to access context->cart with specific id from backend?

 

Looking forward to your replies

Edited by p500plus (see edit history)
Link to comment
Share on other sites

I have already solved my problem.If someone is interested in solution its something like this:

 

$cart = new Cart($cartId);

 

$customer = new Customer($cart->id_customer);

$currency = new Currency($cart->id_currency);

$total = (float)$cart->getOrderTotal(true, Cart::BOTH);

 

$this->module->validateOrder($cart->id, $pspStatusId, $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...