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?

1 Answer 1


i used those two

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

// Return to the payment redirect page for processing successful payments
'return' => url('checkout/' . $order->order_id . '/payment/return/' . $order->data['payment_redirect_key'], array('absolute' => 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 ;))

  • 1
    Thanks, those works, the notification url is the url that is notified as soon as the transaction is completed, the url thatis responsible for creating the transaction inside drupal, is this correct? Mar 23, 2012 at 9:29
  • yep - correct :D
    – rémy
    Mar 23, 2012 at 9:41
  • When I use this , sometimes where comeback form bank show 404 page not found !!!
    – Yuseferi
    Jan 6, 2015 at 6:13
  • what case is 'sometimes', what url is there in the browser causing 404 ?
    – rémy
    Feb 5, 2015 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.