#AlexT

1 messages · Page 1 of 1 (latest)

wicked orioleBOT
stoic lotus
#

objCustomer.InvoiceSettings.DefaultPaymentMethodId = ObjIntent.PaymentMethodId

stiff shore
stoic lotus
#

This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again

#

what is the sequence of events here?

#

I want to charge and if the charge is successful then attach the payment method to the ustomre for future billing

#

Using the "Save payment details during payment"

stiff shore
#

Ah, how are you accepting payments right now? For context: you can usually setup the Payment Method to be automatically attached to the customer, and that will only happen if that payment was successful

stoic lotus
#

How do I attache it automatically?

#

It says it is saved to customer But i dont see it as default

stiff shore
#

Ahhh, okay, so the Customer already has the Payment Method attached? In other words, there is a payment_method on the customer object?

stoic lotus
#

let me check real quick

stiff shore
wicked orioleBOT
stoic lotus
#

{
"id": "cus_NmNNrDdHwAf33k",
"object": "customer",
"address": null,
"balance": 0,
"cash_balance": null,
"created": 1682439681,
"currency": null,
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "v2@atintegrated.com",
"invoice_credit_balance": null,
"invoice_prefix": "0A8467F5",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": false,
"metadata": {},
"name": "John Doe",
"next_invoice_sequence": 1,
"phone": null,
"preferred_locales": [],
"shipping": null,
"sources": null,
"subscriptions": null,
"tax": null,
"tax_exempt": "none",
"tax_ids": null,
"test_clock": null
}}

#

I got it

#

objCustomer.InvoiceSettings.DefaultPaymentMethodId = ObjIntent.PaymentMethodId
Service.Update(ObjIntent.CustomerId, Nothing)

stiff shore
#

Okay, so there is no Payment Method set. So you want to follow the step I sent above to setup the Payment Method for future usage, then check the invoice_settings.default_payment_method to make sure it's there. If it's not, you can set it explicitly by updating the customer with this API call: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method

stoic lotus
#

Hm it did nt sev

#

Ok let me try that

#

I do that already

oak harness
#

Hi taking over for two-shoes

#

Let's back up a bit