#oxmarco_code

1 messages ยท Page 1 of 1 (latest)

errant swanBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1247164912845852713

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

heavy pumice
#
      const session = await this.stripe.checkout.sessions.create({
        line_items: [
          {
            price_data: {
              tax_behavior: 'exclusive',
              currency,
              product_data: {
                name: 'file',
                images: [img],
              },
              unit_amount: price,
            },
            quantity: 1,
          },
        ],
        mode: 'payment',
        success_url: redirectSuccess,
        cancel_url: redirectCancel,
        automatic_tax: {
          enabled: false,
        },
        tax_id_collection: {
          enabled: false,
        },
        invoice_creation: {
          enabled: false,
        },
        payment_intent_data: {
          application_fee_amount: price / 10, // 10%
          capture_method: 'automatic',
          transfer_data: {
            destination: stripeAccountId,
          },
        },
        metadata,
      });
dim niche
#

No, there's no built-in way to make the fees visible, but you can manually create Products and Prices for this.

heavy pumice
#

should I just add more items to the line_items array?

#

and call them like stripe fee and app fee

dim niche
#

Yes, that would work.

heavy pumice
#

wouldn't that mess up the application fee though?

#

say price is $10, then I add stripe fee on top 1.5%+$0.25, then 10% app fee

dim niche
#

Please note:

In some jurisdictions, charging processing fees to your customers is prohibited by law.

heavy pumice
#

I see, if I stick to my current code, who is paying stripe fees?

dim niche
#

The Platform account, but since you collect application fee from your Connected account, it should cover that.

heavy pumice
#

ok then the connected account will pay both the stripe fee and the app fee, right?

dim niche
#

Yes

#

Well, not exactly. CA will just pay the application fee, and then your Platform will pay the Stripe fee, but given the former is 10%, it should cover the Stripe fee.

heavy pumice
#

I see, some items are like $0.5

#

app fee would collect $0.05 but the min Stripe fee is $0.25

#

thus I need to make the min price $2.5 if I want to make sure the stripe fee is covered

dim niche
#

Yes, that sounds right.

heavy pumice
#

ok, one last thing, would it be possible to review the complete flow before I go to prod?

dim niche
#

Sure, you can try almost every Stripe feature in Test mode - using your test keys

heavy pumice
#

1. Register user

return await this.stripe.accounts.create({
        email,
        controller: {
          losses: {
            payments: 'application',
          },
          fees: {
            payer: 'application',
          },
          stripe_dashboard: {
            type: 'none',
          },
          requirement_collection: 'application',
        },
        capabilities: {
          card_payments: {
            requested: true,
          },
          transfers: {
            requested: true,
          },
        },
        business_type: 'individual',
        business_profile: {
          mcc: '5815', // digital_goods_media
          url: `https://example.com/users/${userId}`,
        },
        country: 'DE', // TODO get from ip
        tos_acceptance: {
          date: Math.floor(Date.now() / 1000),
          ip,
        },
      });

2. Onboard user

return await this.stripe.accountLinks.create({
        account: stripeAccountId,
        refresh_url: 'https://example.com/profile?verification=false',
        return_url: 'https://example.com/profile?verification=true',
        type: 'account_onboarding',
      });

3. Listen to wekhooks

const event = await this.stripeService.processWebhook(
        requestBody,
        signature,
      );

      if (event.type === 'checkout.session.completed') {
        await this.processCheckout(event);
      } else if (event.type === 'account.updated') {
        await this.processAccountUpdate(event);
      }
#

my questions are:

  1. is this process correct?
  2. should I validate the account.updated hook to make sure the user has successfully been onboarded
  3. are payments sent to the user on a rolling basis or do I need to create payouts manually?
simple rock
#

Hi there ๐Ÿ‘‹

  1. looks right, are you running into problems during your testing that you're trying to troubleshoot?
  2. Absolutely
  3. It doesn't look like you're overriding Payout settings to be manual, so they will be sent automatically.
heavy pumice
#

hey ๐Ÿ‘‹

  1. no, but the documentation is a bit confusing, probably due to the extreme flexibility of Stripe APIs
  2. Can I just watch the webhook data or should I call a specific endpoint to validate the user status?
  3. is there any fee savings when using manual vs automatic payouts?
simple rock
#

You need to look at the contents of the account.updated Event. Some key fields to check are charges_enabled, payouts_enabled, and the requirements hash. They give you a good sense of the state of the account.

#

I'm not sure if there any cost savings, we aren't familiar with fees in this forum and mostly focus on helping with our API. You'll want to contact our Support team for questions regarding pricing and fees:
https://support.stripe.com/?contact=true

heavy pumice
#

ok perfect then

heavy pumice
#

like automatic_tax and tax_id_collection

simple rock
heavy pumice
#

ok perfect

#

that was all

#

I guess I can ask the commercial support for tax-related questions, right?

simple rock
#

Sure, if it's a question about integrating one of our tax related products into your integration, we're likely the better channel for that. If the question is about pricing for our tax products, or if you disagree with how we calculated tax for a given transaction, then those are better handled by our Support team.

heavy pumice
#

well my question is simple, my company is located in a country that doesn't have taxes (Gibraltar) serving mainly UK and DE customers, should I charge taxes or not?

simple rock
#

That's a question that you should ask your legal advisor/tax advisor.

heavy pumice
#

Stripe tax is not available for Gibraltar

#

I assume then I can't activate the automatic_tax flag

simple rock
#

I'm not too familiar with the regional limitations there. I'd expect you'd encounter an error if you're trying to use something that isn't available to your account though, when you make the request to create the session.

heavy pumice
#

ok thank you very much

#

I'll try and let you know later if I find any problems

simple rock
#

๐Ÿ‘ sounds good

heavy pumice
#

Oh one thing

#

can I avoid setting the country upon registration?

#
      return await this.stripe.accounts.create({
        email,
        controller: {
          losses: {
            payments: 'application',
          },
          fees: {
            payer: 'application',
          },
          stripe_dashboard: {
            type: 'none',
          },
          requirement_collection: 'application',
        },
        capabilities: {
          card_payments: {
            requested: true,
          },
          transfers: {
            requested: true,
          },
        },
        business_type: 'individual',
        business_profile: {
          mcc: '5815', // digital_goods_media
          url: `https://privatedrops.me/users/${userId}`,
        },
        country: 'DE', // TODO get from ip
        tos_acceptance: {
          date: Math.floor(Date.now() / 1000),
          ip,
        },
      });

here country: 'DE', // TODO get from ip

simple rock
#

Should be able to, do you get an error when you try to do so?

heavy pumice
#

no

simple rock
#

๐Ÿ‘

#

Now you should see that the Account Link you direct your user to collects their country, rather than pre-populating the form with the country you provided.

heavy pumice
#

ok perfect

#

another thing that is not fully clear

#

upon user registration

#
          card_payments: {
            requested: true,
          },
          transfers: {
            requested: true,
          },
#

which should I activate?