Jump to content

Inserting a payment entry from a module


dhurley

Recommended Posts

I have an order management module that I am working on. It creates a new order from other orders in the system. At the point where the order is created, I am trying to have it insert a payment. The contents of this new order have already been paid for. So I am trying to get to the "payment accepted" or atleast where it is not triggering payment errors.

 

Here is the new order bit:

$odr = new Order();

$odr->id_address_delivery = $this->id_address_delivery;
$odr->id_address_invoice = $this->id_address_invoice;
$odr->id_shop_group = $this->id_shop_group;
$odr->id_shop = $this->id_shop;
$odr->id_cart = $cart->id;
$odr->id_currency = $this->id_currency;
$odr->id_lang = $this->id_lang;
$odr->id_customer = $this->id_customer;
$odr->id_carrier = $this->id_carrier;
$odr->current_state = $this->current_state;
$odr->secure_key = md5(uniqid(rand(), true));
$odr->payment = $this->payment;
$odr->module = "cheque";
$odr->total_paid = $transitOrder->getTotalPaid();
$odr->total_paid_real = 0; // deprecated
$odr->total_products = $transitOrder->getTotalProductsWt();
$odr->total_products_wt = $transitOrder->getTotalDiscountsTaxIncl();
$odr->conversion_rate = 1.000000;
$odr->amount = $transitOrder->getTotalPaid();

$odr->addWs();

adWs() adds a row in ps_order_payment but the amount still stays at 0.00 it is almost like I need to register the payment somewhere. 

Link to comment
Share on other sites

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...