#MICOZ-subscription attempts

1 messages ยท Page 1 of 1 (latest)

wild fossil
#

๐Ÿ‘‹ happy to help

#

what is the collection_method on this subscription? send_invoice or charge_automatically?

pliant carbon
#

automatically

wild fossil
pliant carbon
#

ok ty

#

let me try

wild fossil
#

let me know if you need any more help

gloomy pebble
#

@pliant carbon what's up?

pliant carbon
#

hi

#

I have created a customer portal, everything works except that when the billing data is entered it attaches them to the customer and not to the card

#

so in my server I would have to make one more request to get the billing data and the last 4 letters of the default payment method

gloomy pebble
#

I see, and is that a blocking problem?

pliant carbon
#

it is not a problem but now if I have to request billing information I have to retrieve the customer and then the payment method to get his last 4 letters of the card

gloomy pebble
#

you can't really control the API calls the customer portal makes and how the information in the API ends up being laid out. If you could be more specific about what information you're looking for in which specific API fields and how you approach it today I could try to let you know if there is a more efficient way but there might not be

gloomy pebble
pliant carbon
#

i try to explain better

#

I need to show the user's billing information and the last 4 letters of the card on my site.

before I didn't use the client portal and I personally managed the various apis to do it,
for reasons of convenience and additional functionality I have decided to integrate the customer portal.

doing various tests I saw that when I update the billing data with the portal, your system enters them as information in the customer but not in the user's card

before to have all the data (billing and last4 letters) I used this api that gave them all together

const paymentMethods = await stripe.customers.listPaymentMethods(id, { type: 'card' })

return {
            last4: customerInfo.card.last4,
            name: customerInfo.billing_details.name,
            country: customerInfo.card.country,
            address: customerInfo.billing_details.address.line1,
            city: customerInfo.billing_details.address.city,
            postcode: customerInfo.billing_details.address.postal_code,
            phone: customerInfo.billing_details.phone
        }
#

so now i should make an extra request to get the billing data because they are saved in the customer now

#

I would have preferred to do just one api as before to decrease the load on the server and increase the speed

gloomy pebble
#

your system enters them as information in the customer but not in the user's card
can you clarify where on the customer it enters them? What API field are you seeing the information contained in?

#

are you saying it saves the address to customer.address for example? (instead of on the PaymentMethod billing_details as you want?)

pliant carbon
#

exactly

gloomy pebble
#

if that's how it works it's just how it works I'm afraid, there's nothing you can really do about it or avoid the extra call

pliant carbon
# pliant carbon exactly

the solution could be that when you add a new card you also ask for the billing information along with it

gloomy pebble
#

custmer.address is meant for the customer's overall top-level address, but a customer might have different cards with different billing addresses. I'd assume the UI for the portal makes some distinction there , not really familiar with it. But that's why there are two different places in the API for this information

pliant carbon
#

true, I will do one more request to get the information of the default payment method

#

last thing

#

mainly I wanted to add the portal for this reason.
#dev-help message

so if the user enters in this phase and wants to renew immediately after the first debit failure, will a screen appear on the subscription as shown in the picture?

#

because at the moment in the customer portal I only see my subscriptions (I am not in this case at the moment (charges attempt))

#

I therefore assume that the customer will see something to renew immediately if the first attempt at auto-renewal has failed

gloomy pebble
#

they can see all their open Invoices and visit a page to try to pay those invoices(including entering new payment information)

pliant carbon
#

perfect

#

is there an api that shows how many attempts have been made?

gloomy pebble
pliant carbon
#

ok perfect

#

thanks a lot guys

#

one last thing and no longer bother you promised ahaha

#

if i want to migrate a subscription from one user to another what can i do?

gloomy pebble
#

you'd create a new subscription for the other customer, and cancel the existing subscription on the old one, there's not really any inbuilt support for a direct migration