2

I'm trying to combine MIGS and omnipay.

Steps 1. Download omnipay 2.5 https://civicrm.org/extensions/omnipay-multiprocessor-extension

sudo -u apache wget https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor/archive/2.5.zip
sudo -u apache curl -s http://getcomposer.org/installer | sudo -u apache php
sudo mkdir /usr/share/httpd/.composer
sudo chown apache /usr/share/httpd/.composer
  1. Unzip into files/civicrm/ext

  2. Require MIGS: sudo -u apache ./composer.phar -v require omnipay/migs

I had to do a bit of hacking about. php7.0 and some dependency troubles.

  • Edit vendor/omnipay/tests/composer.json - make dev

    sudo -u apache mkdir /srv/web/docdownload.com.au/web/files/civicrm/ext/nz.co.fuzion.omnipaymultiprocessor-2.5/vendor/sebastian/global-state/src
    sudo -u apache mkdir /srv/web/docdownload.com.au/web/files/civicrm/ext/nz.co.fuzion.omnipaymultiprocessor-2.5/vendor/sebastian/comparator/src
    sudo -u apache mkdir /srv/web/docdownload.com.au/web/files/civicrm/ext/nz.co.fuzion.omnipaymultiprocessor-2.5/vendor/sebastian/diff/src/ 
    

Result

Using version ^2.2 for omnipay/migs                 
./composer.json has been updated

The omnipay extension is registered.

  1. Registering MIGS with omnipay. I want an on-site, pass by xml processor.

I created a file Metadata/omnipay_Migs_TwoParty.mgd.php, cleared caches. I tried registering the payments processor and cannot see it in the list. Administration > System Settings > payment processors - civicrm/admin/paymentProcessor.

What goes into the metadata file omnipay_Migs_TwoParty.mgd.php? Has anybody created one before? Is there a document reference? Reverse engineer? Debug until it works? I created the minimum.

 return array(
   array(
    'name' => 'OmniPay - Migs_TwoParty',
    'entity' => 'payment_processor_type',
    'metadata' => array(
  ),
  'params' => array(
    'version' => 3,
    'title' => 'OmniPay - Migs_TwoParty',
    'name' => 'omnipay_Migs_TwoParty',
    'description' => 'Omnipay Migs_TwoParty Onsite processing',
    // DO NOT CHANGE: Labels are used as Omnipay gateway properties.
    'user_name_label' => 'Api Key',
    'password_label' => 'Password',
    // When ready we need to add signature_label & figure out how to pass through to tpl.
    //'signature_label' => 'Public Key (if wishing to use Client Encryption - recommended)',
    'class_name' => 'Payment_OmnipayMultiProcessor',
    'url_site_default' => 'http://unused.com',
    'url_api_default' => 'http://unused.com',
    'url_recur_default' => 'http://unused.com',
    'url_site_test_default' => 'http://unused.com',
    'url_recur_test_default' => 'http://unused.com',
    'url_api_test_default' => 'http://unused.com',
    'billing_mode' => 1,
    'payment_type' => 1,
    'is_recur' => 1,
    ),
  ),
);
1

I got this to work with the following meta-data file. omnipay_Migs_TwoParty.mgd.php. Since the field in the code is merchantAccessCode I changed the label for passwords to "Merchant access code'. Both the debugger and the error message show this.

return [
 [ 
   'name' => 'OmniPay - MIGS',
   'entity' => 'payment_processor_type',
   'params' => array(
     'version' => 3,
     'title' => 'OmniPay - MIGS',
     'name' => 'Migs_TwoParty',
     'description' => 'Omnipay MIGS',
     // DO NOT CHANGE: Labels are used as Omnipay gateway properties.
    'user_name_label' => 'Merchant Id',
    'password_label' => 'Merchant access code',
    'signature_label' => 'Secure Hash',
    'class_name' => 'Payment_OmnipayMultiProcessor',
    'url_site_default' => 'http://unused.com',
    'url_api_default' => 'http://unused.com',
    'url_recur_default' => 'http://unused.com',
    'url_site_test_default' => 'http://unused.com',
    'url_recur_test_default' => 'http://unused.com',
    'url_api_test_default' => 'http://unused.com',
    'billing_mode' => 1,
    'payment_type' => 1,
    'is_recur' => 1,
   ),
 ]
];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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