#Atish

1 messages ยท Page 1 of 1 (latest)

proud viperBOT
marble hare
#

Which integration type do you use? Checkout Session, Payment Element with Payment Intent, Invoice... etc?

blissful jay
#

I am using checkout session

#

and destination charge type

marble hare
blissful jay
#

List<Object> lineItems = new ArrayList<>();
Map<String, Object> lineItem1 = new HashMap<>();
lineItem1.put("price", "price_H5ggYwtDq4fbrJ");
lineItem1.put("quantity", 2);
lineItems.add(line_item1);
Map<String, Object> params = new HashMap<>();
params.put(
  "success_url",
  "https://example.com/success"
);
params.put("line_items", lineItems);
params.put("mode", "payment");

Session session = Session.create(params);```
#

Is there similar example using price_data?

marble hare
#

Please do not share secret key in this public channel as it's visible for everyone ๐Ÿ™‚

#

More specifically:

SessionCreateParams params =
  SessionCreateParams.builder()
    .setMode(SessionCreateParams.Mode.PAYMENT)
    .setSuccessUrl("http://localhost:4242/success")
    .setCancelUrl("http://localhost:4242/cancel")
    .addLineItem(
    SessionCreateParams.LineItem.builder()
      .setQuantity(1L)
      .setPriceData(
        SessionCreateParams.LineItem.PriceData.builder()
          .setCurrency("usd")
          .setUnitAmount(2000L)
          .setProductData(
            SessionCreateParams.LineItem.PriceData.ProductData.builder()
              .setName("T-shirt")
              .build())
          .build())
      .build())
    .build();

Session session = Session.create(params);
blissful jay
#

thank you so much, let me try

marble hare
#

No problem! Happy to help ๐Ÿ˜„

#

I'd recommend removing your secret key in the above code

blissful jay
#

That was the code from documentation, it was not my secret key

blissful jay
#

I just created a payment, it was successful and the seller got his amount in test mode

#

But the platform fee was not received.

graceful sage
#

๐Ÿ‘‹ taking over here

blissful jay
#
@RestController
class PaymentController {

    @Value("\${stripe.apikey}")
    lateinit var stripeApiKey: String

    @PostMapping("/create-checkout-session")
    fun createCheckoutSession(): Map<String, Any> {
        Stripe.apiKey = stripeApiKey

        val params = SessionCreateParams.builder()
            .setMode(SessionCreateParams.Mode.PAYMENT)
            .setSuccessUrl("http://localhost:4242/success")
            .setCancelUrl("http://localhost:4242/cancel")
            .addLineItem(
                SessionCreateParams.LineItem.builder()
                    .setQuantity(1L)
                    .setPriceData(
                        SessionCreateParams.LineItem.PriceData.builder()
                            .setCurrency("usd")
                            .setUnitAmount(3456L)
                            .setProductData(
                                SessionCreateParams.LineItem.PriceData.ProductData.builder()
                                    .setName("T-shirt")
                                    .build())
                            .build())
                    .build())
            .setPaymentIntentData(
                SessionCreateParams.PaymentIntentData.builder()
                    .setApplicationFeeAmount(123L)
                    .setTransferData(
                        SessionCreateParams.PaymentIntentData.TransferData.builder()
                            .setDestination("acct_1MYl6BRfEAHzyOVs")
                            .build()
                    )
                    .build()
            )
            .build()

        val session = Session.create(params)
        val responseData = mutableMapOf<String, Any>()
        responseData.put("redirectUrl", session.url)

        return responseData
        
    }
}
graceful sage
#

No I meant request log on your Dashboard

blissful jay
#

I found it, thank you

#

but I need to understand the process and deductions

graceful sage
#

You would want to find the Payment Intent Id first pi_xxx

blissful jay
#

I paid 34.56 here, and received 31.56

graceful sage
#

Then view on Dashboard, it will give a details page

blissful jay
#

where are these collected fees accumulated? I am not finding it in another account

graceful sage
#

This is your Platform account correct? You can check the Payments tab and find the payment

blissful jay
#

I am a bit confused, I need to set two things, one apiKey and another destination account ID

#

I provided the destination account ID and the amount is transferred to that account

#

Where I can specify the account for the platform fee?

graceful sage
#

the key you are using is already defining the Platform account.

#

On your request if you have application_fee_amount then you are collecting that part

blissful jay
#

Sorry to ask these stupid questions. But in my case acct_1MYkJlDfJAkpzIQT, is this my platform account?

graceful sage
#

In that screen? No it should be the Connected Account

blissful jay
#

Where can I view my platform account?

graceful sage
blissful jay
#

You mean this last one? Is this my platform account?

graceful sage
#

Yes

#

= your own account

blissful jay
#

How can I view the balance in that account

#

All my collected fees should have been deposited here right? But I don't see any amount here

#

I got it thank you

#

So I can transfer to the connected accounts only?

#

When I need to send it to seller stripe account

graceful sage
#

You already using destination charge, you should have sent some amount to your connected account if you are using the application_fee_amount mentioned above

blissful jay
#

So using the destination charge we can pay to the connected accounts only right? Is there any other methods of receiving payments?

For example in cardano we have a unique address and anyone can pay me using that address

graceful sage
#

Yes you can only pay to the Connected Account specified in the Destination Charge call

#

(Please read the fund flow Doc above)

blissful jay
#

This means all sellers must have a connected account in my account