function uc_paypal_payment_method in Ubercart 5
Same name and namespace in other branches
- 6.2 payment/uc_paypal/uc_paypal.module \uc_paypal_payment_method()
Implementation of hook_payment_method().
File
- payment/
uc_paypal/ uc_paypal.module, line 152 - Integrates various PayPal payment services and Instant Payment Notifications (IPN) with Ubercart!
Code
function uc_paypal_payment_method() {
$path = base_path() . drupal_get_path('module', 'uc_credit');
$title1 = '<img src="https://www.paypal.com/en_US/i/logo/PayPal_mark_37x23.gif" style="position: relative; top: 5px; margin-right: 4px;">' . t('PayPal - pay without sharing your financial information.');
$title2 = '<br /><span id="paypal-includes" style="padding-left: 5.5em;">' . t('<b>Includes:</b> ');
$cc_types = array(
'visa',
'mastercard',
'discover',
'amex',
'echeck',
);
foreach ($cc_types as $type) {
$title2 .= ' <img src="' . $path . '/images/' . $type . '.gif" style="position: relative; top: 5px;">';
}
$title2 .= ' <img src="https://www.paypal.com/en_US/i/logo/PayPal_mark_37x23.gif" style="position: relative; top: 5px; margin-right: 4px;"></span>';
$methods[] = array(
'id' => 'paypal_wps',
'name' => t('PayPal Website Payments Standard'),
'title' => $title1 . $title2,
'review' => t('PayPal'),
'desc' => t('Redirect users to submit payments through PayPal.'),
'callback' => 'uc_payment_method_paypal_wps',
'weight' => 1,
'checkout' => FALSE,
'no_gateway' => TRUE,
);
$methods[] = array(
'id' => 'paypal_ec',
'name' => t('PayPal Express Checkout'),
'title' => $title1,
'review' => t('PayPal'),
'desc' => t('Complete orders through PayPal Express Checkout.'),
'callback' => 'uc_payment_method_paypal_ec',
'weight' => 1,
'checkout' => FALSE,
'no_gateway' => TRUE,
);
return $methods;
}