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' => $site_url.'/cart/xpay/complete',
'NOTIFICATION_URL' => $site_url.'/cart/xpay/server',
'ERROR_URL' => $site_url.'/cart/xpay/error',
'ANNULMENT_URL' => $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?