Working with PayPal HERE and PayPal API - c#

I am trying to use the PayPal Here Sideloader (C# web application). I am getting unexpected results where the Application doesn't always return to my web application in Safari (iPad). Also, it opens a new tab every time. So I decided to use IPN to handle processing after the purchase.
But while using PayPal HERE, I noticed that check and cash transactions are not calling my IPN Url. I tried to search transactions using the REST API and I don't even see them. Credit card and Apple pay transactions work fine. So my question is two fold.
After speaking to someone at PayPal who might or might not know what they are talking about said something to the effect of, 'those transactions aren't supported'. I don't necessarily believe that because if I have the Invoice Id (INV2-XXXX-XXXX-XXXX-XXXX) I can use the REST API to get what I need. Was the person correct, or has anyone else done this before?
What if I have my custom Order Id (see image), how can I get the Invoice Id?
(I've looked at the Invoicing API (REST) and TransactionSearch (NVP) and neither of these return information about the transaction.

After feeling like I have searched the ENTIRE internet, I saw that the documentation for the iOS and Andriod SDK mentioned the URL for the PayPal Here API.
That url (for production) is https://www.paypal.com/webapps/hereapi/merchant/v1
I just happen to add '/invoices/' to it and got an authentication error. Once I was able to authenticate, I see that this returns a list of all 'invoices' processed in PayPal Here. You'll need to connect using OAuth2, but the list is what I needed to filter based on order ID.

Related

Sending customers to a PayPal payment page with a webhook? C#

I'm a bit confused with the PayPal (REST) integration.
What I want is the following:
My customers on my website see a order-summary, they then click on
'go to payment page'. I only need to set the Currency, Amount and Description.
They arrive on a PayPal page where they choose to signin/as guest, and choose creditcard/paypal account to pay, fill in all the data etc.
I get notified by using a webhook that they actually paid, and process the payment internally.(Receiving an email about the status won't let me automate.)
Somehow all the examples I see are about sending complete payments through paypal, and not just 'setting up a payment page'. Is this even possible?
Thanks!
I hope this helps clarify:
There are 2 types of payments/funding :
credit_card
paypal
If by "payment page" you mean collecting payment info (credit card) on your website and sending it to a "gateway" for processing, then that's the credit_card flow option. There are account requirements for that (and PCI compliance).
The flow you describe above is the paypal flow. Your customers go to Paypal, select whatever payment instrument they have/choose (credit card, bank account, etc.) and then "approve" your request for a transaction.
When they "approve" - don't confuse this with payment, they are merely saying "yes, I want to pay this merchant using my Paypal account/funds", they are redirected back to your web site/application (to complete/finish things). At which point you will perform the necessary steps to "complete" the transaction request (e.g. send an execute, authorizeand capture request - depending on what you want).
So excute and capture (of an authorization) are the actual acts of "obtaining the actual payment so you get paid". You will get some result in the response to these requests at this stage for you to determine things.
If you've used the Classic API, this maps to Express Checkout. I'd map webhook to IPN (optional messaging/event tracking, and really isn't part of your payment/checkout flow).
Hth...
Update:
I'd really suggest that you take a look at the SDK (.Net). It's very well maintained and Paypal dev support is awesome. The samples will really get you going quickly.
Recently I've taken a project which involves PayPal integration. It was a complete disaster for me. The struggle was tough on me for few days until I found the answer above AND after looking into the "Update" link, noticed they suggest to actually use a different NuGet.
So, this repository and quick start guideline was the cure to my pain with Paypal: https://github.com/paypal/Checkout-NET-SDK

Require Paypal Subscription to Create an Account - ASP.Net / MVC4 / C# / Razor

I am new to Entity Framework, MVC and Razor but am almost finished with my first project using it.
The final piece of the puzzle is to tweak the "canned" Log-in / Registration piece that comes by default when setting up an MVC project. I need to integrate with Paypal in order to create a monthly subscription. If payment is up-to-date then their account will then allow them to access all the benefits my site has to (hopefully) offer.
I signed up with developer.paypal.com and think I have a good start as far as creating test accounts. I just need to get the code in place.
Is there any sample code that already tackles this? I read through the API doc but
Is there any best practices that relate to what I want to accomplish? For example, should someone pay first, then create an account or vice versa? Should I have to implement managing their subscription cancellation or do they have to do it within their account? etc...
How can I tell if a user is current with their subscription and they didn't cancel.
How can I tie a user to their Paypal transaction?
Any help would be much appreciated. Thanks in advance!
PayPal has Standard Subscriptions and then they have the Recurring Payments API, or what can sometimes be seen as Recurring Billing. I would definitely recommend going with the API's as it will give you much more freedom to do everything you're wanting.
If you're talking about PayPal payments (where people sign in to pay) I'd go with Express Checkout, which consists if SetExpressCheckout, GetExpressCheckoutDetails, and then DoExpressCheckoutPayment and/or CreateRecurringPaymentsProfile depending on what you're doing. In your case it sounds like you'll be doing CRPP because you're working with subscriptions.
That will return a profile ID which you can save locally in your user table(s). Then, when people login you can make a call to GetRecurringPaymentsProfileDetails to lookup the current status of the profile, and then redirect the user to different places depending on the status.
PayPal's .NET SDK should make all of those calls easy on you, but it's really just a matter of building NVP requests and sending them to PayPal via HTTP POST.
If you want to do all of that with credit cards directly then the process is the same, but there are different API calls involved, and depending on the version of PayPal account you have the calls would be different.
If you're using Website Payments Pro 3.0 then you would use the DoDirectPayment platform, which in the case of recurring payments you would just make a single call to CreateRecurringPaymentsProfile and include the credit card details in that request.
If you're on Payments Pro 2.0 that would use the PayFlow API, and that's where it's called Recurring Billing, so you'd just have to setup a PayFlow request accordingly.

Paypal C# class for returning all transactions from Paypal

Is there a way by which i can fetch the transaction history of my Paypal account into my application without having to log in to Paypal and checking it manually?
You can probably accomplish what you want using the TransactionSearch method in the PayPal Merchant API, but it's probably not going to be a trivial undertaking.
Check out https://devtools-paypal.com/apiexplorer/PayPalAPIs and click on the "Merchant" tab to view the Merchant API methods. TransactionSearch is the fifth item on the list. They have an environment right on that page that you can play around with.
More info on TransactionSearch is available at: https://www.paypalobjects.com/IntegrationCenter/ic_transaction-search-and-details.html.
Then of course, you'll have to write the code to make the API calls and organize and display the data on your end.
Hope this helps!

Programmatically purchase from a website in C# or javascript

Hey guys, I'm trying to create a website that can help a user purchase items from other websites. What would be the best way to go about doing this?
I know most of the sites I'm using are sending their information using FORM:POST, but I'm having trouble finding the exact POST packet in fiddler (I'm assuming it's encrypted?), and know that a lot of the sites are using login credentials, so that complicates things a bit.
Is there any way I could use webkit or something to handle all the http stuff, and just pass javascript to fill in the forms? Or is there an even simpler way to create proper POST packets and use a WebRequest?
Thank you!
1) get permission
2) use their published API
If the sites do not have an API and allow you to use their server process, copy their forms to your site and use post. You can post from your server with credentials using for example CURL
Usually shopping cart and credit-card transaction use SSL and you have to login in the site. So I think it's not so simple to bridge with a javascript or a simple webrequest.
There's not a statndard-simple-way way to do this!
You're heading for a world of hurt.
First, you should check if what you're trying to do is legal. Does the web site allow "proxy orders"? Or are they forbidden by their EULA?
Second, you'll have to handle the user's confidential data (username, password, credit card number), and especially credit card numbers are calling for troubles.
Third, how are you planning to implement payment methods like PayPal? You're going to collect the user's PayPal credentials in order to make payments on their behalf? (See point number two if answer is yes.)
Fourth, since you have to fake HTTP requests, as soon as the web site changes a single field, your tool will break, how are you planning to handle this?
Or you're trying to automate only the first steps of the orders and not the payment?

Login to online accounts

First time poster. Back to programming after being away for a few years, trying to clean off the rust. I'm creating a dashboard that will run initially on my laptop (Macbook Pro, 10.4.x O/S). Amongst other things I want it to retrieve latest information from my online accounts. I'm starting with html, but will probably migrate to something else (TBD, possibly ruby or c#). What would sample code look like for logging into account, going through specific account workflow, retrieve data/docs/other, and pull it back to be stored locally.
It is a little open-ended, apologies and thanks in advance.
Are you looking for something like Google Gears?
It depends on the kind of accounts you want to log onto.
For instance there is a Google has an specific API for that Google Accounts API, other services provide similar API's some other do not.
So it depends pretty much what are your "online accounts" all about and if they do provide a public API or not.
EDIT
As per your comment and for the products you've mentioned, I'll suggest your to start looking at browsers plugin development and to start understanding the HTTP protocol and all the related technologies around it ( HTTPS, encryption, authentication etc. )
The public API let you easily login into an account, but you don't really need one to do it ( although it make life much more simpler ) If you do not have a public API, you can still login into any account by "simply" doing what the browser does. Sending an HTTP(s) request with the appropriate security mechanism and following the protocol.
If you know how does the browser send the request and you have the user trusting your their passwords, the only remaining thing you have to do is ... :) code it.
As of now the question is too broad to be answered. Pick one service at a time and ask specific questions about it.
I would suggest you to start with the previously mentioned "Google Accounts" API and learn from there.
One open source product that already manages google account authentication is "Ubiquity" you can take a peak at their source code and start understanding how do they fetch the user contact list.

Categories

Resources