#Atish
1 messages · Page 1 of 1 (latest)
/```/ 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);```
That is sample code from website
That sample code probably takes your own secret key in, but thanks for redacting
I need to set currency of application_fee_amount
I was not knowing that, thank you
application_fee_amount would takes the presentment currency in the same call, so it's USD in your code
But here it says its based on country of connected account?
Is there any way I can specify it as well?
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.
My platform will be getting in USD but it will be equivalent to 5USD or 5EUR?
5USD I believe. You can test it easily in Test mode
Thank you, let me test
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?
No you can't. PaymentIntent != CheckoutSession. You can create a Checkout Session in the first place and specify its payment_intent_data
So in payment intent data what specifies direct charge or destination charge?
Is there any sample code for direct charge using checkout sessions?
Destination Charges means you needs the transfer_data.destination Direct Charges means you need the Stripe Account Header
Sure here https://stripe.com/docs/connect/creating-a-payments-page?platform=web&ui=checkout#accept-a-payment
Choose on 3 tabs