Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
How do payment authorization and statuses work?
Posted: 09 July 2012 06:09 AM   [ Ignore ]
Is a Really Great Dancer
RankRank
Total Posts:  72
Joined  2011-07-18

Hi,

I’m trying to get a grip on just how the whole checkout proces works with order statuses. I’m working with the ‘Ideal’ plugin but I’m getting quite confused over the messages;

Once the order is processed, the admin mail is sent upon ct_completed.

In the admin mail I’ve got:

{exp:cartthrob:submitted_order_info}
{if authorized}SUCCES{if
:else}FAILED{error_message}{/if}
{
/exp:cartthrob:submitted_order_info} 

This returns FAILED: Transaction in process offsite. So the payment is NOT authorized?

At the same time the return-template works like this:

{if authorized}
Your order has succeeded
!
{status}{error_message}
{
/if} 

Authorized is TRUE here, but with the status ‘processing’ and again “Transaction in process offsite”. Since the plugin only has cancel, succes and error I do not understand how the status can become ‘processing’ and authorized at the same time?

Thanks for your help!

Profile
 
 
Posted: 10 July 2012 10:43 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10241
Joined  2008-09-29

NOTE: I’m going to assume you’re using the gateway that I built. I don’t recall who… but someone else was also developing an iDeal bank plugin, and I can’t speak to how that plugin is set up. Please confirm for me that you’re using the ideal plugin that I built.

ANYWAY:

I don’t know if this link will clear anything up (probably not hmmm ) http://cartthrob.com/docs/pages/application_flow/index.html#when-email-notifications-are-sent

That said:
I would suggest using this code, rather than the code you posted. It deals with additional error conditions.

{exp:cartthrob:submitted_order_info}
    {if authorized}
        Your payment is a success
!
        
Transaction ID{transaction_id}
        Your total
{cart_total}
        Your order ID
{order_id}
    {if
:elseif declined}
        Your credit card was declined
{error_message}
    {if
:elseif failed}
        Your payment failed
{error_message}
    {if
:elseif processing}
        Your payment is being processed
{error_message}
    {if
:else}
        There was an unknown error
{error_message}
    {
/if}
{
/exp:cartthrob:submitted_order_info} 

 

This returns FAILEDTransaction in process offsiteSo the payment is NOT authorized

 

I think it’s more likely that you’re seeing a transaction that’s “processing”. If you have a processing notification set up, whenever someone leaves to go to iDeal’s site, the transaction will be considered to be “processing” and a notification will be sent.

Since the plugin only has cancel, succes and error I do not understand how the status can become ‘processing’ and authorized at the same time?

The plugin that I built deals with much more than cancel, success, and error. No order can ever be processing and authorized at the same time, but it’s possible that either the system needs to have its configuration adjusted a bit, or there’s an error in the plugin.

 

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 11 July 2012 03:40 AM   [ Ignore ]   [ # 2 ]
Is a Really Great Dancer
RankRank
Total Posts:  72
Joined  2011-07-18

Hi Chris, thanks for trying to clear things up a bit.

First I’m using your plugin, with a few very minor mods in the array (language is just “nl” now for instance).

I’ve tested all kind of scenario’s with Ideal. Ideal can have succes, cancelled, expired, open, failure, and syntax error. All these scenarios lead to just authorized or failed. Not very fancy, but not a major annoyance either.

Regarding the mail; it looks like the mail is processed BEFORE the transaction is completed, although I have set it to send on ct_completed? No matter what, it says the transaction is processing. If I check the mail-template directly on the server, the transaction is completed or failed however.

I’ve kind of solved it by sending a notification on ct_completed for a succesfull transaction, and a mail with a custom fail message (ct_failed) when a transaction fails. That appears to work.

Profile
 
 
Posted: 12 July 2012 06:00 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10241
Joined  2008-09-29

No matter what, it says the transaction is processing.

Edit the following file:

cartthrob > models > order_model.php

change the get_order_status function to this:

public function get_order_status($entry_id)
    
{
        
// this always needs to be direct from the database.
        // getting cached data... man, it really screws us up when the get_status function is used more than once to check, then set, then check again somewhere else. 
        
$query $this->db->where('entry_id'$entry_id)
                  ->
limit(1)
                  ->
get('cartthrob_status');
        if (
$query->num_rows())
        
{
            $data 
$query->row_array(); 
            if (isset(
$data['status']))
            
{
                
return $data['status']
            
}
        }
        
        
return $this->get_status($entry_id'status'NULL);
        
    

 

I think the problem you’re having is due to a caching issue I recently discovered with some other gateways that use ext load like the ideal gateway uses.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 17 July 2012 12:01 AM   [ Ignore ]   [ # 4 ]
Is a Really Great Dancer
RankRank
Total Posts:  72
Joined  2011-07-18

Hi Chris,

I’ve added the code to the file. It helps a bit. If a transaction is cancelled, the error_message is cancelled too, but if the payment is ‘expired’ the error message still is ‘processing’. For me it’s still to confusing to use it, so I stick to just a fail and succes mail with a reference to the Ideal portal log files.

Profile
 
 
Posted: 17 July 2012 08:34 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10241
Joined  2008-09-29

beneath case 90 in the gateway file…

case "97"
                
$auth = array(
                    
'authorized'     => FALSE,
                    
'error_message'    => $this->lang('rabobank_error_code_number').":".$responseCode." ".$this->lang('rabobank_response_97'),
                    
'failed'        => TRUE,
                    
'declined'        => FALSE,
                    
'transaction_id'=> NULL 
                    
);
            break; 

 

in the language file

add this:

'rabobank_error_code_97'            => 'The transaction has expired.'

 

That will update the transaction when an expired response comes through.

but if the payment is ‘expired’ the error message still is ‘processing’.

This is something I’m addressing in a future release of CT. Currently internally CT pretty much only tracks:

authorized,
declined,
failed,
processing

I’ll be adding support for other payment triggers like expired, canceled, voided, etc in the near future.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 17 July 2012 10:56 AM   [ Ignore ]   [ # 6 ]
Is a Really Great Dancer
RankRank
Total Posts:  72
Joined  2011-07-18

Sorry Chris, but which gateway file do you mean? I haven’t found any ‘case 90’ The ideal gateway has no case at all?

Profile
 
 
Posted: 17 July 2012 11:47 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10241
Joined  2008-09-29

Sorry Chris, but which gateway file do you mean? I haven’t found any ‘case 90’ The ideal gateway has no case at all?

I’ve sent you a file to make sure we’re using the same thing. Or at least something close.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile