#Atish

1 messages · Page 1 of 1 (latest)

old leafBOT
trim spear
#

/```/ Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
Stripe.apiKey = "";

Map<String, Object> automaticPaymentMethods = new HashMap<>();
automaticPaymentMethods.put("enabled", true);

Map<String, Object> params = new HashMap<>();
params.put("amount", 1000);
params.put("currency", "usd");
params.put("automatic_payment_methods", automaticPaymentMethods);

params.put("application_fee_amount", 123);
RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}").build();
PaymentIntent paymentIntent = PaymentIntent.create(params, requestOptions);```

neat shoal
#

Please redact your secret key

#

this is a public forum

trim spear
#

That is sample code from website

neat shoal
#

That sample code probably takes your own secret key in, but thanks for redacting

trim spear
#

I need to set currency of application_fee_amount

trim spear
neat shoal
#

application_fee_amount would takes the presentment currency in the same call, so it's USD in your code

trim spear
# trim spear

But here it says its based on country of connected account?

trim spear
neat shoal
#

It will be transfer back

#

For example, you accept a charge for a connected account in USD. The connected account settles in EUR. The funds sent to the connected account are converted to EUR and the application fee is converted back to your platform in USD from EUR.

trim spear
#

My platform will be getting in USD but it will be equivalent to 5USD or 5EUR?

neat shoal
#

5USD I believe. You can test it easily in Test mode

trim spear
#

Thank you, let me test

trim spear
#
Stripe.apiKey = stripeApiKey
        val paymentIntent = PaymentIntent.create(
            PaymentIntentCreateParams.builder()
                .setAmount(amountInCents)
                .setCurrency(currency)
                .setApplicationFeeAmount(applicationFee)
                .setAutomaticPaymentMethods(
                    PaymentIntentCreateParams.AutomaticPaymentMethods.builder().setEnabled(true).build()
                ).build(),
            RequestOptions.builder().setStripeAccount(destinationId).build()
        )
#

I created a paymentIntent, how can I convert his paymentIntent to checkoutSession?

neat shoal
#

No you can't. PaymentIntent != CheckoutSession. You can create a Checkout Session in the first place and specify its payment_intent_data

trim spear
#

So in payment intent data what specifies direct charge or destination charge?

#

Is there any sample code for direct charge using checkout sessions?

neat shoal
#

Destination Charges means you needs the transfer_data.destination Direct Charges means you need the Stripe Account Header

#

Choose on 3 tabs