You are here

function uc_payment_method_paypal_ec in Ubercart 6.2

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

Handles the Express Checkout payment method.

1 string reference to 'uc_payment_method_paypal_ec'
uc_paypal_payment_method in payment/uc_paypal/uc_paypal.module
Implements hook_payment_method().

File

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

Code

function uc_payment_method_paypal_ec($op, &$arg1) {
  switch ($op) {
    case 'order-view':
      $txn_id = db_result(db_query("SELECT txn_id FROM {uc_payment_paypal_ipn} WHERE order_id = %d ORDER BY received ASC", $arg1->order_id));
      if (empty($txn_id)) {
        $txn_id = t('Unknown');
      }
      return t('Transaction ID:<br />@txn_id', array(
        '@txn_id' => $txn_id,
      ));
    case 'settings':
      $form['redirect'] = array(
        '#value' => '<div>' . t('For Express Checkout, you need to <a href="!cp_link">enable the cart pane</a> and <a href="!wpp_link">configure the Website Payments Pro settings</a>.', array(
          '!cp_link' => url('admin/store/settings/cart/edit/panes'),
          '!wpp_link' => url('admin/store/settings/payment/edit/gateways'),
        )) . '</div>',
      );
      $form['uc_paypal_ec_landingpage_style'] = array(
        '#type' => 'radios',
        '#title' => t('Default PayPal landing page'),
        '#options' => array(
          'Billing' => t('Credit card submission form.'),
          'Login' => t('Account login form.'),
        ),
        '#default_value' => variable_get('uc_paypal_ec_landingpage_style', 'Billing'),
      );
      return $form;
  }
}