Why is PayPal REST api pay by credit card option showing on desktop, not showing on mobile? - rest

After a lot of digging around I have finally managed to get something working with the PayPal REST API, the documentation is awfully confusing.
I'm creating a C#/MAUI mobile app where I need to take payments.
Anyway, I managed to get the PayPal API it to create this URL, below (I can simulate the same thing using Postman)
https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXXXXX
Get an access token (access_token) using the REST API
POST to https://api-m.sandbox.paypal.com/v2/checkout/orders/ this payload
{
"intent": "CAPTURE",
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"amount": {
"currency_code": "USD",
"value": "100.00"
}
}
]
}
The returned payload gives me this json. There are other kinks in the returned payload but this is the one I need.
{
"href": "https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXX",
"rel": "approve",
"method": "GET"
}
Using that URL, on a desktop PC browser I get the option to log-in or "pay by debit or credit-card" but on mobile browser I only get the option to create an account or log-in to an existing account, using that exact same URL.
Does, anybody know whats going on here? How do I get the same options in a mobile browser. I can't find anything in the documentation that explains this behaviour.

Guest availability in the paypal.com checkout depends on very many factors, including the IP address and geographic location of the buyer, the amount of the transaction, the device used, and any number of other things. Other than disabling guest as a possibility in your account options, you cannot control this behavior of the PayPal page.
A 'Debit or Credit Card' button on your own page can be added using the JS SDK for approval, rather than redirecting away. Here is a demo, which would fetch the created order id/token from your server.

Related

Google Play Developer API purchases.subscriptions doesn't return emailAddress field

I'm integrating with Google Play Developer API (https://developers.google.com/android-publisher). To be more specific I'm trying to get informations about a specific subscription (https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/get).
Well I'm already getting informations about a subscription with the subscriptionId and purchaseToken. The problem is that some fields are not being returned in response. One of these field is emailAddress that importante for my usage context. I'm getting a response like the one shown below.
{
"startTimeMillis": "1631112305355",
"expiryTimeMillis": "1638981894973",
"autoRenewing": true,
"priceCurrencyCode": "BRL",
"priceAmountMicros": "39990000",
"countryCode": "BR",
"developerPayload": "",
"paymentState": 1,
"orderId": "GPA.9999-5849-9341-89139",
"acknowledgementState": 1,
"kind": "androidpublisher#subscriptionPurchase"
}
From the docs about emailAddress we have The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
But what is Subscribe with Google? Isn't Google Play Billing in this category? My purchases are made on an Android mobile app with Play Billing.
Thanks any help.
Subscribe with Google is a completely different thing that Google offers or at least used to offer, these are not normal subscriptions, for normal subs you do not get the users email.
Subscribe with Google lets you buy a subscription, using your Google
account, on participating news sites. Select the publisher offer you’d
like to buy, click “Subscribe,” and you’re done. You’ll automatically
be signed in to the site, and you can pay–securely and privately—with
any credit card you’ve used with Google in the past.
https://blog.google/outreach-initiatives/google-news-initiative/introducing-subscribe-google/

I want to validate if given email address is exists in paypal? I need to verify if the paypal email they provided me exists or not?

I want to give payments to my customers, for that purpose I am getting their email, I want to verify is that email address exists in paypal or not!
I searched and found payment identity API which I tried but that only provides me my data! Here is the LINK of that API.
I have also found Adaptive payment get verified status API but it is depreciated. Here is its Link.
Also found this link https://www.paypal.com/us/verified/pal=emailaddress to verify, but it doesn't work also! I got it from paypal Community Question.
Anyone here who can help me out this issue! Or if any one can help me in Connect With Paypal I am stuck on 6th step! This would also be used!
This is generally an unnecessary thing to implement.
But if you really must have this feature, you can indeed use Connect with PayPal, formerly known as Log in with PayPal).
Your question mentions being stuck but does not provide any technical detail about your problem or what you have tried so far.
If you have the paypal user's email address, you could check if there is a Paypal avatar associated with it, if not, it's not a valid paypal email account.
With the AvatarAPI service, using the "Paypal" provider, you send a HTTP post to https://avatarapi.com/v2/api.aspx request of
{
"username" : "##username##",
"password" : "###password##",
"email" : "#PAYPAL-EMAIL-ADDRESS##",
"provider" : "Paypal"
}
and if you get a response such as
{
"Name": "Whatever Company Ltd",
"Image": "https://pics.paypal.com/00/s/YTUwMmE3NDMtNDQ5Yi00ZDEyLThmZDktYmZmOTI0ZjM0Njcw/file_26.PNG",
"Valid": true,
"City": "",
"Country": "",
"IsDefault": true
}
then it's valid, or this if it's invalid:
{
"success": false,
"error": "Nothing found"
}

After successfully subscribing to Microsoft graph notifications with application I receive no notifications

