#jitendra6425

1 messages · Page 1 of 1 (latest)

slender sphinxBOT
#

Hello! We'll be with you shortly. 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.

umbral condor
#

hello! we'd prefer to start a new thread. How can I help?

tired oyster
#

now suppose next year customer try to pay how can i make sure the card details he is entering is already save with us in Stripe?
i want to avoid duplicate payment method
i have check one video on youtube but they suggest to create payment method first

#

how i can do it, when user click on submit button?

umbral condor
#

For your use case, after you create a payment method, you can probably check the card fingerprint. You could list out the attached card fingerprints for the customer, if you find one that's the same, you would use the already attached payment method instead.

personally, I think i would approach this differently - I would display a list of existing payment methods for the customer to choose from and make payment. If they do decide to key in the same card (details) again to make payment, that's fine and up to the customer. Similarly, I would allow the customer to delete (detach a existing payment method).

tired oyster
#

I am not creating payment method, it will automatically created by Stripe if i set off_session for future usage.
about your approach i can't implement it because i don't have my customer details until customer click on submit payment button, i don't have any login for customer. they can checkout without login into my system. once they click on submit then based on data saved in my system i am checking this is firsttime user or making second payments

umbral condor
#

there's no way to prevent creating a new Payment Method if you set setup_future_usage and collect the card details.

You would want to require a customer to login / register prior to making payment. If they don't register/login prior to payment, then they should be considered as a one-time payment and I wouldn't bother saving their payment method details or checking if it already exists.

tired oyster
#

ok, let me know how can i create payment method using above implement method?

#

so first i will create payment method and i will check fingerprint manually and if it's matched then i will delete newly created method and take payment from old method which fingerprint matched.

umbral condor
tired oyster
#

it will work for both card and sepa?

umbral condor
#

theoretically yes, i reccomend testing it out to make sure it works as expected

tired oyster
#

ok, now how can i take mandate from customer for SEPA future usage?

umbral condor
#

If you're using the Payment Element, and pass in setup_for_future usage, the mandate should automatically be generate/created and you don't need to do anything additional

tired oyster
#

wow.

#

but in that case, what if i want to store customer bank details into my database?

umbral condor
#

can you elaborate more on why you would want to do so?

tired oyster
#

suppose if we are using multiple payment gateway like otherthan stripe then i need those bank details.
sometime we are direct taking bank details from customer on call and initiate SEPA manually

shrewd pike
#

For SEPA, you can collect the bank details yourself instead of using Stripe elements and save them in your database. Upon making the payment, those bank details can be submitted to the payment intent: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data-sepa_debit

If the SEPA information is collected through Stripe elements, raw bank details will not be returned

#

Payment method information collected using Stripe elements will only stay within Stripe that raw data will not be returned

tired oyster
#

by default sepa asking for many address relared fiedls how can i remove few fields from form?

#

and how can i set default value to stripe form, for example customer email and address line 1 i want prefill then how can i do?

shrewd pike
#

by default sepa asking for many address relared fiedls how can i remove few fields from form?
If the address has been collected, address fields can be disabled with fields.billingDetails.address to never, then manually pass the self-collected address when confirming the payment. Billing address is required for IBANs with the country codes AD, PF, TF, GI, GB, GG, VA, IM, JE, MC, NC, BL, PM, SM, CH, and WF [0]

and how can i set default value to stripe form, for example customer email and address line 1 i want prefill then how can i do?
Pre-filling the Payment Element can be done via defaultValues.billingDetails at Payment Element creation: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues-billingDetails

[0] https://stripe.com/docs/payments/sepa-debit/accept-a-payment?platform=web&ui=element#web-submit-payment

Learn to accept SEPA Direct Debit payments.

tired oyster
#

is there any way manually we can ask for mandate to customer?

shrewd pike
tired oyster
shrewd pike
#

When you reach step, Payment Element in Stripe.js should have been rendered. The fields I mentioned above should be set in the options of Payment Element creation. For example,

options = {
 ...
} 

const paymentElement = elements.create('payment', options);
tired oyster
#

perfect it's working fine. thank you

shrewd pike
#

No problem! Happy to help 😄

tired oyster
#

stripe.paymentMethods can i delete payment method using this api?
stripe.paymentMethods.delete

shrewd pike
tired oyster
#

so if any payment method i created and didn't attach with any customer it will remain as it is on Stripe?

shrewd pike
#

Yes

tired oyster
#

actually to avoid duplicate payment method now i am checking newly created payment methods with customer existing methods and if any fingerprint match then i want to delete newly created method

shrewd pike
#

A payment method can't be deleted

tired oyster
#

ok

tired oyster
#

is there any way i can get indication of Payment form is loaded? i am using below method so "Submit" button visible first on screen and after 3-5 second actual payment form is load from Stripe. so until stripe form is not visible i also want to hide by "Submit payment" button
https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=payment#create-pm

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.