yaniv14 Posted August 7, 2015 Share Posted August 7, 2015 Hi, I've created a new payment module and I am trying to save extra data on existing columns under ps_order_payment. I am talking about the fields: card_number, card_brand, card_expiration & card_holder. I cannot find any existing function that use those fields. In validateOrder function I am only passing transaction_id in extra_vars, but I don't see anywhere in the function that is can use to save the columns I mentioned. Help will be appreciated. Using PS1.6 Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted August 8, 2015 Share Posted August 8, 2015 Hi, I've created a new payment module and I am trying to save extra data on existing columns under ps_order_payment. I am talking about the fields: card_number, card_brand, card_expiration & card_holder. I cannot find any existing function that use those fields. In validateOrder function I am only passing transaction_id in extra_vars, but I don't see anywhere in the function that is can use to save the columns I mentioned. Help will be appreciated. Using PS1.6 hi... i hope help for this link http://doc.prestashop.com/display/PS15/Hooks+in+PrestaShop+1.5 you can use the hook display the order extra fileds. thanks Link to comment Share on other sites More sharing options...
yaniv14 Posted August 8, 2015 Author Share Posted August 8, 2015 Thank you for your reply, But I don't think there is a action hook that handle what I need. Link to comment Share on other sites More sharing options...
yaniv14 Posted August 14, 2015 Author Share Posted August 14, 2015 Would like to get some details on how to use actionPaymentCCAdd To get what I need. Link to comment Share on other sites More sharing options...
bellini13 Posted August 15, 2015 Share Posted August 15, 2015 Just want to be sure that you are aware, by saving this information in your database, you are going to expose yourself to strict PCI compliance standards. You really should avoid storing any of this information. Instead of storing it, does your payment provider offer an API where you could obtain and display the information when required? As for the actionPaymentCCAdd hook you want to use... there is no need to use a hook to add this information. directly after you execute validateOrder, you would do something like this... // @since 1.5.0 Attach the Transaction ID to this Order if (version_compare(_PS_VERSION_, '1.5', '>=')) { $new_order = new Order((int)$this->currentOrder); if (Validate::isLoadedObject($new_order)) { $payment = $new_order->getOrderPaymentCollection(); if (isset($payment[0])) { $payment[0]->transaction_id = pSQL($id); $payment[0]->card_number = pSQL($card_number); $payment[0]->card_brand = pSQL($card_brand); $payment[0]->card_expiration = pSQL($card_expiration); $payment[0]->card_holder = pSQL($card_holder); $payment[0]->save(); } } } this hook is executed when the payment record is saved to the database 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now