Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Only users with a "Sign Up Code" are allowed to sign up to the website. If they provide a valid signup code, they will be directed to a sign up page where they can provide user information, and PayPal processing is used to process the fee. On completion of payment an account is created.

How can I redirect user to Paypal?
How can I check the payment is paid by user?
How can I create the account if the user paid?

share|improve this question
This is a very broad question. I would advise revising it into several specific smaller questions. – Patrick Kenny Mar 27 '12 at 13:30
you changed the question completely !!! – zhilevan Feb 25 '14 at 8:18

Use the Drupal Commerce module.

  1. Add the Paypal payment method module; hook the login/register form to provide a different redirect page, or use the Rules module.
  2. You can look at the generated transaction.
  3. I would create the account anyway; set a flag, or something, for payed accounts.
share|improve this answer

My suggestion for you is to use hook_user($op) implement it in your module, and work with $op.
I personally have done work like you want with that hook.

share|improve this answer

I guess using Drupal commerce will be extra load(not sure).

Custom Way:

  • Over ride drupal registration form with your custom form
  • submit handler of your custom form will keep all submit value in session

How can I redirect user to Paypal?

  • You can create a custom payment script
  • commerce paypal module will be helpful to see the payment process.commerce paypal module has both off-site and on-site payment options.

How can I check the payment is paid by user?

  • IPN is what paypal returns after a payment(success or failure).
  • You can check IPN response to get the payment status. How can I create the account if the user paid?
  • If successful payment is done create user from session values using user_save() .
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.