tags:

views:

434

answers:

2

Hi all, I want to check that the credit card number provided by customer to my site is valid or not for further transaction. for that i wand to only verify taht the CC no is valid or not by Paypal. A method for that can be with paypal api step 1: DoDirectPayment with PAYMENTACTION=Authorization for amt of $1, then step 2: DoVoid that request

Does any one can tell me is any amount is charged by paypal for doing tis stuff? or any other better way you know?

My site is in PHP..

A: 

PayPal charges when a transaction is made, not an authorization. If PayPal charged for authorizations then you would have to pay for people who entered their credit card, authorized, but then abandoned the purchase.

This question should be asked at https://www.x.com/docs/DOC-1613

Christopher Altman
+1  A: 

If you are concerned about whether or not the credit card is valid, you can always check it before posting the transaction to PayPal. I have written a CakePHP component for doing just that. This component could very easily be switched to a class and used for credit card validation: http://github.com/cdburgess/components/blob/master/billing_validation.php

It is very thorough in checking:

  • what type of card it is (visa, master card, etc.)
  • if the card is in fact valid (using the luhn algorithm)

The advantage of validating the card in your system prior to posting to PayPal is there is no round trip cost. Meaning, you do not have to send a request to the PayPal API to do the validation. Chances are they will do the same validation my billing validation does anyway. It can be done faster right on your server.

Keep in mind, the one thing this class will not catch is credit card fraud. That will require a service. However, typically if there is something funny about the card, paypal will catch it when you are trying to process the funds on purchase.

Happy Coding!

cdburgess