I am trying to implement a PayPal Vault Braintree payment solution. But since it is a "redirect" process via Chrome Custom Tab, I am having trouble finishing the process. This because in Paypal Web version, the "data response" returns in URL to be used. However, on Android I cannot achieve the same result since the Chrome Custom Tab Works in parallel to the application.
The documentation talks about some listeners that are supposed to work automatically and also about some handlers that can be added manually. However, I don't know how to trigger these listeners and I was also unable to implement a "response" in the handlers.
For now I can open the PayPal page and finish the authentication and authorization, but I do now know how to get data from response.
Anyway, any help would be cool.
Thank you.
The function opening the Chorm Custom tab:
public void startBillingAgreement() {
PayPalRequest request = new PayPalRequest()
.localeCode("US")
.billingAgreementDescription("Your agreement description");
PayPal.requestBillingAgreement(getBraintreeFragment(), request);
}
The process guide (they say about the onPaymentMethodNonceCreated function, but i do not know how to)
The listeners guide
Related
I am using AWS SES to send newsletter. I am using spring boot for AWS SES application. I am trying to implement one-click unsubscribe.
List-Unsubscribe-Post is not working. I am using like this
List-Unsubscribe-Post: List-Unsubscribe=One-Click
List-Unsubscribe: https://localhost:8080/unsubscribe/example?list=name&email=email
I have tested my POST api by creating form in email and send request. It’s work with my api and unsubscribe from my database.
If i use List-Unsubscribe: https://localhost:8080/unsubscribe/example?list=name&email=email
also work.
List-Unsubscribe-Post:
Only unsubscribe header with one click does not work. When i click on unsubscribe header in gmail, modal open ask to click unsubscribe. When i click get message you are unsubscribe from the email. But POST api has no interaction.
List-Unsubscribe:
Works fine with GET request and unsubscribe in database
String unsubscribeUrl = mailMessage.getUnsubscribeUrl();
if (unsubscribeUrl != null)
builder.withHeader("List-Unsubscribe-Post", "List
Unsubscribe=One-Click");
builder.withHeader("List-Unsubscribe", "<" + unsubscribeUrl + ">");
welcome to StackOverflow, it would be beneficial to perhaps see some code that you've written specifically. In this case it could mean that your application isn't recognising the path, this can be because your code has marked the endpoint as being GET while your posting or vice versa. Have you check your access logs, perhaps this is already telling
I already have an implemented CMS system where the user creates the subscription plans.
I want to integrate my CMS server with Paypal so when the user creates a plan it will be created on Paypal servers.
I can see how to do that in https://developer.paypal.com/docs/subscriptions/integrate/
But the problem is there is no documentation for the front-end side for the subscription step ! How should i redirect the customer to Paypal to login, and how will i receive the data to send it to my server ?
Note : Since i want my user to create plans only on my CMS, there is no easier way to integrate with paypal than this : https://developer.paypal.com/docs/subscriptions/integrate/ .. right?
i don't want to use Smart Buttons so the only option i have is to integrate with APIs.. if there is any easier way please tell me.
This is a bit hidden.
When you create a subscription, its status will be set to APPROVAL_PENDING. Look for the "rel": "approve" link in the response (in links). The URL will look something like this:
https://www.paypal.com/webapps/billing/subscriptions?ba_token=xyz
This is the URL you need to redirect the customer's browser to. Once they click on "Subscribe" to approve it, PayPal will redirect their browser to the return_url value you set when you created the subscription.
PayPal adds 3 extra parameters to that return URL: subscription_id (self-explanatory), ba_token (the approval token), and token (???). At that point, you can get the subscription details from PayPal, and its status should now be "ACTIVE".
Now I just need to figure out why next_billing_time is set in the past, and why I'm not receiving the PAYMENT_SALE webhooks :)
Hope this answers your question.
using Wit.ai HTML api.
Posting /converse message I get the response of type:action with action name, then I execute some my own code. How then make POST with context-key to wit API to get an answer from the robot?
Also how to trigger robot message when user do not need to say anything?
Your own code (the action you need to run) is responsible for updating the context (e.g. adding a key "forecast" with value "sunny"). In your Wit.ai /converse calls, you provide the context in the body.
See the example in the documentation: https://wit.ai/docs/http/20160526#post--converse-link
You can call your send action when you want to trigger a robot message.
I need to find a way of reading GET/POST requests from the WEB browser(Network) and retrieve the information like Status, Domain, Size, IP and the most important Timeline.
The main purpose of this is to measure requests count after each action on the WEB page and their execution time. Also this will help me to know if any requests(AJAX/JavaScript) are executing before I want to perform any actions on the WEB page.
Could you please help me with solution?
Assuming you don't want to tie yourself to a particular browser (via plugins or particular dev toolbars), need to capture responses from interactive user events (i.e. via simulated use of a website in a real browser, not dynamically created HTTP calls), and need to automate this, then a proxy server is the way to go.
Something like Browsermob can be set up as a proxy for all Selenium traffic. It can capture the entire content of all requests and responses, and let you generate you a (cross-browser) HAR file that you can then persist, visualise, or query via an API.
Obviously you could automate this, schedule the Selenium test runs, and either produce your own custom metrics with your own Java code; pipe the HAR into a JSON-savvy database for querying (say Elasticsearch) and visualisation, or just save the HARs for offline querying and diffing.
Some example code from the tests:
[...]
proxy.newHar("Test");
HttpGet get = new HttpGet(getLocalServerHostnameAndPort() + "/a.txt?foo=bar&a=1%262");
client.execute(get);
Har har = proxy.getHar();
HarLog log = har.getLog();
List<HarEntry> entries = log.getEntries();
HarEntry entry = entries.get(0);
HarRequest req = entry.getRequest();
[...]
Alternatively you can visualise the output by obtaining the HAR in string form and pasting into http://www.softwareishard.com/har/viewer/. That should give you something that looks very similar to the Network tab, but in a format that's easier to export, screenshot, and print.
Chrome comes with devtools by itself. Just hit 'F12'.
https://developer.chrome.com/devtools
Postman, it's useful for testing web services and API
https://www.getpostman.com/
I am making a module for a server software that is allowing support for facebook.
The problem is with the callback URL. If one client start the authorization proccess, then another client starts the proccess at the same time, or before the first user finish. How could I check what user finished first?
I need a way to check what client's callback I'm getting. One solution would be to lock other from register until the first one has finished, but I don't want to do that. Is there another way? I have thought about including ?client=clientid at the end of the callback, but I heard facebook only allows the exact url specified in the app on facebook.
UPDATE
It didn't work to add client="clientid" to the callback. Any other ideas?
After some more searchig I figured facebook will allow a parameter: state. (thanks to #jacob https://stackoverflow.com/a/6470835/1104307)
So I just did ?state=clientId.
For anyone using scribe the code is this:
service.getAuthorizationUrl(null) + "&state=" + clientId;
I think there is no problem on adding and GET parameter like client=clientID. Facebook will redirect you to the URL you have specified and using the REQUEST parameters you can check who completed the request. The problem exist if you have specified URL as http://yoursite.com and pass redirect to http://some-sub-domain.yoursite.com or entirely different location.
if you are using the server-side flow then the oauth 2 flow will be:
redirect user to facebook
facebook then rediects the user to your specified callback
your server uses something like curl to get the access token
your server does some more curl to get maybe more user data or update the user's data
my recommendation would be to set a session cookie in step 1 and simultaneously store this session id on your server. then the session cookie will automatically be sent to the callback url in step 2 and you can identify the session in the database this way.
this will work for all service providers (google, twitter, linkedin, etc) and is the preferred way of maintaining session continuity.