Commit 172b7128 authored by eileen's avatar eileen

Update omnipay

parent 23795c48
......@@ -1065,7 +1065,7 @@ class CRM_Core_Payment_OmnipayMultiProcessor extends CRM_Core_Payment_PaymentExt
return TRUE;
}
protected function cancelSubscription() {
public function cancelSubscription() {
// We take no action here - the key thing is that the contribution_recur record is updated.
}
......@@ -1462,7 +1462,11 @@ class CRM_Core_Payment_OmnipayMultiProcessor extends CRM_Core_Payment_PaymentExt
}
// and, at least with Way rapid, the createCreditCard call ignores any attempt to authorise.
// that is likely to be a pattern.
$action = CRM_Utils_Array::value('payment_action', $params, empty($params['is_recur']) ? 'completePurchase' : 'purchase');
$action = CRM_Utils_Array::value('payment_action', $params, 'purchase');
if (method_exists($this->gateway, 'completePurchase') && !isset($params['payment_action']) && !empty($params['is_recur'])) {
$action = 'completePurchase';
}
$params['transactionReference'] = ($params['token']);
$response = $this->gateway->$action($this->getCreditCardOptions(array_merge($params, ['cardTransactionType' => 'continuous'])))
->send();
......
<?php
/**
* Wrapper for Rest class permitting ajax api without the access AJAX API
* for the specific action 'preapprove'.
*
* See https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor/issues/108
*/
class CRM_Utils_RestPreapprove extends CRM_Utils_REST {
/**
* Run ajax request.
*
* @return array
*/
public static function ajax() {
// We can't use a sanitised fn due to funky handling for word 'action' - fortunately
// we are only using it for a php compare nothing risky.
$action = strtolower(CRM_Utils_Array::value('action', $_REQUEST));
$entity = str_replace('_', '', strtolower(CRM_Utils_Array::value('entity', $_REQUEST)));
if (($action !== 'preapprove' || $entity !== 'paymentprocessor') && !CRM_Core_Permission::check(['access CiviCRM', 'access AJAX API'])) {
CRM_Utils_System::permissionDenied();
return NULL;
}
return CRM_Utils_REST::ajax();
}
}
......@@ -61,8 +61,7 @@ return array(
// 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)',
'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',
......
......@@ -6,16 +6,16 @@ This extension provides support for multiple payment processors in CiviCRM.
The following payment processors are supported:
* Authorize AIM
* [Cybersource](../docs/Cybersource.md)
* Paybox System
* Eway RapidDirect, Rapid & Shared
* GoPay
* Mercanet
* Mollie
* Payment Express - PXPay, PxFusion
* NAB Transact
* Eway RapidDirect, Rapid & Shared
* Paybox System
* Payment Express - PXPay, PxFusion
* PayPal - Standard, Pro, REST & Express
* Authorize AIM
* Mercanet
## Configuration
......
......@@ -14,11 +14,11 @@
<url desc="Support">http://forum.civicrm.org</url>
<url desc="Licensing">http://civicrm.org/licensing</url>
</urls>
<releaseDate>2018-11-16</releaseDate>
<version>3.0</version>
<develStage>alpha</develStage>
<releaseDate>2019-04-04</releaseDate>
<version>3.2</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.7</ver>
<ver>5.13</ver>
</compatibility>
<comments>This module integrates the omnipay library with CiviCRM. This release is for Omnipay 3.x and requires php 7.1. All new development will be here but 2.x series will continue to work.</comments>
<civix>
......
......@@ -86,6 +86,16 @@ function omnipaymultiprocessor_civicrm_alterAPIPermissions($entity, $action, &$p
$permissions['payment_processor']['preapprove'] = ['make online contributions'];
}
/**
* Implements hook_alterMenu().
*
* @param array $items
*/
function omnipaymultiprocessor_civicrm_alterMenu(&$items) {
$items['civicrm/ajax/rest']['page_callback'] = ['CRM_Utils_RestPreapprove', 'ajax'];
$items['civicrm/ajax/rest']['access_arguments'][0][] = 'make online contributions';
}
function omnipaymultiprocessor_civicrm_navigationMenu(&$menu) {
_omnipaymultiprocessor_civix_insert_navigation_menu($menu, 'Administer/System Settings', [
'label' => E::ts('Omnipay Developer Settings'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment