Drupal commerce - what page/function should i call after an off site payment I'm creating a module to integrate 'xpay - carta sì' payments inside Drupal commerce. 
I don't have any documentation on xpay apart for the module developed for ubercart. 
Anyway i managed to code the part where the payment method is added and i succesfully dealt with going from my site to the bank page sending the correct data. I'm stuck with where to go after the payment is completed. 
When i send the data to the bank i set some url to call according to the outcome of the transaction

'RESULT_URL' =&gt; $site_url.'/cart/xpay/complete',
'NOTIFICATION_URL' =&gt; $site_url.'/cart/xpay/server',
'ERROR_URL' =&gt; $site_url.'/cart/xpay/error',
'ANNULMENT_URL' =&gt; $site_url.'/cart/xpay/error',


I've defined those menu_callbacks, but i'm not sure that Drupal Commerce works like this, maybe i should do something totally different like returning to $site_url.'/checkout/%order_id/payment'

Has anybody of you tackled something similar?
i used those two

// Return to the previous page when payment is canceled
'cancel_return' =&gt; url('checkout/' . $order-&gt;order_id . '/payment/back/' . $order-&gt;data['payment_redirect_key'], array('absolute' =&gt; TRUE)),

// Return to the payment redirect page for processing successful payments
'return' =&gt; url('checkout/' . $order-&gt;order_id . '/payment/return/' . $order-&gt;data['payment_redirect_key'], array('absolute' =&gt; TRUE)),


but also have an IPN. (your NOTIFICATION_URL)

don't forget to create a commerce transaction with the feedback from the carrier !

maybe have a look at another module, like postfinance (by me),
or paypal (by Ryan - the commerce god ;))