#Sarvesh
1 messages · Page 1 of 1 (latest)
Hi
Hi
How can I help?
this form is shown from PaymentIntegent direct charges object and we want to show only USA country and not others
what needs to do to only show US in country box
Hmm, not sure if that is possible. Let me check
You probably want to use the (new) Address Element, where you specific allowedCountries: https://stripe.com/docs/js/elements_object/create_address_element#address_element_create-options-allowedCountries
That will replace the address fields on the Payment Element
var addressElement = elements.create('address', {
mode: 'billing',
country:'US',
});
like this?
The param is allowedCountries (e.g. ['US']). See the link
var addressElement = elements.create('address', {
mode: 'billing',
allowedCountries: ['US'],
});
is this correct way?
still its showing country box with all country names
Can you share an example?
//const stripe = Stripe('pk_test_51LcWQoALTlZ8nxc3GJK8QkvCP3La9KU8BHrcFljOTyJpWFMnzP9l9JAwelvy6IvdmdOddsZx4YzENuYnsQTRLO6200mbv2lMGT');
const options = {
//clientSecret: 'pi_3LxrOoPBvk5urIAm1SHRzv94_secret_jF2b17xNSTjKIPFLa3XPwZMZi',
clientSecret: '{{ $paymentIntent->client_secret }}',
// Fully customizable with the Appearance API
appearance: {
/.../
theme: 'stripe',
},
};
// Set up Stripe.js and Elements to use in checkout form using the client secret
const elements = stripe.elements(options);
var addressElement = elements.create('address', {
mode: 'billing',
allowedCountries: ['US'],
});
// Create and mount the Payment Element
const paymentElement = elements.create("payment");
paymentElement.mount("#payment-element");
const form = document.getElementById('payment-form');
form.addEventListener('submit', async (event) => {
event.preventDefault();
if (!stripe || !elements) {
// Stripe.js has not yet loaded.
// Make sure to disable form submission until Stripe.js has loaded.
return;
}
You haven't mounted the Address Element. See: https://stripe.com/docs/elements/address-element/collect-addresses?platform=web#add-the-address-element-to-your-page
what needs to change here?
you have to add addressElement.mount("#address-element"); after creating the element
ok, I will check try this
in test mode, along with card, I want to check /test for Bank accounts with test data for payment intent object
$paymentIntent = PaymentIntent::create([
'amount' => $eventRegData->total_amount100,
'currency' => 'usd',
'application_fee_amount' => $eventRegData->platform_fee100,
'transfer_group' => 'directCharges_'.$eventRegData->id,
'automatic_payment_methods' => ['enabled' => true],
//'payment_method_types' => ['bancontact', 'card', 'eps', 'giropay', 'ideal', 'p24', 'sepa_debit', 'sofort'],
'metadata' => [
'event_id' => $eventId,
],
], ['stripe_account' => $connectedAccountId]);
how to enable the bank accounts or Gpay, apple pay etc?
I don't know what you mean by 'bank accounts' exactly.
pay by card or bank account
payment_method_types' => ['bancontact', 'card', 'eps', 'giropay', 'ideal', 'p24', 'sepa_debit', 'sofort'],
what does bank account mean exactly?
we support multiple types of bank account payment, have a look through https://stripe.com/docs/payments/bank-debits and see what values those are (like us_bank_account for US ACH payments, sepa_debit for EU SEPA payments, etc).
ok, we already tested payment intent transactions using CARD type, but want to also test with us_bank_account supported to USA $$
cool, so what is blocking you?
automatic_payment_methods' => ['enabled' => true],
even after this, I could not see the Tabs to select pay by Card / Bank Account
show to enable it in Stripe Account settings or can be given in the payment_method_types array?
how to enable it in Stripe Account settings
you'd enable things in https://dashboard.stripe.com/test/settings/payment_methods
can be given in the payment_method_types array?
it can, but why not just use the automatic feature?
if you're using Connect remember you have to enable the method for the connected account
ok, just enabled ACH Direct Debit on the link you shared above, it asks for Webhook Recommended so can I activate webhook from Stripe? which webhook is needed for this?
or webhook subscribe only from the code level?
ok
connect/accounts/acct_1M8HP4PKLWjZqDXN/activity
Restricted
Payments: Enabled
Payouts: Disabled
what needs to complete for this connected account?
you can retrieve it from the API and look at the requirements hash to see exactly what's needed. https://stripe.com/docs/connect/identity-verification-api#determining-if-identity-or-business-verification-is-needed
{
"alternatives": [],
"current_deadline": null,
"currently_due": [],
"disabled_reason": "requirements.pending_verification",
"errors": [],
"eventually_due": [],
"past_due": [],
"pending_verification": []
}
it was enabled when I conneted it and after couple of payment transactions payouts got disabled
requirements.pending_verification Stripe is currently verifying information on the connected account.