#stripe

/

      • bg
        Hello. When I update a customer's default source, unpaid invoices are not being re-tried as described here: https://stripe.com/docs/api#update_customer . I checked 1) the subscription is past due. 2) the latest invoice on the subscription is not closed and not paid. Is there anything else I should check?
      • koopajah
        bg : this is expected behaviour
      • the only time where they are retried is if you explicitly *replace* the default source by a new card by passing `source: tok_XXXXX`
      • saurabhjha has quit
      • irctc425
        I'm trying to present STPShippingAddressViewController, though it shows up blank. And i am passing the prefill info: let shippingAddressViewController = STPShippingAddressViewController(configuration: STPPaymentConfiguration.shared(), theme: STPTheme.default(), currency: "USD", shippingAddress: address, selectedShippingMethod: nil, prefilledInformation: prefill)
      • bg
        @koopajah My stripe api call (using node) looks like: `stripe.customers.update(organization.stripeCustomerId, { source: token.id })` Is this different from what you are saying?
      • koopajah
        bg : no this should work and automatically retry past due invoices. If the invoices are *unpaid* and not *past_due* this is also expected. We never retry unpaid invoices
      • irctc425 : you might want to ask our support team: https://support.stripe.com/email
      • bg
        koopajah : the documentation states that the subscription must be `past_due` (which I confirmed). I don't see a "status" on the invoice. However I do see: `attempted: true, closed: false, paid: false, forgiven: false`
      • koopajah
        bg : Unfortunately I'm at the limit of what I can guess. I'd need a lot more details to find out what happened
      • aloha_ joined the channel
      • bg
        can you explain really quickly what "If the invoices are *unpaid* and not *past_due* this is also expected." means? How can an invoice be past_due?
      • koopajah
        an invoice is past_due if it has been attempted once but has not exhausted all retries.
      • An invoice is unpaid if it has exhausted all retries or if the subscription went in the unpaid state before
      • mezod joined the channel
      • bg
        Is there a way to check if the invoice is past due vs unpaid? I don't see any type of "status" field on the invoice object described here: https://stripe.com/docs/api#invoice_object
      • koopajah
        the invoice would have `closed: true`
      • bg
        ok thanks. My invoice has `closed: false`. I'll keep looking into this. Thanks for your help.
      • koopajah
        if you give me a customer id I can check
      • timebox has quit
      • timebox joined the channel
      • CC2 joined the channel
      • CC2
        hi, is it possible to test a live stripe account for purposes of integration? if so, how?
      • aloha_
        Hi, I am having “An SSL error has occurred and a secure connection to the server cannot be made.” error during subscription in iOS app. It reproducible only on one particular device for all accounts. Do you have any ideas why it happens?
      • Oscwar joined the channel
      • koopajah
        CC2 : to test, you use your Test API keys
      • aloha_ : likely that this device is too old and can't handle TLS requests properly
      • CC2
        would i need to turn stripe into test mode for that though?
      • koopajah:
      • Oscwar
        Hi, are there any plans to roll out stripe for country dependencies?
      • santiago_
        How can I get an STPSource from an STPCard on iOS? I'm trying to get the metadata on a Card object.
      • koopajah
        CC2 : no you do not. The only thing that matters is your API keys in your code
      • Oscwar : what do you mean "country dependencies"?
      • santiago_ : they are not the same thing, an STPCard is a card and an STPSource is a Source
      • CC2
        koopajah: thank you!
      • santiago_
        Isn't a Card a form of Source?
      • koopajah
        santiago_ : it is not, they are entirely separate object
      • irctc425 has quit
      • santiago_
        Is there any way to get the metadata I can set on a Card from the Java API?
      • On iOS?
      • aloha_
        koopajah : it was working fine a few days ago, iphone6 with ios10
      • koopajah
        santiago_ Unfortunately I do not know I'm sorry. You'd have to ask our support team: https://support.stripe.com/email
      • aloha_ : you'd need to debug this by trying to get more details about the request. Otherwise, you'll likely need to write to our support team: https://support.stripe.com/email and provide detailed information about your device and its IP and the exact time where the request happened
      • saurabhjha joined the channel
      • with the IP Address we might be able to find it in our logs and confirmed what happened
      • bg
        koopajah : the customer that I was having the invoice retry issue with is cus_BPFPoCfUQGGbpK and the subscription is sub_BU7fZaEuJZTGrH
      • koopajah
        bg : gotcha. Looking but that customer has a ton of attempts/logs so unlikely that I can debug much :(
      • bg
        ok sorry about that. I'll try to reproduce on a new customer. Thanks again
      • koopajah
        which invoice did you expect it to retry?
      • CC2 has quit
      • suchit has quit
      • bg
        invoice in_1B79RcIcHQyOizF7tehUIgWD
      • Oscwar has quit
      • saurabhjha has quit
      • timebox
        bg: What's the issue you're running into there?
      • koopajah
        his invoice is not attempted even though he explicitly does https://stripe.com/docs/api#update_customer + source: tok_XXXX
      • bg
        The invoice was not retried after updating the default source
      • koopajah
        will let you in timebox capable hands as I have to run. Thank you timebob ;)
      • timebox
        bg: Ok, and are you certain the Source of that Customer was updated?
      • bg
        ok thank you koopajah!
      • koopajah has quit
      • timebox
        bg: Like, are you sure the Customer's Source was updated after that Invoice was created?
      • bg
        yes. I think I just messed up that customer by adding a bunch of new events. I'm going to try to reproduce on a clean customer. thanks :)
      • timebox
        bg: Cool. I would definitely confirm that the Source was actually added to the Customer after the original failed payment. :)
      • stripe043 has quit
      • bg
        timebox: I'm still seeing the issue on a clean customer and I confirmed that the source was changed. Customer: cus_BU8sdwoFTLBHGr, invoice: in_1B7AcSIcHQyOizF79B8ouT3U, subscription: sub_BU8sg8oApmCIjC. the event where I changed the source is: evt_1B7Ae8IcHQyOizF7eIfmfN7p
      • to be clear I changed the source with `stripe.customers.update(organization.stripeCustomerId, { source: token.id })` in node, and that is the event stripe created for me
      • timebox
        bg: Can you share the code you're using for all of this in a Gist or Pastebin?
      • bg: Ok, so ... wait one.
      • bg: The Invoice ID you've listed above was created after the source update.
      • bg: Are you trying to update the Invoice after you add the Source?
      • bg
        hm I'm not seeing that. I don't touch the invoice after changing the source
      • saurabhjha joined the channel
      • timebox
        bg: Look at the Logs in the Customer details page. You can see the order in which the things were POSTed.
      • bg
        Hm those logs aren't showing the request to update the default source
      • timebox
        bg: the second in the list does. The top of the list (i.e., the most recent) is creating the Invoice you've referenced above.
      • bg
        In the "Events" section I see that the default source changed at 15:38:20
      • but the most recent entry in the "Logs" section is at 15:36:37
      • saurabhjha has quit
      • the update you see in the "Logs" section is when I updated the source to have an invalid card before creating the new invoice
      • but 2 minutes after creating the new invoice I updated the source again (to a valid card), and the invoice was not retried
      • timebox
        bg: Ok, I see what you're saying now. That's weird.
      • bg
        This is the relevant event log I see: https://i.imgur.com/HM4NkUt.png . Not sure why the log of events is missing the most recent source update
      • timebox
        bg: So, I'm not sure we automatically retry like that if there are retries left in your settings. Hmmm.
      • bg: Does the same thing happen if you set your Dashboard Retry settings to 'no retries', 'past due'?
      • bg: Like, in this case, it's going to automatically be retried per your settings anyways, so I think we just leave it to that timeline; I'm wondering if the 'automatically retry on source change' thing is limited to already-fully-failed invoices?
      • bg
        I can try. @koopajah was actually telling me the opposite earlier :) "bg : no this should work and automatically retry past due invoices. If the invoices are *unpaid* and not *past_due* this is also expected. We never retry unpaid invoices"
      • timebox
        bg: Also, this isn't a scheduled attempt that's failing - it's a manual attempt, right?
      • bg
        that's correct
      • timebox
        bg: Oh, ok - so 'unpaid' != 'past_due'.
      • bg
        timebox: do you want me to try changing my retry rules to 'stop trying to collect payment and...' 'mark the subscription as unpaid'
      • imode joined the channel
      • prgmmr has quit
      • timebox: the payment failed when I manually attempted to pay the invoice using this api call in node: stripe.invoices.pay(invoice.id)
      • timebox
        bg: Riht. I don't think that has the same effect on our side as letting it try automatically.
      • bg
        so manually paid invoices are not automatically retried when the customer's default source is updated?
      • timebox
        bg: You're also manually creating this invoice; it's not being generated by a Subscription. I don't think in this case it works the same way as it does when they're automatically generated/attempted.
      • bg
        so "then the latest unpaid, unclosed invoice for the subscription will be retried" from https://stripe.com/docs/api#update_customer should really say "then the last unpaid, unclosed, automatically generated and attempted invoice for the subscription will be retried"?
      • timebox
        bg: It's sort of looking that way - at least I'm able to reproduce that behavior.
      • subleq joined the channel
      • bg: I _think_ this means the latest Invoice generated for/by the Subscription; not necessarily one created manually but associated with the Subscription. Hmm.
      • bg
        timebox: Should I just retry the invoices on my end when the source is updated instead of counting on stripe to do it?
      • schutt joined the channel
      • subleq
        I'm not finding a reasonable way to change the quantity on an subscription that's cancelled with at_period_end=True while actually billing the user for the increase
      • schutt
        hello. quick question: is it possible to block charges that originate outside of the US?
      • timebox
        subleq: Can you update the quantity of a Subscription set to cancel at period end?
      • subleq: Does it create Invoice Items?
      • subleq
        not without reactivating the subscription
      • emsearcy has quit
      • timebox
      • irctc142 joined the channel
      • irctc142
        Shouldn't the STPShippingAddressViewController, have a done button instead of a Next?
      • subleq
        support recommended i reactivate the subscription, change the quantity, invoice the user, then cancel it again...doesn't seem very nice. I'm worried about that period while the subscription is active, what if my power goes out then?
      • saurabhjha joined the channel
      • timebox
        subleq: If ... your power goes out? I'm not sure I follow.
      • subleq: But that's pretty much what you'll have to do in this case.
      • subleq
        timebox: if the code fails for any reason during that time
      • the subscription is left in an incorrect state
      • timebox
        subleq: I guess that's true. The same holds true for a 'power cut' between when they submit the cancellation request in the web browser and when your application has submitted it to Stripe though, right?
      • subleq
        timebox: nope. they would never get a message saying their subscription was cancelled, and would try again
      • timebox
        subleq: I guess that's true. So you need to wrap those steps up in a 'transaction' of sorts, and keep track of the state of that transaction so you can pick up where you left off if something happens.
      • subleq
        right
      • ideally the call to modify the subscription would be able to just do it without reactivating the subscription
      • timebox
        subleq: Right, but it can't.
      • saurabhjha has quit
      • bg: So I'm not really sure what's up here. I think it's happening because these Invoices aren't auto-generated, but I'm not certain. It might be worth writing into Support (https://support.stripe.com/email/login) and detailing the issue; they should be able to figure out what's going on here.
      • bg
        timebox: Ok thank you very much for your help. You guys are champs :)
      • timebox
        bg: You're very welcome - sorry I didn't have a better answer for you, but I'm really curious to find out what the answer is. :)
      • emsearcy joined the channel
      • schutt has quit
      • irctc142
        Is STPPaymentMethodsViewController and STPShippingAddressViewController only meant to be shown upon the actual payment?
      • timebox
        irctc142: I don't believe so. STPPaymentMethodsVC is used so Customers can update their payment sources, I think.
      • irctc142
        timebox: i was thinking cus, the shippingVC has a next button which leads to the shipping method, like Fedex or UPS.
      • timebox
        irctc142: That makes sense. I'm unfortunately not really up on the iOS library. :(
      • irctc142
        timebox: no worries! I'll def shoot Stripe an email. I was just wondering before I go and make my own payments and shipping page.
      • timebox
        irctc142: I'm pretty sure that's what they're for, but Support can confirm.
      • irctc142: You've read through this, right? https://stripe.com/docs/mobile/ios/custom
      • benjidurden joined the channel
      • benjidurden
        hi all! is anyone here right now?
      • irctc142
        timebox: maybe you can answer this: When i add a card via the STPPaymentMethodsViewController, it adds fine. I can see it on my dashboard. BUT when i add the card WITH a billing address i get an error saying "You did not provide an API key, though you did set your Authoriztion header to "Bearer"...etc
      • timebox: yes i've read it
      • timebox
        irctc142: That seems weird. I ... have no idea why that might be hapening so I'd suggest you write into Support about that one: https://support.stripe.com/email/login
      • benjidurden
        Just curious but do I need my site to be 100% up and running to send a Stripe approval request for it? I'm in the process of developing something and was just curious about that
      • timebox
        benjidurden: What do you mean by a 'Stripe approval request'?
      • Philip_ joined the channel
      • Philip_
        Question for any developers hanging out here:
      • Is it possible to do a one-time charge on an existing customer without storing the credit card details?
      • benjidurden
        timebox: When sending a Stripe application - do I have to have a live and functional app for my request to be granted?
      • Philip_
        Ben: I didn't have a working application before getting a Stripe account.
      • benjidurden
        gotcha. Many thanks!