#workshare-devnull_connect-card-present
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1339276587400433708
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Sorry but your questions are all over the place. We can only answer questions about coding integrations with Stripe APIs here.
You can use Stripe Connect with Stripe Terminal to facilitate card-present payments though
can we use a generic card reader?
No. Stripe will only allow the use of Stripe terminal readers for card-present payments
okay. how about online/keyed payments. Am I understanding correctly that we could use Stripe.JS to tokenize a card before sending that token to our server to process payment on behalf of a connected account?
The createToken method in Stripe.js still requires a Stripe UI, in this case CardElement in order to tokenize the payment method.
so the checkout must be stripe hosted?
sorry if my questions are dense - heavy learning curve from using authorize.net
Not necessarily. You can use Stripe.js to create the inputs directly on a site you control
this code seems to work to give me a token in test mode
stripe.createToken(card).then(function(result) {
if (result.error) {
console.error(result.error.message);
} else {
// Send token to the server
fetch("teststripe.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ token: result.token.id, amount: 1000, currency: "usd" })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
}
});
but then i'm not sure what to do with the token
(i'm using the php stripe api)
I think you might be using a deprecated and undocumented approach here.
As for what is recommended for taking card payments, we have our Web elements documented here
i see, yes, I think my code is using a web element to collect and send the card for tokenization. Am I still understanding correctly that I send the token for payment server-side using my private key and the connected account's id?
That depends on what Connect funds flow you are using.
There are multiple different types, which we describe here
direct charge. we're invoicing software (middleman) for a business to directly invoice customers.
like freshbooks
Okay so you would need to create the token client-side on the Connected Account as well. To do that you will need to initialize Stripe.js with the Connected Account.
how would i retrieve the publishable key from a connected account?
You don't
You use your own publishable key and provide the Account ID.
Please review the link I shared
sorry i misunderstood the link. so it's okay for an accountid to be published
Yes
Because you are using Direct Charges, that means all the records (including the token) need to be created on the Connected Account
gotcha. this works and i was able to pass a token for a charge and it worked server side!
well, at least in test mode!
By adding the Connect Account ID when initializing Stripe.js, you ensure that is where Stripe objects get created
var stripe = Stripe(('pk_XXXX', {stripeAccount: 'acct_XXXX'})
Is it okay to store tokens from Stripe.JS for recurring bills?
Tokens are consumed as soon as they are charged. They are only good for a single use
gotcha. So instead send the token to \Stripe\PaymentMethod::create
to save for future payments
?
In order to re-use payment methods, you need to attach them to Customers before they are charged.
To ensure that the Cards you are collecting are optimized for future use, we recommend using Setup Intents to create/attach them.
But you can also configure your integration to save payment methods during the first charge, if that fits your integraton better
awesome. I really appreciate your help I think this got me going in the right direction. One last question ! If we want to do card present transactions, I need to pick out a server-driven stripe terminal and those are compatible with connected accounts?
Yes and Yes. We have a specific doc about using Terminal with Connect here. I think this is just what you are looking for.
thanks for your help. you've been very patient with me and I appreciate that
Happy to do it ๐ It's why we're here.