CMCiC french banks - IPN troubles
Hi all,
I'm the creator of the french banks CMCiC contribution for osCommerce. As I'm translating it for ZenCart (lot of people tried but nobody gets it...) I'm in trouble with the IPN process. The session isn't recovered so the order can't be recognized by the system as the customer as just paid and is still on the bank server.
Here is the code :
PHP Code:
echo 'session :'.$CMCIC_bruteVars['texte-libre'].'<br />';
if (!function_exists('session_start')) {
define('PHP_SESSION_NAME', 'zenid');
define('PHP_SESSION_PATH', $cookie_path);
define('PHP_SESSION_DOMAIN', $cookie_domain);
define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
include(DIR_WS_CLASSES . 'sessions.php');
}
zen_session_name('zenid');
zen_session_save_path(SESSION_WRITE_DIRECTORY);
// récupération de l'id de session contenu dans texte-libre
zen_session_id($CMCIC_bruteVars['texte-libre']);
$session_started = false;
zen_session_start();
$session_started = true;
echo 'customer_id :'.$_SESSION['customer_id'].'<br />';
When I manually execute it as the bank does, I can read the right $CMCIC_bruteVars['texte-libre'] identifier. But the session seems not to be created as $_SESSION['customer_id'] seems to be desperatly empy.
Do anyone has got ideas about this ?
Re: CMCiC french banks - IPN troubles
Hello
I'm very interested about this... Did you get it ?
Maybe i can help you with my little knowledge ?
Re: CMCiC french banks - IPN troubles
I've got a module that do the jobs, BUT one problem still exists.
In the mail sent to customer I've got the list of items purchased, but no Price into the Emails and no totals.
This is also the same into the table Order Total.
What the process used to get the price of items and set the correct values into tables.
Pascal
HOW TO get a complete CheckOut process with CMCIC?
Hi all,
I've added the CMCIC Module on my shop.
Lots of problem, because this module is designed for PHP 5, and my serveur is using PHP 4
Now all the processus works, I can send the request to the CMCIC server and get the response upon paiement done.
The last thing that is missing, is that I don't have the table order_total updated with this order.
Into the Email, I just get the list of purchased item with no prices.
What's missing into the process ?
Any idea ?
Thanks for your help
Pascal
Re: HOW TO get a complete CheckOut process ?
Where did you get this "CMCIC" module and what is it designed to do?
Re: HOW TO get a complete CheckOut process ?
I've download it from the French Zencart download.
The process is supposed to send a request to CMCIC Server for Credit Card payement and get back the response upon success or not.
All seems good EXCEPT the fact that the table Order Total is not updated.
Pascal
Re: Payment Module HOW TO?
Quote:
Originally Posted by
zattara
I'm in trouble with the IPN process.
The use of an IPN to complete an order is ALWAYS going to be problematic.
A BETTER approach is for the bank/gateway to allow API calls which the store can use to submit the transaction and receive an immediate response. Then the order doesn't need to be reconstructed, and thus all the VERY SERIOUS security problems of using an IPN can be avoided.
Quote:
Originally Posted by
fe1lho
And upon payment the Bank server notify the Shop
THAT is the problem.
It is better to allow the shop to directly control the transaction, instead of giving away all control to the bank.
Quote:
Originally Posted by
fe1lho
and there we recreate the context to create the order, but the order is not complete because the order total table does not contains any information of the order
The order table, and orders_products and order_total tables will NOT contain ANY details of the order until the payment module completes the payment.
A proper gateway module will receive confirmation IMMEDIATELY (not via an IPN) while the customer is in the browser, with active session, as part of the checkout_process code execution, which will run the before_process() and after_process() methods of the payment module to finalize the payment details and validation process, then hand off the order information to the order class to save the order and order total details, and then finally send the emails to the customer and storeowner.
If you insist on using an IPN process, you must RECREATE your OWN custom version of the ENTIRE checkout_process logic after you first rebuild a COPY of the entire customer's session in their absence. This also requires you to do CAREFUL security validation to ensure there is no fraudulent hijacking or spoofing taking place.
Using an IPN process is not ideal, and fraught with the sorts of problems you are encountering.
Re: Payment Module HOW TO?
Quote:
Originally Posted by
DrByte
The order table, and orders_products and order_total tables will NOT contain ANY details of the order until the payment module completes the payment.
A proper gateway module will receive confirmation IMMEDIATELY (not via an IPN) while the customer is in the browser, with active session, as part of the checkout_process code execution, which will run the before_process() and after_process() methods of the payment module to finalize the payment details and validation process, then hand off the order information to the order class to save the order and order total details, and then finally send the emails to the customer and storeowner.
Well as I said, on the response transaction from the bank, there is some checks according transactions and session, so there is some security.
The order in my case is there created and the order products table are updated with the current order.
BUT there is no price associated to the product, and the email sent to the customer and storeowner, just list the products with no price, and no Total
I just notice that in may case the CMCI Class does not extend the base..
Is it there the solution ???
Any idea ?
Pascal
Re: Payment Module HOW TO?
Extending "base" is not going to solve this problem of yours.
You need to study your code to determine where it is missing the steps which properly build the order details, and fix that.
Re: CMCiC french banks - IPN troubles
Well I've alerady checked all the process and did not discover what going wrong.
The reponse code is base on the code of checkout_process.php
Pascal
Re: CMCiC french banks - IPN troubles
The problem with relying on an IPN approach is that you need to reconstruct the entire session independent of the customer. So that means you need to store the entire session before the customer leaves your site so you know what to reconstruct before running the logic akin to checkout_process. Also, you need to trick the customer's live session into *thinking* that the order is complete, even though it doesn't exist in the store yet. It's complicated and FULL of problems and numerous risks of never completing at all. A much better approach is to use an API approach, and ignore the IPN approach altogether.
Plus, checkout_process.php is NOT the entire logic that happens during the checkout-process stage. There's code in the header_php.php for that page too.
You can try to mimic the PayPal IPN logic, but keep in mind that the code there is VERY complicated because of the thousand things that could go wrong, and often do, and workarounds for each. There are better ways to do it, but not in the v1.x architecture. ZC v2 will be easier to write for, but REGARDLESS, using an IPN approach is outdated and archaic, and not an efficient or contemporary way of interacting with online stores.
Re: CMCiC french banks - IPN troubles
Well I'm able to recreate the session.
The response also got some code of header
I think that things that miss to my code, is to get price of items into the order.
Is there some function that list the content of the order ?
So I may checks what's going wrong.
On process completion the tabler order is updated, and the table order-product, but not the order_total.
Pascal