Can I make transactions on the user's behalf using some exchange API (Binance, Coinbase etc.)? - binance

I've read the Binance API documentation but it's still not clear to me whether it allows for a 3rd party app to initiate a payment, and then just have the user confirm it.
For example, I want to build an application which would allow the user to send tokens to a previously defined address, but most of my user base won't have MetaMask or a hardware wallet (so it's not that straightforward like with using ethers.js or web3.js), they'll mostly keep their tokens on an exchange.
Also, if this can't be done through Binance, is there another exchnge that would enable this?

You can use the withdraw endpoint.
Docs: https://binance-docs.github.io/apidocs/spot/en/#withdraw-user_data

Related

Saving User's card in Square Payments

I'm new to Square and want to implement it in a React Native app with a Node backend.
I see that there is a method to save the customer's card details.
https://github.com/square/square-nodejs-sdk/blob/master/src/api/customersApi.ts#L230
But there is also the payment form?
https://developer.squareup.com/docs/payment-form/how-it-works
Firstly, I cannot see if the payment form is even available in React Native - information seems very scarce.
Secondly, even if I do implement that form, I can't see a way to connect it to the customers API endpoint.
I don't want to use in-app payments (i.e. google or apple pay). I want to be able to save card details like Amazon does, and use them whenever a user places an order in app (probably triggered by a node process). I'm not sure if I'm going about this the correct way, guidance would be appreciated.
In-App Payments SDK will be the way to go (and there is a React Native plugin already). The In-App Payments SDK is basically a mobile Square Payment Form, that you linked to. It will generate a secure nonce, and you can use the nonce to save the card on file. The next time the customer comes, instead of bringing up In-App Payments, you can simply call CreatePayment in your backend, with the customer_id and the customer_card_id as the source.
As for "connecting it to the Customers API" - you don't connect it directly per se. You would collect information from the customer, on your own, and pass it directly to the Customers API to create a customer. You can then call CreateCustomerCard using the nonce (generated by In-App Payments), and the customer_id that you just created, to save the card to this customer profile.

Stripe - Create a Source for a Credit Card using only Stripe API

I'm trying to register a user payment info by directly using fetch to Stripe's API (since it's a React Native app, I can't use Stripe Elements). It follows the usual concept: a user registers his credit card, which is then associated to his account so he can make payments in the app.
I tried to approach this problem by creating a credit card token with the info that the user provides on signup, but I've realized that that token is only worth for one payment, or for associating to a customer.
Meanwhile I saw that Sources are maybe what I need in my app, since we can get back to it and charge it multiple times. However, from what I see in the API docs there's no reference to the credit card info when creating the source.
What do I need to create to be able to do this (registering a card to be used several times) only through the API?
By creating a token previously, you can then use it as an argument to the creation of the source. Then, the token properties will override source parameters. Thanks to #Evgenii Malikov for the tip.
You need to create a token of your card previously. For that, you can use tipsi-stripe package.
Perfect package if you want to implement credit card, apple / google pay.

Safely update Stripe Custom Connect Account From Browser

I have some stripe custom connect accounts that need updating.
We create these stripe connected accounts when a user signs up on our platform, but we don't ask for all of the information until later.
Here's the rub: We need a social security number. (We will be doing taxes later) I know that this goes into legal_entity, but the only way to update connected custom accounts is using the secret_key on the back end....but I can't let a SSN touch the back end!....Well, I guess that I could, but I didn't want ANY dangerous information to touch our server, EVER. I definitely wouldn't store it, but I worry about that making me liable.
So if I can't use the secret key in the browser, and I can't let the SSN touch the server....what is the correct way to update a connected account?
Using Stripe.js, you can generate Account Tokens that your server can reference when making API calls, just like you would get a card token when making payments.
There are directions on how to get the token and use it to update legal information in the documentation here:
https://stripe.com/docs/connect/account-tokens#updating

Connect Google calendar api and api.ai

So here is what i am trying to do :
I built a bot with api.ai for my business that is hosted on my webpage and my Facebook page right now. Bot works well.
I want to push it to the next step by allowing my customers to make querys on my calendar, ask to book a specific time, see if available, if not offer other time similar, then make a booking.
I have been reading this thread and the great answer attached to it but i think my case is a bit different.
I was wondering if the bot could always have a token so every guests won't have to Auth to query the calendar ?
Obviously i am new to this, i have been reading the guide of google calendar api and api.ai but i don't really see how to do that yet. I guess there is a way to store a token somewhere and then just trigger the query with some specific intents but not to sure how.
I have also done the node.js quickstart guide of the G-calendar api, and it works fine if that helps.
Thanks for your help !
You will probably want to use a Service Account that is permitted to the calendar in question. Service Accounts are similar to regular accounts, but they are expected to do server-to-server communication only, so the method to create an auth token is a little different to keep it secure.
See https://developers.google.com/identity/protocols/OAuth2ServiceAccount for more information about using Service Accounts.
In general, you'll be using a shared secret to create and sign a JSON Web Token (JWT) you send to Google's servers. You'll get back an access token which you'll then use to call the Calendar API. The access token expires in about an hour, at which point you'll need to repeat the process.
There are libraries available to do much of this for you. For example, if you're using the node.js library https://github.com/google/google-api-nodejs-client, then it will take care of this for you (although you need to modify the key file - see the documentation for details).

What type of middleware is used for the Square credit card reader and its website

I am trying to understand how the https://squareup.com/ square Credit Card reader works.
What would be the underlying middleware that is being used to
send the data to the squareup server,
process the payment
send verification to a user of a successfull payment
This is implmented on the iPhone, could there be a generic middleware that could be used for other devices to access this service created, so we could have all type of smartphones access a similar service language independent?
Also what security protocols would be used to ensure the data is sent encrypted over the network?
Their own website contains details about their security technology. They appear to use common and trusted technologies like SSL, which isn't a surprise.
If you want to build an application that integrates with their service, you should contact them. It's possible that they will require you to purchase a license in order to do so. They would also be the authority on the protocols and middleware required to integrate with it.

Resources