integrate paypal payment with unity - c#

i want to add Paypal payment through unity without direct the users to the web browser at all.
https://devtools-paypal.com/guide/pay_paypal/dotnet?interactive=OFF&env=sandbox
I looked at this tutorial but at step 3 the user is asked to go through the web browser to log in,
There is any way do the log in process directly with .net / c# code through unity
thank you

As far as I know this is only possible by including a browser (cause security reasons). C# has a WebBrowser class, which you could modify, so the user thinks it's in the game.
An other thing you can try is a http request via c# where you pass the username and the password to the website (but I don't know if this is possible with paypal).

Related

Could I sign into embedded PowerApp via Microsoft LiveID Account "quietly"?

I have a web app wrapper for my PowerApps app (I have embedded it as an iframe on the home page of my ASP.NET Core app).
I also have the credentials of the Azure organization that developed this application and has access to it.
So, for the first time, my built-in app asks for an email and password to sign in to a Microsoft account. And only after a successful login, I can work with it directly.
But that's not what I want.
I expect to be able to work with the application when I load this page.
So, is there a way to use the app directly without signing in to a Microsoft account?
I got the idea to make a request to the Azure AD API and get a bearer token or cookie from there, and then save it to the client, supposedly filling out a login form and clicking the login button, but "quietly".
To be honest, I don't know how I can do this. I've spent hours researching this problem, but haven't found a suitable solution.
Could you help me?
Thank you in advance!
Use ROPC flow, you just need to send a http request, then get the response.
There will be no pop-ups requiring you to log in.
Tips:
Http Request
Http Response
Related Posts:
Is there a way to improve the performance of MSAL-browser js login?

Creating a .NET website that supports Facebook, Twitter, Google+ OAuth Logins

I'd like to implement OAuth functionality to allow users of an application i'm building to login via Facebook, Twitter, and possibly Google plus. Every post I've found thus far seems to suggest starting from scratch, creating an MVC 4 'Internet Application' project.
What are the relevant references, code snippets, plugins etc which are required to implement this functionality?
I'm currently using Forms authorization.
Once you have set up Forms Authentication MVC 4 has built in support for users to authenticate themselves with OpenID and OAuth using an open source project called DotNetOpenAuth, it is a very similar system to forms authentication using cookies and redirects.
These services just need to be configured and this takes place during application start-up. Inside the Application_Start() event there is a call AuthConfig.RegisterAuth(), which contains just commented out code to the third party services.
Before you can use these services you need to register your application with most of them. When you register with a third party you will usually be assigned an appId and an appSecret. You need to insert these values into the code where you register with them as a client.
Google is the one provider commented out who doesn’t require any registration so you can just uncomment the line. OAuthWebSecurity.RegisterGoogleClient(); in the AuthConfig.cs file.
When you rebuild the application and go to the login page you will see on the right there is now a Google button you can press to login through the Google service. This button will re-direct the user to Google where they can sign in with their Google account. Once they have signed in Google will ask the user if they happy for your application to have their e-mail address. The user must answer yes, if they decline this they won’t get logged into your application.
Google will then re-direct back to your application sending some cryptographically sealed and signed parameters so OpenAuth can verify that Google did actually authenticate the user. Once the user is successfully authenticated and logged in, they can create an account by clicking the register button they will be presented with.
There is a link in the comments at the top of the AuthConfig.cs file, which goes to a page telling you how to register with the other third party services.
http://go.microsoft.com/fwlink/?LinkID=252166
Regarding your request to do this "without creating an internet application"....
"Internet application" is a type of project that tells Visual Studio what you're using it for. It's not required by any .NET standard, but if you're using Visual Studio then it's a step you need to take. Otherwise VS doesn't know if it should help you build a WinForms app, a Console app, WPF, etc...
The other project type you could use would be a WebSite, however if you intend on leveraging .NET than an Internet Application is a the better choice--it assumes your building a website that will be running .NET code.
Others have mentioned using DotNetOpenAuth to get your site running; I fully support that, but also wanted to mention the Social Bootstrap API project. It achieves a similar result, but does so using ServiceStack.NET. There's a very good chance you won't want to use it, but it's always good to evaluate alternative options--they can help show you the pros/cons of each other.

Winforms SagePay integration [duplicate]

