#papazov9_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1303358077776695296
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- papazov9_webhooks, 5 days ago, 17 messages
hello
hi there! what docs did you read that said to call the API that way?
https://docs.stripe.com/payments/bank-transfers/accept-a-payment?payment-ui=direct-api&invoices=without&country=eu&lang=node#web-create-and-confirm-payment-intent should the working example.
I am attaching what cannot be send
PaymentIntentCreateParams.PaymentMethodOptions paymentMethodOptions =
PaymentIntentCreateParams.PaymentMethodOptions.builder()
.setCustomerBalance(customerBalanceOptions)
.build();
// Build PaymentIntentCreateParams with customer_balance
PaymentIntentCreateParams params = PaymentIntentCreateParams.builder()
.setAmount(paymentSessionRequest.price()) // Stripe expects the amount in the smallest currency unit
.setCurrency("eur")
.setCustomer(stripeCustomerId)
.addPaymentMethodType(PaymentIntentCreateParams.PaymentMethodType.CUSTOMER_BALANCE) // Use enum instead of raw string
.setPaymentMethodOptions(paymentMethodOptions) // Set the customer_balance options
.build();
// Create the PaymentIntent
PaymentIntent paymentIntent = PaymentIntent.create(params);
i first try the way docs are but there is nothing specific abot bank transfer but only this:
PaymentIntentCreateParams params =
PaymentIntentCreateParams.builder()
.setCustomer
("{{CUSTOMER_ID}}"
)
.setAmount
(1099L)
.setCurrency
("bgn")
.setSetupFutureUsage
(PaymentIntentCreateParams.SetupFutureUsage.OFF_SESSION)
.setAutomaticPaymentMethods
(
PaymentIntentCreateParams.AutomaticPaymentMethods.builder().setEnabled
(true).build()
)
.build();
and afterwards start searching and combining some ways
i will take a look at this docs a
sounds good, I'd recommend using the guide in the docs yep!
yep, the page I linked has Java snippets(make sure to adjust the language in the top-right of the snippets)
com.stripe.exception.InvalidRequestException: The PaymentMethod provided (customer_balance) is not allowed for this PaymentIntent. Please attach a PaymentMethod of one of the following types: card. Alternatively, update the allowed payment_method_types for this PaymentIntent to include "customer_balance".; request-id: req_DNWUSyXd1rg7bP
i implmented it as in the exampel and received this
exactly the same:
PaymentIntentCreateParams params = PaymentIntentCreateParams
.builder()
.setAmount(paymentSessionRequest.price())
.setCustomer(stripeCustomerId)
.setCurrency("eur")
.setAutomaticPaymentMethods(
PaymentIntentCreateParams.AutomaticPaymentMethods
.builder()
.setEnabled(true)
.build())
.setReturnUrl("http://localhost:4200/payment-pending")
.setPaymentMethodData(PaymentIntentCreateParams.PaymentMethodData.builder()
.setType(PaymentIntentCreateParams.PaymentMethodData.Type.CUSTOMER_BALANCE)
.build())
.setConfirm(true)
.build();
PaymentIntent paymentIntent = PaymentIntent.create(params);
does it work if you remove setAutomaticPaymentMethods(...) and instead do setPaymentMethodTypes() with a List of "customer_balance" ?
i am trying it rn
com.stripe.exception.InvalidRequestException: No such PaymentMethod: 'customer_balance'; code: resource_missing; request-id: req_UERWtfZ6sQXU0R
there is no setPaymentMethodTypes but jsut setPaymentMethod
PaymentIntentCreateParams params = PaymentIntentCreateParams
.builder()
.setAmount(paymentSessionRequest.price())
.setCustomer(stripeCustomerId)
.setCurrency("eur")
.setPaymentMethod("customer_balance")
.setReturnUrl("http://localhost:4200/payment-pending")
.setPaymentMethodData(PaymentIntentCreateParams.PaymentMethodData.builder()
.setType(PaymentIntentCreateParams.PaymentMethodData.Type.CUSTOMER_BALANCE)
.build())
.build();
yes there is no such thing like setPaymentMethodTypes
ah yeah we removed that from the SDK, great...
in that case
PaymentIntentCreateParams
.builder().putExtraParam("payment_method_types[0]", "customer_balance")
...
and if so can you explain to me how exactly this customer balance works
PaymentIntentCreateParams params = PaymentIntentCreateParams
.builder()
.setAmount(paymentSessionRequest.price())
.setCustomer(stripeCustomerId)
.setCurrency("eur")
.putExtraParam("payment_method_types[0]", "customer_balance")
.setPaymentMethodData(PaymentIntentCreateParams.PaymentMethodData.builder()
.setType(PaymentIntentCreateParams.PaymentMethodData.Type.CUSTOMER_BALANCE)
.build())
.build();
sure this succeed creating a payment intent but now i have this logic where i get the iban from the payment intent or at least try and now it is skipped because there is no next action
if (paymentIntent.getNextAction() != null && paymentIntent.getNextAction().getDisplayBankTransferInstructions() != null) {
String iban = getIban(paymentIntent);
File file = PDFWriterUtil.generateProFormaInvoicePDF(paymentSessionRequest, iban);
String body = "Dear Customer,\n\nPlease find attached your pro forma invoice. " + "Kindly complete the bank transfer to the provided IBAN to proceed with your order.\n\n" + "Thank you,\nUnparalleled Team.";
this.emailService.sendEmail(paymentSessionRequest.contactEmail(), "Payment details", body, file);
}
can you explain it to me how this should be done in a way that works with pro forma invocie which will be send to the customer which to send money to the given iban and we create a invoice for a succesful payment
there's no next_action because you didn't pass setConfirm(true) when creating the PaymentIntent
add that in and you will have next action and then you can follow the guide : https://docs.stripe.com/payments/bank-transfers/accept-a-payment?payment-ui=direct-api&invoices=without&country=eu&lang=java#web-complete-bank-transfer
thanks
com.stripe.exception.CardException: The customer balance is insufficient to complete the payment. Please change the amount or provide the funding_type parameter.; code: ; request-id: req_ESBriPF8C093o4
i want each transaction to be through the cutomer's desired bank , which i think we haev to funding type or i do not understand the way how customer balance is working can someone explain it to me
PaymentIntentCreateParams params = PaymentIntentCreateParams
.builder()
.setAmount(paymentSessionRequest.price())
.setCustomer(stripeCustomerId)
.setCurrency("eur")
.putExtraParam("payment_method_types[0]", "customer_balance")
.setReturnUrl("http://localhost:4200/payment-pending")
.setPaymentMethodData(PaymentIntentCreateParams.PaymentMethodData.builder()
.setType(PaymentIntentCreateParams.PaymentMethodData.Type.CUSTOMER_BALANCE)
.build())
.setConfirm(true)
.build();
PaymentIntent paymentIntent = PaymentIntent.create(params);
this is the config which throws exception
hello?
Hey there, just stepping in as karllekko had to step away, give me a few minutes to review
sure. sorry
That customer does not appear to have any existing balance, so you can't confirm the payment. If you intent to collect funds via bank transfer, you need to provide additional details confirm the payment:
https://docs.stripe.com/payments/bank-transfers/accept-a-payment?payment-ui=direct-api&integration=pm-manual#web-create-and-confirm-payment-intent
Specifically, you're not including any of these details:
.setPaymentMethodOptions(
PaymentIntentCreateParams.PaymentMethodOptions.builder()
.setCustomerBalance(
PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.builder()
.setFundingType(
PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.FundingType.BANK_TRANSFER
)
.setBankTransfer(
PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.builder()
.setType(
PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type.US_BANK_TRANSFER
)
.build()
)
.build()
)
.build()
)
i assume if i am working with eur and am in eu instead of US_BANK_TRANSFER i can use EURO_BANK_TRANSFER
EU*
.putExtraParam("payment_method_types[0]", "customer_balance") adn does this still has to be put
Yes, EU for eur bank transfers. Sorry, meant to switch to that based on your request
Whether you specify types manualy or using automatic payment methods is up to you
The docs show both approaches
com.stripe.exception.InvalidRequestException: Missing required param: payment_method_options[customer_balance][bank_transfer][eu_bank_transfer].; code: parameter_missing; request-id: req_5GMIkKadvh0akJ
received this error
this is the whole payment intent setup
everything seems as the one you sent
Switch to the EU tab in the docs
You need to include another detail for EU to specify customer country
eu_bank_transfer: {
country: 'FR',
},
or
.setBankTransfer(
PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.builder()
.setType(
PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.Type.EU_BANK_TRANSFER
)
.setEuBankTransfer(
PaymentIntentCreateParams.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer.builder()
.setCountry("FR") /// <------ THIS
.build()
)
.build()
)
.build()
sure
sure so maybe we have to switch to usd because i am from bg and it is expected most of the customers to also be from bulgaria but from what i see buglaria is not supported
but i think this will work
just one last question is there some workournd so eu bank transfer to work with bg somehow
EU transfers should be supported for all SEPA countries, which includes bulgaria
https://stripe.com/en-ca/resources/more/sepa-country-list#which-countries-are-in-the-sepa-zone
Are you encountering errors?
yes i received an exception that the bulgaria is not in the supported countries and the given supported countries were NL, BE, FR and etc..
Can you share that erroring request ID please?
com.stripe.exception.InvalidRequestException: The country provided (BG) is not supported for eu_bank_transfer details. eu_bank_transfer details can be provided with the following countries: BE, DE, ES, FR, IE, or NL.; request-id: req_nn1OtYRXE8vgGT
Ah, right
ok:
Set payment_method_options[customer_balance][bank_transfer][eu_bank_transfer][country] to one of BE, DE, FR, IE or NL. The IBAN displayed to the customer is localized to the chosen country.
This is to localize the IBAN for the customer, so you can use their country if available, or yours, or default to another such an IE
The customer should still be able to transfer to it without issue, its just aesthetic preference to show a domestic IBAN when available
The transfer payment option is supported for all sepa countries, but we cant offer local IBANs in all of them
sure then how to set it up right now
The list there is the countries where we can localize ibans
pick one of the other countries
alright
and when they transfer the money i will receive them in my stripe account right
Yes, its just the IBAN country of the receiver account
but it always directs to you / your customer's balance in your account
and there will no problem if the customer with bg bank account send a bank trasnfer to to french bank account
sure
There should not be, no
so can you explain how those cutomer balnce accounts works in stripe necause i am a bit confused
stripe create a customer balance account for each one of my customers right?
Yes, each will get a cash balance using this approach
please review here: https://docs.stripe.com/payments/customer-balance#cash
so do they need some interaction with stripe or it is just the way stripe finishing payments
because i jsut want from the customers to send the money through their bank accounts i do not want to make their life harder with using stripe directly
and also when they send the money and payment_intent.succeed webhook is reached will an invoice be created automatically?
Sorry for the endless question but it is easier to be clarified by you at once, instead of reading endless docs
You provide them funding instructions for that IBAN however you like. Payment Element can show it, or you can show it manually, then they trasnfer funds, yea