Hi, we have a platform with managed accounts. We're talking to someone who uses PayPal now and we're trying to move them to our platform (which uses Stripe). On Paypal essentially once someone pays, they are able to withdraw those funds the day of, then they are typically in their checking account the nest business day. With Stripe, it takes 1-2 days for the funds to move from Pending to Available, then, and it takes an additional
jgoldberg joined the channel
I want to make sure I understand why it takes that long
are there additional security checks that are happening that make it take longer?
koopajah
bookacoach: I'd say yes and 2 days are US only, in Europe it takes 7 days for the funds to clear. You'd get a better answer by emailing support: https://support.stripe.com/email
Nic335 has quit
Francois__ joined the channel
Francois__
Just saw your doc about updating a credit card info. $card->name = "Jane Austen" is to update the name. $card->exp_month = "12". But how to update the credit card number in PHP please ?
lowe0292 has quit
david_
koopajah... i kind of fixed it
try now with.. 4242424242424242
and then with 4000000000000341
koopajah
Francois__: you don't. You use Stripe Checkout to create a new token, like I explained, and then pass the new token in the `source` parameter of the https://stripe.com/docs/api#update_customer API
david_: if you could explain the issue is that would be easier for me
Francois__
It will add a new CC or update the default one please ?
koopajah
update the default one
ta joined the channel
sandstrom has quit
kies joined the channel
bookacoach has quit
fcat
Hello, we use Stripe subscriptions with a trial period and we have set payment retries in the dashboard/settings panel. Trial periods are great. Payment retries are great when it comes to charging *active* customers. But I wish there was no retry at all for the very first invoice when the subscription transitions from "trialing" to "active"; we want the subscription to be canceled right away. What's the best way to deal with this? Any
koopajah
fcat: no easy way on our end. You'd need to listen for `invoice.payment_failed` on the webhook handler and then check if it's the first invoice or not and if so just cancel the subscription and close the current invoice
fcat
yes, but that's not enough. as far as I understand, we have to close the invoice to make sure it won't be charged later on, right?
praboud
fcat: is that not what koopajah just suggested?
fcat
to give some context about this issue, here is the problem we have experienced: payment failed (but invoice remained open), user then entered a card and subscribed to a new plan (and was charged for this new subscription) and then was charged for the pending invoice (thus double-billed)
oups, sorry, you're right: closing the invoice was suggested, my mistake
Francois__ has quit
praboud
fcat: also, isn't this a symptom of allowing customers to have multiple subscriptions simultaenously?
is that even desired?
fcat
no, a customer has no more than one subscription at a time
praboud
if that's the case, then when you sign a customer up for a new subscription, you should make sure they don't have an existing one
fcat
customer starts with a gold subscription in trial period and goes on with a gold subscription if a card is entered before the trial period ends
praboud
if they do, cancel it (and possibly close all outstanding invoices?)
tictacjoe has quit
fcat
otherwise the subscription is canceled and we've got a hook taht automatically creates a new "free" subscription when the existing one is canceled
there may be some edge cases though, don't you think?
MaximumTrainer joined the channel
MaximumTrainer
Hi there, just wondering if it's possible to integrate Coupon code directly on the checkout.js pop-up?
praboud
subscriptions state machines tend to get pretty complex, yeah
zimminy joined the channel
MaximumTrainer: no, coupons are handled by your serverside code
MaximumTrainer
Allright, so i'll probably do the coupon on my server with my database then? no need for the stripe feature?
since the coupon needs to be applied/verified before hitting the "pay now" button
praboud
fcat: I think that if you expect a customer to never have 1< subscription, you should assert that in your code
zimminy
I have a question, I am playing with stripe payment scripts to become familiar with them for a soon to be live. when I place a simple payment script here https://www.mommatown.com/shop and test it, it works fine, but when I place the same script to dev.othercompany.com/shop/ it does not. I get a token successfully and can see the token in their log, but no charge. Would that have to be because I am using "dev." and not "https:"?
MaximumTrainer
Was just curious if an easy way existed with stripe and checkout.js, like a javascript callback function that would validate the coupon in real time inside the pop-up. Seems not -_-
praboud
fcat: you can definitely write the webhook to not do 3x rebilling, but I get the feling that won't quite solve your problem (what if I add a subscription before the invoice is attempted at all, for example)
koopajah
zimminy: no usually it's an error in your code, I'd start looking there
wesbos_ joined the channel
praboud
MaximumTrainer: coupons are an invoice concept, so usually, you'd create the invoice, make sure you can apply the coupon, then charge it to the customer
fcat
praboud: yes, you're right. well, we'll probably go for what you have suggested, thanks a lot
praboud
MaximumTrainer: though, the problem that coupons on stripe's side solve are for subscriptions - if you're making 1-off charges, this may be overkill
zimminy
koopajah: I am using exact same code on both sites, sigh....... and get a successful token too.... doublecheked that I was using correct test keys... I'm perplexed......
praboud
fcat: happy hunting!
koopajah
zimminy: a bit hard to answer here without way more details. Add some debug messages to your code, make sure you catch all errors, try to understand if you are failing when creating the charge or before, etc.
fcat
btw, here are some other workarounds we had in mind: 1. review all the invoices before charging (close, then open and charge when relevant) 2. rely on a dedicated trial plan that costs nothing and 3. close the trial some time before it really ends on Stripe
MaximumTrainer
Thanks praboud
Yes, i'm making 1 time charge, so I think handling the coupon logic on my server/database will be easier for me.
fcat
each workaround has its own drawbacks. anyway, thanks praboud
MaximumTrainer
For me coupon are a pre-charge concept, that's how I see it.. thanks :)
zimminy
I get to about to charge... amount: 10000 from token tok_16JQ1cAWJlRZsQXL3MKZikwN using test private key: sk_test_HYGwP26G7JnlS7P6q1AURhD7, where the code is setting up $charge = \Stripe\Charge::create(array.. and nothing. not even a log about the attempted charge
I can't figure out why my site is fine and gets a successful charge, and my customer's balks at this point
koopajah
zimminy: are you catching errors in your PHP?
MaximumTrainer
you probably need to turn debug log to "show all errors/message" in your php config
zimminy
if there are no errors on my site, how can there be an error on theirs when it is the exact same code?
sandstrom joined the channel
the only difference I can figure is that my site is https:// and I am testing on theirs on a dev.site.com area that is not https
praboud
zimminy: I have said essentially the same thing to myself on a lot of occasions, and been very surprised
koopajah
zimminy: I don't know your code or what you're using, the best solution is to avoid guessing and start looking into the exact issue
praboud
zimminy: try catching errors, see what you get, and then proceed from there
tictacjoe joined the channel
david_ has quit
feralbob has quit
HowardwLo
koopajah: i’m using the tutorial to submit a token, and it’s working great. my question is, after teh form is .submit()’ed to my servers, what would you recommend as a way to catch card declined errors?
MaximumTrainer has quit
koopajah: normally i’d reload the form page with errors on it, but it’s actually a pseduo popup
koopajah: right im trying to kick that error back to the clientside
but since the .submit() isn’t ajax, i dont think it’ll work?
morunas
hey everyone! quick question: when there is 2nd and 3rd attempts to pay an invoice, if it fails each time, is there an invoice.payment_failed event launched on the webhooks? and if so, can we know what "attempt number" it is?
HowardwLo
^* i don’t think a json response would work
koopajah
HowardwLo: if you submit, it submits the whole page, then you display an error in HTML or something
zimminy
error I'm getting is "Call to undefined function Stripe\Util\mb_detect_encoding() in ......mysite/stripephp220/lib/Util/Util.php on line 113
koopajah
morunas: yes an event is sent each time and there is the `attempt_count` property
zimminy: here you go, I'm assyming you're not on a recent enough version of PHP or something is disabled on that server
praboud
zimminy: then you need to install the mbstring php on that server
*php extension
p15x joined the channel
morunas
koopajah: thanks! :)
morunas has quit
jtmarmon joined the channel
evotuned joined the channel
HairAndBeardGuy joined the channel
jedahan joined the channel
jgoldberg has quit
bitsculpt joined the channel
jgoldberg joined the channel
fcat has quit
lcampbell joined the channel
evotuned has quit
HowardwLo
koopajah: can i assume creating a customer can’t return an error if my stripe token is valid?
zimminy
Looks like they have PHP Version 5.6.9 and zend.multibyte is off, so just need to turn that on then?
koopajah
HowardwLo: no you can't because we validate the card and it can be declined. any API call should be wrapped in a try{}catch(){}
zimminy: I'd say yes
lcampbell
With a platform account connected with a customer stand alone account, how will the credit card statement read for the end user? Will it be read from the platform account holder or the standalone acct holder?
HowardwLo
koopajah: are there any other errors besides CardError? Creating a customer also validates the card?
koopajah
yes there are all the other errors, invalid parameters, authentication errors, etc. Don't discriminate and always catch all errors
HairAndBeardGuy joined the channel
lcampbell: depends if you create the charge on the platform (your descriptor) or their account directly (their descriptor)
HowardwLo
koopajah: ah ok, just wondering cause the tutorial only seems to catch CardError
trenton42 has quit
koopajah
yeah so tutorial focus on the heart of what you need but yeah you should just always catch everything
trenton42 joined the channel
aracodex12 has quit
zimminy
Thanks all!
jessejarvi joined the channel
HairAndBeardGuy joined the channel
g105b joined the channel
dixon joined the channel
g105b
I'm from the UK, and I would like to accept payment within certain African countries. Is this possible, or does Stripe need to be available in those countries?
dixon has quit
HowardwLo
koopajah: cool. I’m not sure if this is within your scope, but would it be possible to serialize the form after stripe appends an input, and then use ajax to submit? https://dpaste.de/hASq#L16,17
RutgersTina: not an exact one unfortunately, I'd advise using Chrome for now
RutgersTina
Ok thank you very much!
g105b
koopajah: that is great. So I have a UK Stripe account, and I can accept Nigerian Naira, and with Stripe Connect, I can pay out in Nigerian Naira too?
RutgersTina has quit
koopajah
g105b: no, you can charge in that currency, not payout in that currency at the moment
g105b
koopajah: I see. Thanks for the advice.
HowardwLo
koopajah: oh huh, didn’t catch your meaning. why JS and why not jQuery?
koopajah
HowardwLo: so Javascript is a language you use in the browser. jQuery is a Javascript library that makes things easier for you so you can definitely use whichever you prefer :)