#matrix-payment-links

1 messages · Page 1 of 1 (latest)

crude forum
late fern
#

Hello

#

not sure if i posted the question in the wrong place...

fading gale
#

This is the right place. Looking in to this and will get back to you

late fern
#

thanks, i am looking for a no code solution here ideally, ie something to do inthe dashboard

fading gale
#

Unfortunately I am not seeing a way to do direct charges with Payment Links

#

Would a low code solution with Checkout be viable?

late fern
#

oh yes maybe but i am not good with html

#

how could i do it?

fading gale
late fern
#

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

fading gale
#

Oh good question on the Checkout snippet

#

Will look in to that in a bit. Helping in a few other threads

late fern
#

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>

fading gale
#

Unfortunately it would not be able to make a direct charge with that either

late fern
#

I am not sure how to do step step 3.1

fading gale
#

What part of 3.1?

late fern
#

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

fading gale
#

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

late fern
#

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

fading gale
#

Is that working? Are you seeing some error?

late fern
#

I am following a guide

fading gale
#

Is it working at the moment? Are you blocked on something here?

late fern
#

yes i am blocked

nova crane
#

hello I'm catching up here, what are you blocked on?

#

can you summarize the problem you need help with?

late fern
#

i am getting lost with checkout

#

i am not able to make the client to talk to the server

nova crane
#

i am not able to make the client to talk to the server
how experienced are you with client-server development?

late fern
#

not much but i did succesfull integration with flutter

#

i am not good with the web