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.
Related
I have an issue with our PayPal checkout system that we can't seem to figure out. Here is the problem.
Let me setup the scenario properly:
User A = Office Manager of 3 realtors
User B = A realtor at that office
User C = Another realtor at the same office
User A is in charge of purchasing the upgrades to all of the realtors in this particular office (Users B &C).
In our system User A would have to login to their account click to the appropriate cart and checkout. This takes them to a PayPal checkout. They sign in and confirm their purchase. This is a subscription that last for X days.
Now, that user logs out and logs in with User B (because they are the office manager) account and goes to the checkout. They login with the same PayPal account they had used previously to purchase upgrade on User A. They confirm the purchase.
So, lets reflect on what we have thus far. User A has logged in with PayPal account 1 and purchased two separate subscriptions from our service. Each having their own unique credentials.
Let’s move on,
User A now logs into User C account and repeats the steps checking out with the same PayPal account, again.
All is good up to this point because no one has cancelled their subscription payment. Now this is where it gets a little tricky.
User B tells the office manager they no longer want their account to be upgraded and ask the manager to handle it. User A (the manager) logs into that PayPal account used to purchase all of the subscriptions within that office and cancels User B subscription.
Now that this action has taken place this is where we are running into issues. Because all of the subscriptions were purchased under this one account when the time of renewal comes the IPN notice we receive is not individually identifying the purchases. It is basically saying that a payment was made on the account (because User A and User C) still have active subscriptions. So on our end the system thinks User B is still active and they get a “free” upgrade that should have cancelled.
I hope I explained this well enough. Maybe it’s a simple adjustment we need to make so that the information received from PayPal allows us to identify properly between the 3 payments and keep active only the accounts that have made a renewal payment.
Thanks!
In short, you should be paying attention to the subscription ID (subscr_id) that comes back in each IPN — that will uniquely identify each subscription.
When each user creates their subscriptions, you should be getting an IPN with txn_type set to subscr_signup, and a subscription ID in subscr_id.
Each time a subscription payment is processed, you should be getting an IPN with txn_type set to subscr_payment, and the relevant subscription ID in subscr_id.
When user B cancels, you'll get an IPN with txn_type set to subscr_cancel, letting you know that they cancelled their subscription. (The subscription ID will be in subscr_id.)
When the term of user B's subscription expires, you'll get an IPN with txn_type set to subscr_eot (and again, the subscription ID in subscr_id). Once you get this IPN, you can deactivate the upgrade on this user's account.
So, if you keep track of each subscription ID and which user it belongs to, it should be pretty easy to figure out who's paying and who isn't.
the problem we are facing in this case is that when we cancel one account then the other account also become canceled in this case.We have seted as you mentioned.Payment has been done from the same paypal account for all those users.
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 recurring payment solution set up via PayPal's IPN service, basically the user fills in a form, pays the money and via IPN my system gets a ping to grand the user access to the system.
Everything technically works fine, but occasionally on the last day of a user's cycle they forget that it is a recurring payment and complete the form again. PayPal doesn't seem to mind this and creates a second recurring payment profile.
Currently I go in, refund the money and cancel this new payment profile, but obviously this isn't ideal - is there any way I can configure PayPal to not accept new profiles from people with currently active profiles? Or will I need to catch this at my website's end and do some form of lookup before allowing the payment?
Paypal did not recognize the a transaction is a duplicate one, It tackles the transaction as a new transaction. You will have to tackle it from your system.
When implementing payment gateways, It is good approach to save the billing with a status pending or something in your system before sending to payment gateway.
Also in the form user is filling you can implement a field to uniquely identify the user like his email address and you can also save the expiry or second recurring date against the user unique field in your system. Now when the user enter the same unique field and want to submit a form again you can validate that the same user is paying again but its expiry of second billing date is not yet reached, so prompt and restrict him for paying again.
Hope it will help you.
So I've been using paypal recurring payments for about a year now, and for the most part it works well (with IPN verification after payment goes through, etc...)
One issue I have run into is sometimes my customers will set up multiple payment profiles, which I definitely don't want them to do. Then I have to go in + refund payments and cancel additional profiles.
I was curious if anyone had any suggestions to prevent users from doing this, or WHERE I should prevent this from occurring.
After the IPN notification hits my server, users can't purchase again, but sometimes this can take 30 seconds, or an hour. So then my user goes back in thinking it didn't go through and purchases again.
My process is pretty much this:
Page 1 (user selects options)
Paypal API: SetExpressCheckout
Page 2 (user goes to paypal, logs in, accepts agreement)
Page 3 (I create the agreement)
Paypal API: GetExpressCheckoutDetails
Paypal API: CreateRecurringPaymentsProfile
I would think somewhere on Page 3 I should do a check, but I'm not 100% sure HOW I should go about it. Simply make an association w/PayerID they they tried to purchase something here then prevent it ongoing?
What do people recommend?
Thanks!
After creating the first recurring payment profile, in the response you will get a profile id and a profile status which should be 'ActiveProfile'. I would recommend that you save it, and do a check before he selects any subscription(or product) again on Page 1.
I have integrated standard paypal with one of sites and it works as follows: user selects which subscription to buy, he is redirected to paypal, paypal sends IPN response, I process it and then every X days PayPal sends a new IPN notifying site that user has been successfully charged for new subscription iteration. Now the problem is that user needs to have paypal account to sign up for such subscription.
The customer contacted PayPal and found out that it is possible to avoid having user to use their PayPal account to buy subscription when seller uses paypal pro account. Is it really so? Will I be able to gather user's card info, then send some request to PayPal API and have the subscription created. If yes, what will happen next? PayPal will be sending me IPN requests every X days notifying site that the card has been successfully charged?
Also, what is the general flow? Do I always have to gather card info and send it to paypal api or can I redirect user to paypal in a similar way as standard paypal functions?
Yes, this is possible. You would need to sign up for PayPal Website Payments Pro and Direct Payment Recurring Payments. You can then use the CreateRecurringPaymentsProfile API and specify the card details directly in a single API call.
This will create a recurring profile, which is billed every X days / months, depending on what you specified as the billing period in CreateRecurringPaymentsProfile.
Alternatively, you can also sign up for PayPal Premium Services (for the UK) or PayPal Enhanced Recurring Payments (for the US). This allows you to accept subscription payments from guest users, using the exact same integration you have at the moment, except a 'guest payment' section will be added to the PayPal checkout screen, so buyers won't be forced to create a PayPal account to sign up for your subscriptions any longer.
(Note: Enhanced Recurring Payments / Premium Services has other benefits as well, such as Installment Plans, but guest subscription payments is definitely the biggest benefit).