Dialect MIGS, http://drupal.org/project/uc_dialect_pay, is the MIGS 2nd part module and is stuck at D6. Your MIGS module has a lot of good features and looks like a better starting point for a MIGS 2nd party module. I started experimenting with a version of MIGS named MIGS 2nd using Dialect MIGS code in a copy of MIGS. The two would work well with some slight changes to MIGS. Here is the first pre alpha idea from my experiment.

_uc_migs_migs_do_url($args) is similar for the 2nd party system. If MIGS 2nd made MIGS a prerequisite and MIGS is changed slightly, I can reuse most of the MIGS code. I changed _uc_migs_migs_do_url($args) as shown next.

function _uc_migs_migs_do_url($args) {
  $url = variable_get('uc_migs_base_url', UC_MIGS_BASE_URL) . '?' .
    _uc_migs_migs_do_url_general($args) .
    '&vpc_ReturnURL='   . urlencode($args['vpc_ReturnURL']);
  return $url;
}
function _uc_migs_migs_do_url_general($args) {
  $md5HashData = $args['secure_secret'] . $args['vpc_AccessCode'] . $args['vpc_Amount'] . 'pay' . $args['vpc_Locale'] . $args['vpc_MerchTxnRef'] . $args['vpc_Merchant'] . $args['vpc_OrderInfo'] . $args['vpc_ReturnURL'] . $args['vpc_Version'];
  $url = 
    'vpc_AccessCode='   . urlencode($args['vpc_AccessCode']) .
    '&vpc_Amount='      . urlencode($args['vpc_Amount']) .
    '&vpc_Command='     . urlencode('pay') .
    '&vpc_Locale='      . urlencode($args['vpc_Locale']) .
    '&vpc_MerchTxnRef=' . urlencode($args['vpc_MerchTxnRef']) .
    '&vpc_Merchant='    . urlencode($args['vpc_Merchant']) .
    '&vpc_OrderInfo='   . urlencode($args['vpc_OrderInfo']) .
    '&vpc_Version='     . urlencode($args['vpc_Version']) .
    '&vpc_SecureHash='  . strtoupper(md5($md5HashData));
  return $url;
}

The equivalent in MIGS 2nd can then be:

function _uc_migs_2nd_migs_do_url($args) {
  $url = variable_get('uc_migs_2nd_base_url', UC_MIGS_2ND_BASE_URL) .
    '&vpc_CardNum' . '=' . $cc_details['cc_number'] .
    '&vpc_CardExp' . '=' . check_plain($cc_date) .
    '&vpc_CardSecurityCode' . '=' . check_plain($cc_details['cc_cvv']) .
    '&vpc_TicketNo' . '=' . substr(urlencode(''), 0, 15) .
    '&vpc_TxSource' . '=' . substr(urlencode('INTERNET'), 0, 16);
  return $url;
}

If you are open to this type of change to MIGS, MIGS 2nd could be a slim add-on module.

Comments

xurizaemon’s picture

Thanks Peter. I haven't looked at the MIGS 2PT module yet, but yes I'd be in favour of getting this off the ground.

With other payment gateways I've been on a gradual cleanup mission, moving gateway specific functions eg hashing to modulename.lib.inc, and keeping only the core hook implementations in the .module file. I'd rather have the functions available to both modules than make one depend on the other (rather not require uc_migs be enabled unless people intend using it).

Are you able to publish your work as a sandbox or patch?

peterx’s picture

Hello Chris, The site accepted the 3rd party option to keep down the number of code modifications and will not be revisiting the MIGS code for the next few months.

xurizaemon’s picture

No worries and thanks for the quick reply!

Other people have enquired (#1781804: Missing credit card number input) about 2PT. If you're inclined to share your work, that would be welcome.

peterx’s picture

Hello Chris,
We did not proceed beyond what I put in this issue when I created the issue. There were plenty of other things to fix including GST. Switching to a 2nd party is system is on our to-do list somewhere after switching to Drupal 8. :-)

Peter