Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8332551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:45:23+00:00 2026-06-09T02:45:23+00:00

I am new to Drupal and I have to write a new custom payment

  • 0

I am new to Drupal and I have to write a new custom payment method for ubercart. I briefly understand the hooks system that Drupal has.

In the ubercart api documentation, http://www.ubercart.org/docs/api/hook_payment_method:

<?php
function uc_payment_payment_method() {
  $methods[] = array(
    'id' => 'check',
    'name' => t('Check'),
    'title' => t('Check or Money Order'),
    'desc' => t('Pay by mailing a check or money order.'),
    'callback' => 'uc_payment_method_check',
    'weight' => 1,
    'checkout' => TRUE,
  );
  return $methods;
}
?>

However, when i look at how the paypal module is implemented:

$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',
    'redirect' => 'uc_paypal_wps_form',
    'weight' => 1,
    'checkout' => FALSE,
    'no_gateway' => TRUE,
  );

There are some special fields such as redirect and no_gateway. Where do I find the documentation for these to see what do these fields actually do?

Thanks a lot for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:45:25+00:00Added an answer on June 9, 2026 at 2:45 am

    You can also check Ubercart API docs at http://api.ubercart.me/.

    But I see that for hook_uc_payment_method(), there isn’t any more information here than at the documentation that you referred to.

    Looking at the PayPal payment module as an example, I’ve been able to figure out that the redirect callback specifies the code behind the final checkout button that redirects to the off-site payment gateway.

    So the uc_paypal_wps_form is the form generated behind the final checkout button. If you inspect the rendered checkout button element with Firebug, you’ll see the form generated by this function.

    I also have an example posted on my blog at http://nmc-codes.blogspot.ca/2012/07/how-to-create-custom-ubercart-payment.html

    As for the no_gateway option, this is the only piece of code I can find in the ubercart module that refers to it:

    if (empty($method['no_gateway'])) {
      $gateways = _uc_payment_gateway_list($id, TRUE);
      $options = array();
      foreach ($gateways as $gateway_id => $gateway) {
        $options[$gateway_id] = $gateway['title'];
      }
      if ($options) {
        $form['pmtable'][$id]['uc_payment_method_' . $id . '_checkout']['#title'] .= ' (' . t('includes %gateways', array('%gateways' => implode(', ', $options))) . ')';
      }
    }
    

    It doesn’t seem to do much but add to the label/title of payment method when you view it in the admin list of payment methods at admin/store/settings/payment

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new at Drupal. my url is like www.blabla.com/drupal/blog/ I have some blocks that
I've got a drupal site that gets low traffic, but has tons of new
I have a Drupal site, site.com , and our client has a campaign that
I have several (old) Drupal-sites that need to be replaced with one single new
I'm new in drupal and currently I have to get a way to create
I have inherited a Drupal 6 site to maintain. I am new to Drupal
I have created a Drupal website with a new page for registration purposes. I
I'm a little new to drupal but have been using things like devel module
Iam a php developer, and iam new to drupal.I have installed a drupal site.
Disclaimer: I am new to python and django but have Drupal programming experience. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.