Braintree: can users update their vaulted customer information? - javascript

I'm using the Braintree v3 javascript client implementation. After my server returns to me the vaulted information on the customer : payment method, billing address, etc so I can pre-populate some fields on the UI, is there a way on the client side to update the information, such as billing address, if they want to change it?

Disclaimer: I work at Braintree. If you need more assistance, please reach out to Braintree Support.
You can make a server side API call that updates the customer's information based on what they enter into your client-side form. Here is an example of making this call using the Node.js sdk:
gateway.customer.update("theCustomerId", {
firstName: "New First Name",
lastName: "New Last Name"
}, function (err, result) {
});
A link with more details is located in Braintree's Support Documentation.

Related

How to hide email in cloud functions mailer? Or how to get an official gmal account? - Firebase

Recently Ive set a nodemailer with cloud functions to mail users about some specific actions in firebase.
In the mail options:
const mailOptions = {
from: `${APP_NAME} <noreply#firebase.com>`,
}
Unfortunately, it shows the address from which Ive sent the email. And this is actually my private google account I don't really want to let user be able to see it when he receives the email. It shows MyApp <myapp#gmail.com>.
Q1: Is there a way to hide it?
However, I would accept it if I would have some official gmail account, with professional name, like: offerSender#myApp.com.
Q2: Does Google provides some customizable email box for firebase users, so I can mail users from that specific box and use some nice custom name? (I dont want to use my private one)
Thank you!
When sending mail through gmail, you can't change the reply address from the one that's used to authenticate with the gmail server. If you want your mail to appear from some other account, use a mail service that gives you this option. You will likely have to pay some money for it.

How to get User's actual Email Id in Outlook Add-in Integration

I have integrated created one Add-In to be integrated in Outlook Mail.
I have used Office inbuilt code (Javascript Code) for it.
Now to test Add-in i have signup in Microsoft with my personal email id.After sign up i found that in Outlook Mail, there are two different Mail Ids in Profile.
like
alex.p#***.com
outlook_1203434#outlook.com
now i need the first one for validation but i am getting the second one every time.
I used below code for that.
Office.initialize = function (reason) {
item = Office.context.mailbox.item;
console.log(Office.context.mailbox.userProfile.displayName);
console.log(Office.context.mailbox.userProfile.emailAddress);
}
Please suggest me some other way to get the users email id.
The documentation for the Outlook JavaScript API ( https://dev.office.com/docs/add-ins/develop/understanding-the-javascript-api-for-office#mailbox-object ) implies that your code runs only within a mailbox context which only exposes that specific mailbox's data, so you cannot access any information about other mailboxes.
I had a quick search and I don't think it's possible to enumerate email addresses associated with a mailbox, nor information about other mailboxes in Desktop Outlook or whatever the OWA equivalent is.

Facebook Login For Rest Api

I am trying to implement Facebook login SPA. I am using the JavaScript SDK for the login. Fb authorized the user and token is received. Token is send to the web API. When API try to fetch the data from the token only Facebook id and name return from the Facebook graph api. Even though I have set the scope for the different data in java script sdk. If i fetch the data using javascript sdk. In that case i am getting the complete data whatever in the scope.
I think your asking "why am I not getting all the data I requested?". If so the most common reason is because permissions aren't set. For instance if the user grants permission to "public_profile" then Facebook will authorize your app to obtain every field that that the "public_profile" permission permits, in this case the following:
id, name, first_name, last_name, age_range, link, gender, locale, picture, timezone, updated_time, verified
obtained via
FB.api('/me',
'GET',
{"fields":"id,name"}, //any of the other fields here
function(response) {
// Insert your code here
} );
however if added 'email' in as a field then the Facebook would return everything except the 'email' because there a permission specifically for granting access to the users email called email. You can see what permissions enable what data returns at https://developers.facebook.com/docs/facebook-login/permissions
and you can test it at https://developers.facebook.com/tools/explorer. I hope that's what you where trying to say in your question. Cheers!

How to get Braintree v.zero to show existing payment methods?

Setting up a payment form with the Braintree v.zero SDK:
braintree.setup(response.value, 'dropin', {
container : 'xyz',
onPaymentMethodReceived : function(payment) {
pay(payment.nonce);
},
});
After entering payment information, the form shows:
...but only until the page is reloaded. Is there a way to initialize the dropin payment form to list a customer's existing payment methods?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
The key would seem to lie with your response.value (i.e. your client token). I would guess that your server code used to generate it isn't specifying a customerId for that user.
​
From the Braintree documentation on generating client tokens:
Your server is responsible for generating a client token, which contains all authorization and configuration information your client needs to initialize the client SDK to communicate with Braintree. Including a customerId when generating the client token lets returning customers select from previously used payment method options, improving user experience over multiple checkouts. Set Up Your Client covers the client side of the exchange.
Bottom-line: Drop-in will display multiple cards if you generate your Client Token using the customer_id that matches your customer.
client_token = braintree.ClientToken.generate({
"customer_id": a_customer_id
})

Paypal login with cURL and JavaScript + RestAPI

I'd like to login to a web app using paypal, and retrieve the information of the account, i'm using RestApi but i can't make that login with javascript, and i don't know why?
I've checked their documentation, but didn't make it.
I've used this post as well, but no solution found: Login with Paypal javascript integration
Can anyone point me to an example already made or give hint to make this.
I can't understand the documentation.
The Log In with PayPal button JavaScript code builder helps with localizing or customizing the Log In with PayPal button; additionally, the authorization endpoint and its parameters are dynamically generated from the information entered in this form. Try using it to generate your script.
<span id="btn-login"></span>
<script src="https://www.paypalobjects.com/js/external/api.js"></script>
<script>
paypal.use( ["login"], function(login) {
login.render ({
"appid": "AXpyxRAJ3V0Jb6x5Vt8aEu6HK0PvqLk188J1e6fXCW5qmTm570eOdSQUJ7o2",
"authend": "sandbox",
"scopes": "profile email address phone https://uri.paypal.com/services/paypalattributes",
"containerid": "btn-login",
"locale": "pt-pt",
"returnurl": "http://severianos-box.com/mybox/market.html"
});
});
</script>

Categories