-
Notifications
You must be signed in to change notification settings - Fork 0
/
uc_iyzipay.module
37 lines (32 loc) · 1.32 KB
/
uc_iyzipay.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* @file
* Integrates iyzipay.com's redirected payment service.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function uc_iyzipay_help($route_name, RouteMatchInterface $route_match) {
// Provide information and instructions on the payment method add and edit forms.
if ($route_name == 'entity.uc_payment_method.add_form' &&
$route_match->getRawParameter('plugin_id') == 'iyzipay') {
return '<p>' . t('To accept PayPal payments in iyzipay, please ensure that demo mode is disabled and your store currency is one of USD, AUD, CAD, EUR or GBP.') . '</p>';
}
elseif ($route_name == 'entity.uc_payment_method.edit_form' &&
$route_match->getParameter('uc_payment_method')->getPlugin()->getPluginId() == 'iyzipay') {
return '<p>' . t('To accept PayPal payments in iyzipay, please ensure that demo mode is disabled and your store currency is one of USD, AUD, CAD, EUR or GBP.') . '</p>';
}
}
/**
* Implements hook_ucga_display().
*/
function uc_iyzipay_ucga_display() {
// Tell UC Google Analytics to display the e-commerce JS on the custom
// order completion page for this module.
//@todo, inject $route_name so we can do
//if ($route_name == 'uc_iyzipay.complete')
if (arg(0) == 'cart' && arg(1) == 'iyzipay' && arg(2) == 'complete') {
return TRUE;
}
}