I’ve been asked to integrate a windows form application with SagePay to take payments directly from the application. The SagePay documentation talks about ASP.NET so I’m not sure whether this is possible. Has anyone integrated a WinForm application with SagePay before? Is it possible?
I know some payment processors have a connection option where the payment part is hosted on a form on their server. You could try embedding a web browser control into your app to display the payment page.
Usually there is another type of connection option where you can send your information via HttpWebRequest, but I'm not sure that this would work as it requires SSL. Since you are running your app as a desktop client, I'm not sure what you would have available.
I am not sure this is possible given that sagepay needs to redirect users to Mastercard securecode or Verified by Visa, I think they would need to redirect to the bank which then redirects back to a supplied URL. I would think this needs to be within a browser environment.
You can post to urls and get back a response via .net objects and parse the results to display on a form.
You can also ask SagePay to create a Vendor account with 3d secure switched off. This allows you to take payments in house in your winforms app without the customers password however most card vendors if you bypass 3d secure will not protect you if someone calls and uses a card fraudulently.
However it can definitely be done.
You can normally post to secure servers from non secure pages so again this isn't usually an issue.

Connect to facebook and working with api

Is there any good tutorial how to make simple console facebook appplication which connect to facebook and get list of friends, user photos, status or something. I look at facebook examples of facebook SDK but if i want to authorize on facebook i must execute FacebookService.ConnectToFacebook method which show login window. But i want show my own login window. Or just store login and password in sql server and time to time get some information about users. Is it real?
Check out the tutorial and examples here.
It should have all the functions that you need and is fairly easy to implement. Trust me, you'll spend hours going elsewhere to figure it out.
As for custom login windows I recommend that you don't do that. People trust Facebook and don't want to give you their personal info, that's actually a part of your agreement with Facebook.
What you can do however is ask for offline access permission and store the token for future use. This way if you know who the user is on your end then you can make calls to the API without having to log them into Facebook again.
Facebook requires that users login with them and Facebook will send you back a token which you can use. This is prevent applications "stealing" usernames & passwords, which you could do with your login dialog and also allows users to stop applications in future from accessing their account even if they have logged in previously.
No way round that unfortunately, unless you going to build something that doesn't use the API - for example, a tool which loads a browser in a background, and automates the login as if the user did it. That would lead to pain and suffering though.

How do I create a .NET Web Service that Posts items to a users Facebook Wall?

I'm currently toying around with the Clarity .NET Facebook API but am finding certain situations with authentication to be kind of limiting. I keep going through the tutorials but always end up hitting a brick wall with what I want to do. Perhaps I just cannot do it?
I want to make a Web Service that takes in the require credentials (APIKey, SecretKey, UsersId (or Session Key?) and whatever else I would need), and then do various tasks: Post to users wall, add events etc.
The problem I am having is this: The current documentation, examples and support provide a way to do this within the context of a Web site. Within this context, the required "connect" popup can be initiated and allow the user to authenticate and and connect the application. From that point on the Web can go on with its business to do what it needs to do.
If I close the browser and come back to the page, I have to push the connect button again. Except this time, since I was already logged into facebook, I don't have to go through the whole connection process.
But still ... How do applications like Tweetdeck get around this? They seemingly have you connect once, when you install their application, and you don't have to do it again. I would assume that this same idea would have to applied towards making a web service because: You don't know what context the user is in when making the Web service call. The web service methods being called could be coming from a Windows Form app, or code behind in a workflow.
I would advise you to try Steve's blog and starter kit
you can also find a reference to his post in this so question
Good luck
Edited/Added below
You cannot store the facebook login credentials for users and pass them to FB.
(terms & conditions)
but you can use: offline_access, to access some usage without flagging the user as logged in.
Cool tip from this forum:
Use the following URL with your API Key
http://www.facebook.com/login.php?api_key=YOURAPIKEY&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=offline_access
Register for the Facebook Developer
App on your facebook profile.
Create a new app Web App(By default)
through your "Facebook Developer
App". Change the Application Type to
"Desktop App". Note down the API Key
& Secret Key for you app.
Authorize the app & authenticate the user and
then get the permanent session_key.
Authentication
For a fully logged in session, you are asked to use (again terms and conditions) login.php and you can login via JavaScript
HTH
Ric

Categories

Resources