I have a website (in development) which is using paypal (sandbox) to accept payments. I've setup a few sandbox users so I can test what happens when payments are send from my country and some foreign countries.
I've noticed that when setting up users with certain foreign countries, after making a payment, the foreign sandbox account gets a message saying "you're payment will arrive in 3-5 days". But the payment happens instantly in the sandbox account.
Why is that, is that just a sandbox thing? What I am asking is, when I go live, and if the user gets such a message, and if it does take 3-5 days for the payment to arrive, will paypal push the payment through to my ipn page as and when the payment happens, i.e. 3-5 days later?
I'm assuming that because I am using the paypal sandbox, they just display the 3-5 day message and push the details to my ipn page straight away?
Any time you get a payment that is pending for any reason you'll get an IPN at that time with a payment_status of Pending. When the status changes you will get another IPN with the updated status.
Related
We are working on finding a solution for a custom PayPal cart install. I'll try to explain what actions are taking place then point out where we are having issues.
Here is the issue that we are facing:
1.) Users of our site can purchase a subscription
2.) That subscription once paid for activates several actions on the user’s account.
3.) Subscriptions last for Xx amount of time.
4.) Each hour our cron page runs and checks for payment received or not.
5.) After Xx amount of time (the subscription length duration) if the payment is verified to have been received the users account automatically renews. If payment is not verified to have been received then the account we return to normal.
6.) We have it operating correctly in the scenario if the payment is made from one PayPal account for a single user subscription.
7.) However, if a user uses one PayPal account to purchase multiple subscriptions (for this example 10) and cancels X amount (for this example 9) of subscriptions from within their PayPal account, none of the accounts get cancelled from within our site. Say a office manager submits payment from one single PayPal account (because they are in charge of 10 users accounts). Then immediately cancels 9 of the subscriptions from within that sign PayPal account and leaves one active account in our current setup it still thinks a payment was received for all 10 of the users because it’s checking the account rather than individual PayPal subscription for payment. (Tricky to explain)
** What I am are trying to figure out is how to have this action record the Payment ID # that is given by PayPal for each individual subscription when a purchase is completed and when the cron page runs it would pair the user’s (our site user) account to their Payment ID # and take action accordingly. So this way if 9 of the payment ids did not receive a renewal payment those accounts would become inactive and the one payment ID subscription that did receive payment would active properly.
I hope that makes sense and I would really appreciate anyone's help on this. Thanks a ton!
You should be using Instant Payment Notification (IPN) to handle automated updates based on actions that occur on the PayPal account including new profiles, payments, failed payments, canceled profiles, etc.
Any time a transaction occurs on your account (payments, profiles, refunds, disputes, etc.) PayPal's server will POST all of the transaction data to a listener script you have sitting on your server. Within your script you can process that data however you need to, and it happens in real-time.
We have a little problem in our system, we allow customers to pay using PayPal which is great!
But in the following situation we have this issue:
A customer pays us using PayPal.
We send the product to our customer when the transaction has completed.
A few days later, PayPal refuses to pay us because the customer have his PayPal account connected with his bank account. And the funds on that bank account is too low.
So, is there a way to let PayPal know us when this happens through API/URL call to our server ?
As Dagon mentioned, IPN is the best way to handle this.
You'll setup a listener script on your server, and every time a transaction happens on your PayPal account, the PayPal server will POST data about that account to your listener script. You'll get different parameters depending on the type of transaction that occurs. You can see a list of the types and parameters here.
You can build your email notifications, database updates, etc. into your IPN script to fully automate post-payment processing tasks.
So, in the example you've provided, what would happen is when the transaction first takes place the IPN would be triggered with a payment_status of Pending, and then you'd also see a parameter called pending_reason with a value of echeck. This tells you the payment was made, but it's an echeck which takes time to clear, so the status again is Pending instead of Completed.
A few days later when that payment does clear (or fails) you'd get another IPN with an updated payment_status. Only upon receiving an actual COMPLETED payment_status would you then would you deliver the order.
Again, this can all be automated within your IPN script.
On my website members can buy a virtual currency. Sometimes when a member buys the virtual currency there is a delay before it shows up in their account. I'm trying to make this delay not occur. The delay is usually from 10-30 minutes with the odd payment taking over an hour to show up.
The process is like this: the member is taken to PayPal to buy the virtual currency. Right after they pay, PayPal sends the payment information to my server. Once my server receives the payment details then the amount of virtual currency purchased shows up in that members account.
The delay is when the server is waiting for PayPal to send the payment information.
Does anyone have an idea of how this could be fixed so there is no delay?
You could use PDT (http://www.paypal.com/PDT), this allows you to receive the payment status when the user returns to your site.
See:
Paypal notify_url and return_url. Receiving variables without IPN using PHP
I have a page on my site which sends out payments to more than 1 person. I've been testing this using the paypal sandbox account with a few test accounts.
I am also using ipn to get feedback from paypal when payments are complete, pending etc.
My question is, paypal sends me back info via ipn for just 1 of the payments. Why is that? When I check the payment amount in the ipn, it only shows me the payment for 1 of the people who got paid. For example:
If I pay person 1 and 2, where each person gets paid $10 each, so a total of $20. The ipn page only shows me the details for person 1 and says that the payment amount was $10, when the total payment amount is $20.
This is causing me a problem because I need to know that both payments were successful via ipn. At the moment I can only check the payment for 1 person at a time, even though I am paying 2 people at the same time.
How do I get payment for both people?
#Pete answer is a violation of the Paypal User Agreement (unless you have a separate legal entity for both accounts)
9. Restricted Activities
9.1 Restricted Activities. In connection with your use of our website, your Account, or the Services, or in the course of your interactions with PayPal, a User or a third party, you will not:
a. Breach this Agreement (including, without limitation, opening multiple PayPal accounts or breaching the Card Processing Agreement, the Acceptable Use Policy or any other agreement that you have entered into with PayPal (including a Policy));
What you are looking for is PayPal Adaptive Payments. A note about this though: one account - probably you as the application owner - must have a PayPal business account. The others that receive a payment only need a personal account.
PayPal provides an SDK with samples for the Adaptive Payments on Github. Select Adaptive Payments from the menu on the left. There are samples for multiple languages that should be able to get you started.
My hunch is that IPN is tied to the individual account, not the payment, and you have the IPN set up from just one of the accounts. I think what you need to do is configure the IPN on both accounts and then process the response from PayPal two times... once from the IPN notification of the first account, and once from the IPN notification of the second account.
I have a subscription plan ie $30 for every month and first month is free. but I am not getting any response from Paypal when somebody subscribes however I get response after one month for the first payment. Paypal does not send any response back if the first month is free ? How can I find out somebody subscribed successfully ?
Are you using standard subscription buttons or Express Checkout with Recurring Payments?
Either way, you'll get IPN's when a new subscription profile is created as well as when each payment comes through. If you're not seeing that I would check your IPN history in your PayPal account to see if you're finding errors there, and also check your web logs to see if you're finding errors there.
I'm guessing that your IPN script is failing for some reason when it gets hit for the new profile IPN's.
The txn_type value would be either subscr_signup or recurring_payment_profile_created depending on which method you're using.