You are here

function uc_paypal_payment_gateway in Ubercart 6.2

Same name and namespace in other branches
  1. 5 payment/uc_paypal/uc_paypal.module \uc_paypal_payment_gateway()

Implements hook_payment_gateway().

File

payment/uc_paypal/uc_paypal.module, line 142
Integrates various PayPal payment services and Instant Payment Notifications (IPN) with Ubercart!

Code

function uc_paypal_payment_gateway() {
  if (!module_exists('uc_credit')) {
    drupal_set_message(t('You must <a href="@modules">enable the Credit Card module</a> to use PayPal Website Payments Pro.', array(
      '@modules' => url('admin/build/modules', array(
        'fragment' => 'edit-modules-ubercart-payment',
      )),
    )), 'warning');
    return;
  }
  $gateways[] = array(
    'id' => 'paypal_wpp',
    'title' => t('PayPal Website Payments Pro'),
    'description' => t('Process credit card payments using Website Payments Pro.'),
    'settings' => 'uc_paypal_wpp_settings_form',
    'credit' => 'uc_paypal_wpp_charge',
    'credit_txn_types' => array(
      UC_CREDIT_AUTH_ONLY,
      UC_CREDIT_PRIOR_AUTH_CAPTURE,
      UC_CREDIT_AUTH_CAPTURE,
    ),
  );
  return $gateways;
}