#directmarketplace

1 messages ยท Page 1 of 1 (latest)

wary remnantBOT
foggy acorn
#

Hello! Yep, this is called a direct charge, and it happens on the connected account. To clarify, are you trying to write code to do this?

sharp hollow
#

Yes please using node js

foggy acorn
#

And you specifically want to create a Payment Link for this?

sharp hollow
#

I am open to all options. I need to put a link on my web page to take the customer to the Check Out but if we need to do multiple steps I am open to that too. The goal is the customer clicks a link, they end up on some kind of payment / check out page and make the purchase. Then they are redirected to a successful page afterwards for processing. This is for a STANDARD account. Not express or custom. Thanks

#

CUSTOMER buys from MERCHANT is critical

foggy acorn
sharp hollow
#

Curl requires a server. Can we do this in node js

foggy acorn
#

There are code snippets for Node there. Node also requires a server though... do you have a web server for this?

sharp hollow
#

This is done as a Lambda Function using Node JS so no server

foggy acorn
#

I mean, the lambda function runs on a server.

#

The cloud is just someone else's server. ๐Ÿ™‚

#

But yeah, my recommendation remains the same.

sharp hollow
#

The link from our web page can run the Lambda Function the response needs to be a redirect to a Check Out / Payment Page

foggy acorn
#

Yep, it will be. Once you create the Checkout Session with the options you want you can respond to the request with a redirect to the Checkout Session's url.

sharp hollow
#

const stripe = require('stripe')('sk_test_your_key');

const session = await stripe.checkout.sessions.create({
success_url: 'https://example.com/success',
line_items: [
{price: 'price_H5ggYwtDq4fbrJ', quantity: 2},
],
mode: 'payment',
});

sharp hollow
#

This makes no mention of the connected account. How do we connect it

foggy acorn
#

You create the Checkout Session on the connected account. Instructions for making API requests on Connected accounts are in the link I shared above.

sharp hollow
#

I'm sorry I don't understand. The code doesn't have a connected account variable as an option. Can you please type sample syntax here. Sorry for being a bit thick

#

The first ref is curl i need to use node

foggy acorn
#

You can switch to Node on any of these examples.

sharp hollow
#

OK

#

this is for const paymentIntent = await stripe.paymentIntents.create(

#

There is no option here for admin fee or success url

#

When I look at checkout there is mention of connected account

foggy acorn
sharp hollow
#

Its is confusion hence the reason I am askig for help. Can you please show me a simple piece of hand written code in node

foggy acorn
sharp hollow
#

onst paymentIntent = await stripe.paymentIntents.create(

foggy acorn
#

Why are you creating a Payment Intent?

sharp hollow
#

I agree it has a redirect success URL but no connected account or admin fee

foggy acorn
#

That's just an example for how to make a request on a connected account. You need to understand the overall concepts being used here before you can write the code you need for your specific use case.

#

One sec.

#

Read that end-to-end and let me know if you have questions.

sharp hollow
#

Please lets not go round and round in circles. The docs are clearly confusing. Can you please show me a simple piece of code in node that does all 3 tasks. 1) Admin Fee, 2) Redirect on Success 3) Connected Account, 4) Details of the offer because the web pages don't show it and I have wasted ober 30 hours already trying to guess. Thank you so much I really appreciate it

foggy acorn
#

Please have a look at the guide I linked above, I think it's exactly what you need all in one place.

#

If it's not let me know.

sharp hollow
#

Checking

#

This seems right. I am programming a test. Please keep this chat open. Thank you

foggy acorn
#

This thread will remain open for a little while, but we do close idle threads after a time. You can always ask new questions in #dev-help if you come back and find this thread closed though. ๐Ÿ™‚

sharp hollow
#

So close. OK 1) Product YES, 2) Merchant Page YES, 3) Admin Fee paid YES, 4) Redirection on success YES. But its just my web page in the redirect. I need some kind of ref in the URL to be able to check the transaction e.g. checkout_id or something. What change do I need to make to my success url. Thanjs

#

in the code. Thanks

foggy acorn
#

Wherever you put {CHECKOUT_SESSION_ID} in your success_url it will be replaced with the Checkout Session ID when the redirect happens.

sharp hollow
#

OK that works. I would like to include a membership id . There doesn't seem to be an option to add meta data in the example. Any thoughts?

foggy acorn
#

To clarify, where do you want to include the membership ID? Are you still talking about the URL, or do you want to add it as metadata to the Checkout Session?

sharp hollow
#

OK so link on web page has memberid in query string . The link is processed in the node function where we can grab the membership id and put it somewhere in the code, then the chot url is created and we redirect to that page. Then the customer buys and we are redirected to my success url which includes the CHECKOUT_SESSION_ID. I then do an api call using that ID to get the data on the transaction which should include the Membership Fee added earlier. Make sense? The code example does not mention meta data as an option

#

Maybe we use it in the URL generated by the node code which what I used to do with payment links

foggy acorn
#

If you have any questions about how to read and make use of the API reference just let me know, I'd be happy to help!

sharp hollow
#

Finally. Yeah! I would like to use the CHECKOUT_SESSION_ID to get the details of the transaction using node. Can you kindly show me the link for same. Thanks

foggy acorn
wary remnantBOT
sharp hollow
#

k

#

OK there is a problem. This is expecting for the CHECKOUT_SESSION_ID to belong to me. How do I adapt this request to reference the connected account. Thanks

#

"errorMessage": "No such checkout.session: cs_test_a1zFpzpt8dBTAAwrx3oUpubSg46rb6HW3lJuISJ8zKgKVbXwF8QJRLeDiP",

fleet flicker
#

Hi, stepping in here and catching up.

sharp hollow
#

Its just the last step I need help with. Everything else is wrking yeah!

fleet flicker
sharp hollow
#

Is it possible to create products as a market place vs creating them on the merchant's account. Currently we would get an error of price_id not recognised because its looking for it in the connected account.

#

Whilst maintaing DIRECT PAYMENT on STANDARD ACCOUNT

#

If not can we create products ourselves and add them to the merchants account with an api

fleet flicker
sharp hollow
#

If not can we create products ourselves and add them to the merchants account with an api. Is there a link for that we use node

fleet flicker
fleet flicker
#

@sharp hollow were you able to make a successful retrieve request for that Checkout Session?

sharp hollow
#

OK great thank you everyone for your help today. Please close thread