#matrix-payment-links
1 messages · Page 1 of 1 (latest)
This is the right place. Looking in to this and will get back to you
thanks, i am looking for a no code solution here ideally, ie something to do inthe dashboard
Unfortunately I am not seeing a way to do direct charges with Payment Links
Would a low code solution with Checkout be viable?
Here is our doc on Checkout https://stripe.com/docs/payments/accept-a-payment?platform=web
I have create a product and I have got a checkout snippet. I have added the button in my website and I can take the payment HOWEVER the question is how to direct charge my connected account instead of me
And when creating it you would put your fee in the payment_intent_data.application_fee_amount param https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-application_fee_amount
Oh good question on the Checkout snippet
Will look in to that in a bit. Helping in a few other threads
this is the snippet i have got
<!-- Load Stripe.js on your website. -->
<script src="https://js.stripe.com/v3"></script>
<!-- Create a button that your customers click to complete their purchase. Customize the styling to suit your branding. -->
<button
style="background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em;cursor:pointer"
id="checkout-button-price_1JrhD8KXjwYd84Q4kDUkcpil"
role="link"
type="button"
Checkout
</button>
<div id="error-message"></div>
<script>
(function() {
var stripe = Stripe('pk_test_51EpuOEKXjwYd84Q4OeeHHJmIzWklxIvZQzEeT7JOjAZx91ZRwYbJBILRjI9D3UwEu6tT7GqNM8Ne4iRpIJGPoKbP00SiByyvDH');
var checkoutButton = document.getElementById('checkout-button-price_1JrhD8KXjwYd84Q4kDUkcpil');
checkoutButton.addEventListener('click', function () {
/*
* When the customer clicks on the button, redirect
* them to Checkout.
/
stripe.redirectToCheckout({
lineItems: [{price: 'price_1JrhD8KXjwYd84Q4kDUkcpil', quantity: 1}],
mode: 'subscription',
/
* Do not rely on the redirect to the successUrl for fulfilling
* purchases, customers may not always reach the success_url after
* a successful payment.
* Instead use one of the strategies described in
* https://stripe.com/docs/payments/checkout/fulfill-orders
/
successUrl: 'https://www.google.com',
cancelUrl: 'https://www.yahoo.com',
})
.then(function (result) {
if (result.error) {
/
* If redirectToCheckout fails due to a browser or network
* error, display the localized error message to your customer.
*/
var displayError = document.getElementById('error-message');
displayError.textContent = result.error.message;
}
});
});
})();
</script>
Unfortunately it would not be able to make a direct charge with that either
I found this guide: https://stripe.com/docs/connect/creating-a-payments-page#accept-a-payment
I am not sure how to do step step 3.1
What part of 3.1?
I am using firebase function but i am not sure how to call it from the web
do i need to edit this part:
<form action="/create-checkout-session" method="POST">
do i need to put the url of my http function there?
sorry this is really some basic stuff i guess
Unfortunately I am not that familiar with Firebase myself. I don't think you need to modify the HTML. That sets it up so that the client will make a POST request to /create-checkout-session on your firebase server, you will need to write the code on the server side to process that POST request
ok i try
I have add this one in firebase
exports.MailchimpIntegration = functions.https.onRequest(
async (request, response) => {
// functions.logger.info("Hello logs!", {structuredData: true});
// response.send("Hello from Firebase!");
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [{
name: 'Stainless Steel Water Bottle',
amount: 1000,
currency: 'gbp',
quantity: 1,
}],
payment_intent_data: {
application_fee_amount: 123,
},
mode: 'payment',
success_url: 'https://google.com',
cancel_url: 'https://yahoo.com',
}, {
stripeAccount: '{{acct_1F2Z3mKr9Mz02PRk}}',
});
// 303 redirect to session.url
}
);
which is basically an http request and inside i have copied the code from the stripe site
Is that working? Are you seeing some error?
I am following a guide
Is it working at the moment? Are you blocked on something here?
yes i am blocked
hello I'm catching up here, what are you blocked on?
can you summarize the problem you need help with?
i am getting lost with checkout
i am not able to make the client to talk to the server
i am not able to make the client to talk to the server
how experienced are you with client-server development?