Paypal payment buttons - how do I test paying without paypal account? - paypal

I have a website which has a Paypal payment button. When this button is pressed it takes the user to paypal to conduct the payment and gives the user a choice of either logging into their paypal account or just entering their credit card details.
I'm trying to test the latter option but I'm not sure what credit card details I need to provide in the Sandbox to allow me to submit a valid Credit card with valid expiry date and CVC code

Use a credit card generator site to generate a test number. I like this site. Any expiration date and security code will work as long as it's not passed the date, of course.

Related

Bank wasn't able to verify your VISA while payment

I am new to PayPal integration I am testing the payment process but facing some issue while checking out. I tried all mention cards in PayPal website but didn't work any.
Error Message:
Sorry, your bank wasn't able to verify your VISA x-**** at this time.
Please choose another way to pay.
Go to the PayPal Dashboard from the account from which you created the Sandbox accounts and PayPal app. There in the Mock section in the side navigation go to Credit Card Generator. Here select the country that you have chosen while making the business sandbox account and click Generate CC.
Now copy the details of the card generated. Now go to the site where you have integrated PayPal checkout and while making payment instead of choosing the default card click on add Debit/Credit card and add a card with the details the card that you generated. You'll be redirected to a payment page, fill a random password there and your dummy transaction will be completed if everything else in the code is fine.
You need to go to your paypal developer account and then find the mock menu and then select credit card generator
Generate a credit card based on your county
Now try to add a new card on the Paypal page where you are getting error.
Enter the details of the mock card
Then again try to do that payment.
You may be asked to enter a password. Just click on the new-user/forgot password link.
Everything will work fine
I faced this similar issue while integrating Paypal with my app. What I did found that Paypal integration for sandbox account does have an issue while payment if the currency used, is other than USD.
Yes, other solution may work if you want to generate a fake credit card and add it to the Paypal page.
But if you don't want to add any other credit card to the Paypal account and use it for testing purposes, what you can do is to change the country of both business and personal accounts to USA & currency to USD, also set the app to accept the payment in USD.
It will work fine.

PayPal REST SDK - how to validate credit card accounts

I was able to implement credit card payments on my website. Now my problem is how do I identify if the credit card account is fake or a fraud. What I am doing is I store the credit card info using the vault api then I get those stored accounts for the user to choose what card they will use to purchase my product. However, i can't find a way to add some more validation on how to check if the user is the real user of that credit card account. Right now I can enter any credit card number by just using a card number generator and it directly submits the payment. I can see in my sandbox merchant account that the payment was successful.
So is there a way for me to prevent this?
Thanks to those who could help.
Processing a zero value payment authorization request is the most common way to authenticate the card details are valid without actually taking payment.

PayPal sandbox which credit card to use?

I am using the sandbox url for accepting test payment through paypal.
When a user clicks a button he is redirected to paypal sandbox site. On the paypal sandbox site the user is presented with an option to pay using credit card. However when I try test credit card 4111-1111-1111-1111 it gives me the following error "The card you entered cannot be used for this payment. Please enter a different debit or credit card number."
I am not sure what am I missing?
The numbers provided in the documentation are used so much that the sandbox servers just don't accept them anymore. They really need to update the docs.
I would recommend generating fresh credit card numbers to use. I always use this site for that. The numbers it generates will work fine in the sandbox.

paypal website standard for subscription, cancelling subscription

Please help me with my requirement to implement using paypal.
My requirement is this :
The user can subscribe to a service, using paypal account or credit card ( without paypal account ) . The user can unsubscribe later if he/she wishes to .
I implemented the first part using Subscription button of "website standard" where paypal gave me a button and upon clicking it will lead to paypal website.
I am getting the notifications using IPN
Now there are two problems:
How to test credit card, I could test paypal account payment using the sandbox test users, but for the credit card, I dont have dummy credit cards. If I use the credit cards of the paypal accounts, it says "paypal users should use paypal to pay "
I want to cancel the subscription. The paypal user can go to the paypal account and cancel the subscription. That works fine. But how can we cancel the subscription from my website, or how can we cancel the subscription of the creditcard payer. The paypal SDK says the subscription profile ID is invalid.
Did anyone tried this kind of implementation.
Any help would do, be it links or places to search .
Thanks a lot
First, Guest Checkout (paying with a credit card without signing into PayPal) is only available without recurring payments. When using recurring payments it will force the person to create a PayPal account. You would need to use Payments Pro in order to do recurring payments directly with credit cards, and then the person would never even be redirected over to PayPal at all.
For test cards, any old expired card you have would work, or what you can do is login to your PayPal sandbox account, go into the profile, and go through the process to add a new credit card to the account. It will actually fill in a card number for you, but DO NOT add this card to the account. Just copy that card number and then cancel out of this screen. Now you can use that card number for testing on the PayPal system.
In order to refund using the API you'll need to create the profiles using the CreateRecurringPaymentsProfile API. The profile ID that gives you will be compatible with all API calls to manage it in the future.

Does PayPal always return a payer_id?

I understand that when the customer logs into PayPal and uses their PayPal account, PayPal will send us the customer’s payer_id. But what happens if the customer does not log into PayPal and just uses a credit card to process the payment? Does PayPal still supply a payer_id in that case? And is there any way to fake that in the Sandbox? Does PayPal supply test credit card numbers? One for Success, and others for various types of failure?
(This is PayPal Website Payments Standard.)
The answer I received from the PayPal developer forums was:
A payer_id is returned whether the
buyer pays with a PayPal account or
uses their credit card without logging
into an account.
You can generate test card number in
the sandbox by following the steps
below:
First login to your buyer sandbox
account and generate a test credit
card by following the steps below:
Click on Profile
Click on Credit card
Click on Add
Select the card type (currently, the
sandbox will generate test visa card
numbers)
Copy the card here and click on cancel
** Don't add the card to your account**
Now use this test card number, any
expiration date in the future, 000 for
the CVV2 number, any address in a
valid format and any name to test
again.
These test cards will result in a
success. For website payments
standard, to simulate failure with a
test card number, you can enter any
random 16 digits for the card number.
However, with website payments
standard, if a transaction fails, no
response is sent to the merchant.
Thanks.