Paypal credit card validation
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?开发者_JS百科 or any other better way you know?
My site is in PHP..
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
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!
I made it with the help of PAYPAL API's DoVoid Function. I'm making a payment of $1 in Authentication Mode, and if it return success i'm using DoVoid with returned transaction-id.
精彩评论