in reply to Re^2: Credit card processing provider and Perl interface
in thread Credit card processing provider and Perl interface

I'm using "Website Payments Standard" - it's free. And I use a slightly modified version of Business::PayPal. But I would recommend using that as a starting point, and customize only if necessary.
  • Comment on Re^3: Credit card processing provider and Perl interface

Replies are listed 'Best First'.
Re^4: Credit card processing provider and Perl interface
by vit (Friar) on Sep 04, 2009 at 16:26 UTC
    But Website Payments Standard does not send a confirmation response, it just sends an e-mail as far as I understand. So how to automatically process the payment for the customer? Could you clarify, please.

      You need to have a page with a "Pay with PayPal" button. Read the paypal documentation very carefully. The button will submit a form to the paypal server. They require a lot of parameters, and if you don't define the proper values, it won't do what you want. Note that once someone clicks the button, they are taken away from your website, to paypal's website (where they are asked to login). Once they complete payment, they should be redirected back to a page on your website saying something like "thank you for your business". You have to login to YOUR paypal account and setup the URL to be redirected back to. Also - you get an email notifying you of the transaction, and the customer gets an email (from paypal) notifying them of the transaction. If you're using IPN, paypal will send a request to a page on your website - you have to configure this URL in your paypal settings also. This page is the IPN processing script, and this is where you need something like Business::PayPal, for example. You have to echo back the form variables that paypal sends, and then check for a 'valid' response. If an error occurs, you have to decide how to handle it. If everything is okay, then you have to do whatever is necessary to complete the transaction (send an email, update a database, write a file, etc.).

      Basically, when a customer clicks the 'pay' button, you know that they have started a payment transaction, but until you get a valid IPN notification, you don't know that the transaction has been successfully completed. Sometime people decide they don't want to pay, browse away, never to return. Sometimes they don't have enough money in their account, forget the password, try to pay with a credit card that paypal declines, etc. But once IPN says 'valid' - you know that the payment is in your account. Now, when the customer is first redirected to the paypal website, it will say something like, "login to pay with paypal" - but they may also opt to pay with a credit card. No paypal login is needed for that. In that case, you're just using paypal as your credit card processor.

      You'll need to read the paypal business account documentation, the IPN documentation, and the developer documentation. All free PDFs - just look for 'documentation' links on paypal's site. You'll also need to setup a 'sandbox' account (this lets you test your script in a safe environment with pretend money) - you need at least one sandbox business account (this is like the pretend version of your real paypal business account, where you define the redirect URL and the IPN url), and at least 1 sandbox customer account (this lets you pretend to be a customer a 'buy something' without spending real money.) For testing, your 'pay' button needs to point to the sandbox URL instead of the real paypal URL. Make sure there's no way real customers can access your site while your testing.

        Thank you very much for the detailed answer. One more question. Is it possible to have PayPal Premier account?