#Sarvesh

1 messages · Page 1 of 1 (latest)

limpid otterBOT
lime hamlet
#

Hi

rain wedge
#

Hi

lime hamlet
#

How can I help?

rain wedge
#

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

lime hamlet
#

Hmm, not sure if that is possible. Let me check

#

That will replace the address fields on the Payment Element

rain wedge
#

var addressElement = elements.create('address', {
mode: 'billing',
country:'US',

});
#

like this?

lime hamlet
#

The param is allowedCountries (e.g. ['US']). See the link

rain wedge
#

var addressElement = elements.create('address', {
mode: 'billing',
allowedCountries: ['US'],
});

#

is this correct way?

#

still its showing country box with all country names

lime hamlet
#

Can you share an example?

rain wedge
#

//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;
    }
lime hamlet
rain wedge
#

what needs to change here?

static haven
#

you have to add addressElement.mount("#address-element"); after creating the element

rain wedge
#

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_fee
100,
'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?

static haven
#

I don't know what you mean by 'bank accounts' exactly.

rain wedge
#

pay by card or bank account

#

payment_method_types' => ['bancontact', 'card', 'eps', 'giropay', 'ideal', 'p24', 'sepa_debit', 'sofort'],

static haven
#

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).

rain wedge
#

ok, we already tested payment intent transactions using CARD type, but want to also test with us_bank_account supported to USA $$

static haven
#

cool, so what is blocking you?

rain wedge
#

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?

static haven
#

can be given in the payment_method_types array?
it can, but why not just use the automatic feature?

static haven
rain wedge
#

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?

rain wedge
#

ok

#

connect/accounts/acct_1M8HP4PKLWjZqDXN/activity
Restricted
Payments: Enabled
Payouts: Disabled

#

what needs to complete for this connected account?

static haven
rain wedge
#

{
"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

static haven