Paypal credit card validation - php

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..

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.

Related

How to manage response from paypal when people pay as a guest checkout. No paypal account

I'm using a custom php Paypal nvp API for express checkout.
When people pay with their paypal account I have no problem in my php script, I insert the order, order details and I send the email to the customer. When people pay with their credit card without paypal account I don't receive the transactionid.
The strange fact is that when I use the sandbox, I generate a fake visa I do the payment, in my database I have the transaction id and I receive the email.
Someone had or is having my same problem?
There are different ways to manage payment with and without account?
For both I'm checking the payment status = Complete.
Happy to help your query,
Firstly, PayPal NVP is deprecated implementation. There wouldn't any support for new merchants who willing to add PayPal as a payment option.
Please go through the below recent products which run on REST APIs. I suggested two options of accepting payments so, hence choose the best one suits you.
Standard Integration Link.
Advanced Credit & Debit Card Link.
Thanks.

Credit Cards with PayPal REST API

My client uses the PayPal NVP API for processing both PayPal and credit cards payments. That appears to be deprecated or PayPal is encouraging upgrading to REST. I convinced my client to do the upgrade and while implementing it I noticed the following:
Important: The use of the PayPal REST /payments APIs to accept credit
card payments is restricted. Instead, you can accept credit card
payments with Braintree Direct.
That puts a serious wrench in my work.
A little more searching around and I find this option for accepting credit card payments with the REST API:
Guest payments with a credit card that is stored in the PayPal vault
This would imply to me that the Vault must be used on conjunction with guest payments. Can anyone confirm if that is the case?
It looks like to enable guest checkout payments "PayPal Account Optional" must be turned on which I have confirmed is on in my sandbox account.
The presumption I am now going on is credit card payments with the REST API will work as long as this option is on in the merchant's account, however, I don't find this clearly stated anywhere and I don't want to continue on swapping out APIs for my client if credit card payments via REST won't work now or at some point in the future. I also find it odd I don't find any example API calls in the Payments API using a credit card. I had to figure that one out on my own with a little help from Google.
I appreciate anyone's experience using the REST Payments API to process credit card payments given it's stated that it's "restricted".

Two different Payment Gateway for one payment

I'm building functionality in which product payment is divided into two parts -
1. service charge
2. actual payment
service charge payment will be done thr' stripe api (as client wants this gateway)
actual payment will be done thr' any type of gateway as per user selection.
But, crucial part is, both parts of payment should be done on one click.
On one click, it should go to stripe and other gateway that user has selected.
Can it be possible?
If yes, what will happen in the case where one of the two parts of payments is successful and other one failes.
Where can I redirect success url for both types of payments? on same page or another page?
As card details will be given only once by user in one form and submitted, can these details remain secure while processing of two transactions?
I have thoroughly searched for this, but can't find answer.
Thanks in advance.
Assuming this is a credit card payment only (and not a wallet such as PayPal or WebMoney, etc) all you need to do is store the credit-card details at your servers. Just make sure you are PCI compliant for that.
In this case, you will charge the service fee via stripe and the actual payment via the 2nd payment gateway. Just make sure you refund one if the other failed. Also ensure that the user is well aware that he will see TWO charges on his card. I would advise showing that nicely in the invoice page.
So it's not that complex of a flow for stored credit cards, but if you lack the credit card data and let the user pick an online payment option such as PayPal, then you'll need to ensure this online payment is successfully completed before charging the service fee via stripe.

Diference between API calls dononreferencedcredit and direct payment

Im new in PayPal and I just want to ask, what is functional diference between API calls dononreferencedcredit and direct payment?
I understand it, that both send money to credit card, is it correct?
EDIT:
Is it possible to send money from my paypal account to credit/debit card or bank account of someone else using Paypal payments Standard? Or is it possible using PRO version? Exists any API or anything else for it?
DoDirectPayment takes money from a card and DoNonReferenceCredit issues a credit to a card.
In most cases you'd be more interested in DoDirectPayment and RefundTransaction, as the RefundTransaction API call will refund whatever type of transaction, charged via whichever funding source (be it card, bank, PayPal balance, et cetera).
DoNonReferencedCredit would only apply for a limited set of use cases; e.g. if you wish to disburse funds directly to someone's credit card. However, even this can already be handled by the MassPay API call where MassPay disburses it to the PayPal balance of the receiver, and the receiver can do with these funds as they please.
To me it seems that dononreferencedcreditissues credit to a card, while it's not being referenced in the original transaction. See this page for more information.
DoNonReferencedCredit is definitely the way to go if you do not want or do not have a reference to the original transaction. PayPal accounts do not allow NonReferenceCredits by default, you will have to contact business support to have this option enabled on your account.
You will receive the following error if NonReferenceCredits are not enabled on your account.
"Invalid merchant information: 10002-You do not have permissions to make this API call"

code protection php chargeback issue

today i've approached by a client asking me to do major revamp on website and offering good money.
However, the payment method he offering is via credit card - paypal, only method available to him.
So, my question now is, what should i do to protect myself from paypal chargeback?
Is there any protection i can add to my php codes to protect me from this kind of event incase it occured?
Thank you
The fact that you're thinking of putting something into the code is absurd. Putting something in the code will do nothing in the end. If you're smart, you will get all of his contact information and verify it before working with him and log any and all conversations. Then if he attempts a chargeback, you can take legal action against him to retrieve the funds.
The seller and PayPal can work together to dispute the chargeback with the buyer's credit card company. While the chargeback is being disputed, PayPal will debit the seller’s account for the amount in question. If PayPal and the seller ultimately win the chargeback dispute, the credit card company will reimburse PayPal for the chargeback, and PayPal will transfer the recovered funds back to the seller. Depending on the credit card company involved, the process may take up to 75 days.
From: Paypal - Chargeback FAQ

Categories