I'm currently implementing an Automation system for software selling through Paypal API. I have got the IPN portal working so it recieves IPN Messages from Paypal and is passed to a back-end service which files it in a SQL DB, Generates a license yadda yadda yadda. It also checks against an internal entry to confirm the payment recieved matches the actual price of the product purchased (Stopping them sneaky hackers). I have now got to a stumbling block where i would like to reject payments that are the incorrect price and i've trawled the Paypal API Developer documentation and can't seem to find what i'm after. My guess is making a call to the Adaptive or merchant API URLs but I cant find what info past auth credentials i'd need to send. Can anyone point me to the right page or 3rd party website with the information I can use to get this setup? an NVP solution would be preferred.
You can't really reject a payment at that point because the transaction has already been completed. All you can do is refund it, which you can do via the RefundTransaction API within your IPN script. This way you'll also get your PayPal fee refunded.
You've already got your logic in place to check if the prices match, so just add a call to RefundTransaction if the price does not match. You may also want to send an email notification to the buyer in such cases letting them know something was wrong with the pricing on their order so it's been refunded, and maybe even provide a checkout button for them to re-buy at the correct price if you want to.
Related
Is that possible to charge paypal customer manually. I can do it like user get redirected to paypal to confirm all the details but i do need that user allow my system to charge him every month without any confirmations from his side.
Currently i'm using the same approach as listed Paypal .Net Sdk example
But it doesn't have such a func to manually charge a user. If someone could chare links it'd be grateful.
Thanks in advance.
without any confirmations from his side.
That would require having a billing agreement on file. There are some reference transactions or "future payments" API solutions that use this, but the feature requires business approval from PayPal.
An alternative that does require confirmation from the buyer would be to send them a PayPal invoice, manually via https://www.paypal.com/invoice/create or programmatically via the Invoices API
I have a C# MVC (using Umbraco) site that I need to submit a payment through paypal. I have setup a sandbox merchant and buyer account. I am able to submit the payment and everything is working well there. However, my site needs to know when the payment has completed successfully as I will send an email and do some database operations, and here is where I'm having the problem. I cannot get paypal to auto return to my site. I need the return URL to be:
http://localhost:56733/payment-confirmation
This is not a duplicate of this question:
Setting PayPal return URL and making it auto return?
I am using C#, not PHP. Also, I am trying to run this locally. The solutions listed on the above question DO NOT WORK. The behavior and results are the same.
I do get the screen that shows the following:
You just completed your payment. XXXX, you just completed your payment. Your transaction ID for this payment is: XXXXXXXXXXXXX.
We'll send a confirmation email to XX#XXXX.com. This transaction will appear on your statement as PAYPAL.
Go to PayPal account overview
It is not recommended to handle post-payment processing on any return URL. Even with Auto-Return enabled there is no guarantee the user will make it there, and if they don't, that code will never run and you'll end up with tasks not getting completed like you expect.
Even if you're using Express Checkout API's so that you are guaranteed to end up on your own site, it's still not wise to handle all your data updates and email stuff there because the payment could be pending. You wouldn't want to deliver any product or anything like that until the pending payment cleared.
The way to handle all of that correctly is to use Instant Payment Notification (IPN). This will be triggered regardless of whether or not the user makes it back to the return URL, and you'll get multiple IPN's for transactions where the status updates so you can handle those automatically, in real-time as well.
Take a look at the documentation for IPN, but don't let it freak you out just because there's a lot of info there. It's really nothing more than a POST of data to a listener URL that you specify. In that script, you'll receive the data just like you would a form POST. It's really a pretty simple thing to setup, and you can do all sorts of cool things with it.
I've checked out the resources on PayPal's site, but I'm having trouble figuring out how to setup recurring payments from a "create account" form I've created in C#.
My goals is to have a text field called "username" that's disabled and enables when the user processes their payment through Paypal by clicking on a link that opens the payment page in their browser. I want to then save some kind of ID associated with that transaction that my application can look up when the user logs in to make sure they still have an active subscription.
All that being said, I have two questions. One, is there a good walk though for someone who doesn't know much about SOAP or anything of the sort? Possibly geared toward Paypal? Second, does Paypal give some kind of static transaction ID that I can look up via Paypal when the user logs in?
I'm also open to other payment processing methods, but I want to stick with WinForms for a while.
You can use the CreateRecurringPaymentsProfile to create the subscription with PayPal. If you don't like working with SOAP you can use their basic NVP API, which is what that link points to.
When you make that call to create the profile you'll get back a PROFILEID. This profile ID can be passed into GetRecurringPaymentsProfileDetails to check the current status upon login.
Since you're using C# I'd recommend taking a look at this .NET SDK for PayPal. It makes the calls very simple for you.
Ok, I am building a site with MS Webmatrix and ASP.net, c#, javascript.
I want to have my clients enter info, then if I can verify it on my database, go to paypal for payment. So the flow would be
client enters info
validate against the db
go to PayPal for payment.
So I really don't want a pay now button to go directly to paypal. I can easily route the pay now to html that verifies and if failed, displays appropriate msgs and prompts.
If the info verifies, how can I route to PayPal without the user clicking another button?
Is there code that I can put in my script to send to paypal without clicking or programmatically force the click without client intervention?
Also, I would like the ability to recall the clients billing address in the future if a refund is requested so I can mail a check. I prefer to manually mail a check. Can I capture/store a PayPal transaction id, then use the transaction id to request the billing address months later (if needed) so I don't have to store the address in my database?
You can use the WebClient class to make an HTTP request to PayPal and to manage its response.
You want to redirect server sided ? Just use the Web Classes then.
About PayPal: There is a SOAP/XML API, there you can do such stuff like TransactionSearch. Just check https://developer.paypal.com/ or check this: https://cms.paypal.com/cms_content/GB/en_GB/files/developer/PP_API_Reference.pdf
I am using Paypal Express Checkout to make recurring payment and deduct intial amount.
Here are my steps:
I redirect the user to paypal with agreement and get the token
Use this token to deduct initial amount
and then use the same token to create a recurring profile.
This worked well in the sandbox.
Now i need to get an app_id to make it live.
The problem is the paypal reject this saying:
"but i am still seeing the payment as a 'Standard' checkout, rather than a Preapproved Payment. Preapprovals would be used to create a Billing Agreement with your users which can be debited later "
Can you please advice something?
FINDINGS:
While getting token there is no way to show that we are creating recurring profile that might be the reason they rejected it.
But i am using the same code they provide
https://www.x.com/developers/paypal/documentation-tools/paypal-sdk-index
Express Checkout and Recurring Payments does not require an App ID. Those are only required when you're using the Adaptive Payments API. Express Checkout is not part of the Adaptive Payments API. That's what they're telling you...you simply don't need an App ID. If you're passing one in the sandbox it must be getting ignored.
If you have everything working as you want it in the sandbox just change your endpoints and your API credentials to the live values and it'll work for you.