Paypal API get payment confirmation - paypal

I am able to post payment data to the Paypal REST API, and I get a response.
However, I ran some tests and entered incorrect expire dates and invorrect CVV2 numbers, but the response I get from the API is that the credit card has been approved.
From searching around, I understand that I should use the IPN to get a confirmation of the payment. I setup the IPN listener, and when I use the simulator to test, everything seems to be working.
My question is, how to I trigger the IPN callback on the payment? Or what would be the correct method to fully test the credit card details?
Any suggestions would be greatly appreciated! TIA!

Yes, in live env., it will return the same failed response than a wrong card number.

Related

PayPal Subscription Failed Payment Webhook flow

i was wondering what webhook is sent when a subscription payment fails?. I wish to downgrade a user on my website if a payment isn't made/fails. but im unsure if the 'Billing.Subscription.Cancelled or Billing.Subscription.Suspended is sent.' I have the "max_fail_attempts": "1".
Thanks
Paypal apis & documents are suck. you can check this link
https://www.paypal-community.com/t5/Webhooks-REST-APIs/regarding-webhook-of-billing-agreement/td-p/1450631
I never see this callback sent, now i give up these webhooks and try IPN instead, hope it works.
there is another link maybe help, in 2015 guys said webhooks supports for recurring payment is in progress, I think it still in progress now.
https://github.com/paypal/PayPal-PHP-SDK/issues/242

Buy with pay now vs pay with subscription on IPN paypal

I'm having problem with payment on subscription IPN paypal.
If I set cmd is '_xclick-subscriptions', after payment, I saw IPN response to update my db is very slow.
But if I set cmd is '_xclick', after paypmen, I saw IPN response to update my db is very quickly, seems immediate...
Does anyone know about this problem. Could you help me??
Thanks you so much!
If you rely on time then you need to use Express Checkout for subscriptions.
This is because you won't need to wait for an IPN notification to update your database, instead you will get the answer from paypal right away in an API call.
In your case you will need the credentials of the person who will receive the money, not the person who is going to subscribe. You need the follow the process described here: developer.paypal.com/docs/classic/express-checkout/
Here you can see some diagrams: here

PayPal Hosted Pro Direct Payment

someone can help. I using PayPals Rest API to make a direct payment. I have a Pro account. The response, I get back from paypal after the autho process, has a status. PayPals documentation says there are 5 different statues that can be returned. (created; approved; failed; canceled; expired ). So my question is, if the status is pending, how can i know if at a latter date the payment has been successful or declined. There is no mention in the documentation to use an IPN. I cant find any documentation on these statues. Any help would really be appreciated.
You could use the Look up a payment resource call to get details about payments that have not completed, such as payments that are created and approved, or if a payment has failed.

Issues with processing PayPal Payment

We are using the secure token method to process credit card payments with PayPal hosted pages. We generate the secure token by providing the required information
[TRXTYPE=S, AMT=xxx, TENDER=C, ORDERID=xxxxxxxxxxxx, CURRENCY=USD, CREATESECURETOKEN=Y, SECURETOKENID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, PARTNER=Paypal, VENDOR=xxxxxx, USER=xxxxxx, PWD=xxxxxx]
We get the success result as follows:
{"RESULT"=>"0", "SECURETOKEN"=>"xxxxxxxxxxxxxxxxxxxxxxxxx", "SECURETOKENID"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "RESPMSG"=>"Approved"}
We then send this back to PayPal where the user can choose to pay with credit card and or PayPal.
When someone pays with credit card, all is fine, when someone chooses to pay using "PayPal" it asks user for PayPal credentials and once provided it shows another screen to accept the charges. Once the user accepts, we get the following error message:
{"TYPE":"S","RESPMSG":"Original transaction ID not found: xxxxxxxxxxxx","TAX":"0.00","PNREF":"xxxxxxxxxxxx","TENDER":"P","AVSDATA":"XXN","METHOD":"P","SECURETOKEN":"xxxxxxxxxxxxxxxxxxxxxxxxx","AMT":"1.00","SECURETOKENID":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","TRANSTIME":"2014-01-02 06:09:02","ORDERID":"xxxxxxxx36U1","RESULT":"19","DUPLICATE":"2","TRXTYPE":"S","action":"create","controller":"payment_notifications"}
The help I got from PayPal folks says "Looking at the logs it seems like the transaction was declined with the result code 19 which means that the transaction ID you entered for this transaction is not valid. When searched for the original transaction, I could not find any. So, it seems like the original transaction is not valid. Provide an valid original transaction ID and it should go through fine."
However nowhere in their documentation do they suggest to send this "transaction ID" variable and without it we have been processing Credit Card payments just fine.
My question:
What do i need to change in my process that I can accept Credit Card and PayPal payments?
Any help will be greatly appreciated.
It seems the issue was on PayPal side and they have yet to come back to us with an answer. Once thing which they do not openly advertise is that they have the ability to remove the Pay with PayPal button form the hosted pages so if someone else runs across the same issue they should ask PayPal to remove the Pay with PayPal button from their end, made sure to confirm that you are not disabling the service from express checkout just hiding the button.

Does Paypal sends the phone number of the user/payer in response, if yes then how can i get it?

I am making a simple paypal checkout and getting the response from the paypal after transaction in POST method to my return url. The response include everything I want but the phone/contact number.
I wanted to confirm if paypal does or doesn't share the contact/phone number and if it doesn't, can i have some official paypal link saying that
You need to login to your PayPal profile and enable "Require Phone Number". It's under profile->Website Payment Preferences->Contact Telephone Number
Once you've got that setup it'll come back in the contact_phone phone parameter with IPN or PDT.