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.


In reply to Re^5: Credit card processing provider and Perl interface by scorpio17
in thread Credit card processing provider and Perl interface by vit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.