I'm trying to receive notifications from Ms Graph. I want to create background service/daemon which connects to Graph with its own identity.
I'm using developer account. I've successfully created an application in AAD. I've added necessary permissions to my app.
For simplicity I'm using Postman to make REST requests to Graph. I've successfully authenticated with my app via:
https://login.microsoftonline.com/{mytoken}/oauth2/token
And received Authorization token. I can successfully execute Graph queries, like read and write messages of all users.
https://graph.microsoft.com/v1.0/users/93ffed3b-5aec-458c-a5eb-691cd610cd50/messages
I've created 2 subscriptions. And I can see those in a list.
https://graph.microsoft.com/v1.0/subscriptions/
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "67d395ae-0fad-438e-8f23-175dd2b43172",
"resource": "/users/93ffed3b-5aec-458c-a5eb-691cd610cd50/mailfolders('inbox')/messages",
"applicationId": "991ead1f-14b0-4934-a471-c749edcbb352",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://831327fd.ngrok.io/notification/listen",
"expirationDateTime": "2018-12-13T23:00:00Z",
"creatorId": "fc01f0e2-2b2c-4dc1-a18c-75529fb75953"
},
{
"id": "75b01b91-6595-4ce0-98b3-772731071607",
"resource": "/users/93ffed3b-5aec-458c-a5eb-691cd610cd50/messages",
"applicationId": "991ead1f-14b0-4934-a471-c749edcbb352",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://831327fd.ngrok.io/notification/listen",
"expirationDateTime": "2018-12-13T23:00:00Z",
"creatorId": "fc01f0e2-2b2c-4dc1-a18c-75529fb75953"
}
]
}
I'm using ngrok to tunnel requests to my local dev environment.
I've send several emails to an account which I subscribed to in subscriptions. But I've received no notifications.
How can I troubleshoot it? Is there a problem on MS Graph side, was it attempting so send me Notifications Or not? Is there a problem with my account or application configuration?
Today I see notifications about yesterdays' emails. For some unknown reason I received notifications after several hours. But question remains. Is there a way I can troubleshoot Notification scenario and see why MS Graph did not sent them to me?
After several hours everything started to work properly. It seams there is some internal stuff in MS Graph or Azure that after you create an Application and subscribe via it to emails, it's not starting to work instantly.

is it allowed to create a web custom audience in facebook ads sdk v2.8 in sandbox?

I know there's already a version 2.9 of the facebook marketing api, but am still currently using the v2.8, and I am running calls using the sandbox. now my question is, are we allowed to create web custom audience in the sandbox ? I tried to run this snippet in the facebook graph explorer
act_<ACCOUNT ID>/?fields=tos_accepted
I got this result for my sandbox account
{
"tos_accepted": {
"custom_audience_tos": 1
},
"id": "act_<my account id>"
}
but when I tried to run the same query using a non-sandbox account, I got different result
{
"tos_accepted": {
"custom_audience_tos": 1,
"web_custom_audience_tos": 1
},
"id": "act_<my account id>"
}
you see the web_custom_audience_tos property is not in the output when I used a sandbox account
If you are using a Sandbox account for testing, and are getting this TOS error, you will need to follow these steps:
(which I got from this answer: https://stackoverflow.com/a/42766604/544130)
To accept custom audiences ToS go to the application management ->
Marketing API -> Tools -> Sandbox Ad Account Management -> Actions ->
Accept TOS
Yes you can create Website Custom Audiences (WCA) using the Sandbox, however you will need to accept the terms & conditions for this.
If you try to create a WCA without accepting them, you'll get something like this:
{"error":{"message":"(#2663) Terms of service has not been accepted. To accept, go to https:\/\/www.facebook.com\/customaudiences\/app\/tos\/?act=ACCOUNT_ID","type":"OAuthException","code":2663,"fbtrace_id":""}}
To accept the TOS, you can go here, replacing the act ID with your Sandbox ID:
https://www.facebook.com/customaudiences/app/tos/?act=12312312

Embedded PayPal Login Button

All,
I am trying to add a PayPal login button to my site based on https://developer.paypal.com/webapps/developer/docs/classic/loginwithpaypal/integration/. Currently, I am using PayPal sandbox therefore I use the static AppID "APP-80W284485P519543T" (https://www.x.com/developers/paypal/documentation-tools/quick-start-guides/paypal-apis-getting-started-guide).
The following is my JavaScript code
<script src="https://www.paypalobjects.com/js/external/api.js"></script>
<script>
paypal.use( ["login"], function(login) {
login.render ({
"appid": "APP-80W284485P519543T",
"authend": "https://www.sandbox.paypal.com/",
"scopes": "profile email address phone https://uri.paypal.com/services/paypalattributes",
"containerid": "myContainer",
"locale": "en-us",
"returnurl": "http://localhost:3000/"
});
});
</script>
When I run it, I got the error "Relying Party Validation error: client_id provided in the request does not match any of the registered clients. Please check the request."
Any idea why and how to fix it?
Thank you in advance for the help!
This happened to me.
Create a seller in sandbox.
https://developer.paypal.com/webapps/developer/applications/accounts
go to the profile of the seller and check the client id under Log In with PayPal credentials, use it as your appid. I also used only "sandbox" as value of "authend"
The funny thing is that Log In with PayPal credentials not appeared to me until I had made the steps bellow and checked the profile again, I really dont know why:
login to www.sandbox.paypal.com with the creted seller accont
go to:
profile->Request API credentials
Option 1 - PayPal API
Set up PayPal API credentials and permissions
Option 2 - Request API credentials to create your own API username and password.
Also, it only started working when I created a fake app in production...
The new sandbox still a beta...
let me know if it worked.
you have to provide valid client_id as in the
https://developer.paypal.com/webapps/developer/applications/accounts
the login with PayPal button is sending to below URI which contains client_id
https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=eee5d94d000903b29b1263ae5654b369&response_type=code&scope=openid%20profile%20email%20address%20https://uri.paypal.com/services/paypalattributes&redirect_uri=https://developer.paypal.com/webapps/developer/access&nonce=05d0a60ee1f44361f449496505e05116&state=784d8bc3fe3a48a5105b4f8ddd8ae0e7