I need something like this: $result->sources['data'][0]->values
but that's not quite right
davisonio joined the channel
sunburn joined the channel
$result->sources['data'][0] gives me access to: [protected] _values => array(
why can't I just use json_encode($res);
markin
like $result->sources->data[0]->id ?
ajs_
harry_: you'll want to use something like $sources->sources->data[0];
harry_: a json object is already returned, so i don't understand why you'd want to json encode the response?
markin
well the api returns a json object, the the php library wraps it as a php object
dunpeal joined the channel
rfj001 has quit
alfiemax has quit
viktorbraun joined the channel
harry_
markin: $result->sources->data[0]->id does give me the id, but I need the whole customer node
markin
harry_: the whole customer node is $result
harry_
I need to seralize it
markin
so do $result->__toJSON()
Riekal has quit
though I would be hesitant about sending the full json response to the client
rfj001 joined the channel
stripe759 joined the channel
stripe759 has quit
harry_
if you try to searlize the whole object it doesn't behave as expected
markin
how so?
justin__ joined the channel
m0rh joined the channel
qar_ has quit
rfj001 has quit
qar joined the channel
eh334 has quit
eh334 joined the channel
qar has quit
viktorbraun has quit
cvitullo joined the channel
s2013 joined the channel
viktorbraun joined the channel
justin__
hello?
markin
hi justin__
justin__
i have a quick question, I'm trying to implement the Stripe iOS Simple Example
markin
sure
harry_: how is it misbehaving?
justin__
but I've tried to bring it into my project, and then a fresh clean project, and both times it fails in the checkout view controller on line: fatalError("init(coder:) has not been implemented")
and then i noticed the documentation has code in the AppDelegate, but the examples do not?
joelataylor_ joined the channel
harry_
markin: I managed to get it working with: $this->reply($result->__toArray(true));
then I can serialize the node as I need
markin
justin__: how did you bring it into your project? I've seen that error when you try to use a checkoutviewcontroller like just copied and pasted from the example in an interface builder file
justin__
yeah i copied and pasted. what is the correct approach? =)
ftknox joined the channel
m0rh has quit
markin
well just follow the tutorial in the stripe docs is one way, the example doesn't use interface builders so it doesn't define init(coder:) since that init function is just called from interface builder
m0rh joined the channel
you could try copying the body from init() into init(coder:) but I'm not a huge ios expert
sunburn has quit
mcwendy joined the channel
davisonio joined the channel
edrocks joined the channel
Riekal joined the channel
Jmar31 has quit
eh334 has quit
free_adap has quit
harry_
markin: ajs_ thanks for your help guys
eh334 joined the channel
Kowsalya joined the channel
ajs_
sure!
harry_ has quit
justin__
thanks Markin, I will go back and ignore the example for now, and try that!
Kowsalya
When there is failure of Charge, charge_id will be created?
one00handed joined the channel
deadghost has quit
one00handed has quit
ajs_
Kowsalya: technically yes, a charge ID is created, but it's not returned
one00handed joined the channel
Kowsalya: instead an error is returned if the charge fails
Kowsalya
how can I get the charge ID?
Yes, I am seeing only response with error [status, title and detail]
ajs_
Kowsalya: yeah, that's expected
Kowsalya
I am trying to get response with failure code and failure message with charge_id
ajs_
Kowsalya: you can see the charge in the dashboard and the id is displayed there if you need it
Kowsalya
so there is no other way to get charge id through API
m0rh has quit
ajs_
Kowsalya: hm, off the top of my head i suppose you could use the list charge method to look for the last failed charge. or you could use a webhook to listen for the `charge.failed` event and send a notification when that happens if that's what you're really after
bsmith joined the channel
bsmith_ joined the channel
Kowsalya
Ok thanks.
davisonio joined the channel
Eviline has quit
mightymart joined the channel
mightymart
hi everyone
ajs_
hey mightymart
mightymart
i have a question; from my website i register customers to subscription using credit cards, is there a way to validate if the payment was successful, i get the active subscription back from stripe.js but how can i make sure the credit card payment was made successfully?
ajs_
mightymart: so if the subscription was created successfully and doesn't have a trial, the payment was successful
mightymart: if you use a trial, there's no charge of course but creating the customer object does authorize the card with the bank
mightymart
no trial here.. so what i did is: i wanted to capture what happen if i bypass the credit card validation so i enter a test credit card number i.e 4242424242424242 then i changed it for 4242424242424241 skipped the validation and then the request went to stripe and came back with a successfull subscription and i guess successful payment but hwo come? i am in test mode here of course...
ta_ joined the channel
cdbattags joined the channel
ajs_
mightymart: hm, the 41 number wouldn't tokenize, so i'm not sure i follow. if you want to test failing subs, you could add the card number ending in 0341 in the testing guide
Is it hard to create notifs in webhooks?i mean, im just a bit scared that i might mess with it..
ajs_
stripe575: nah, i mean if you can send emails (or whatever kind of notification) from your app, then it's just a matter of sending one when an event occurs
even walks through the process of incorporating mailgun to send emails
irctc506 has quit
mightymart
well, if the ending card number is 0341 it doesnt pass the stripe,js validation it says the card number is incorrect
lets say the card number is correct but the it has reached the credit limit... the subscription will be successfull but no charges made, is it done automatically by stripe?
ajs_
mightymart: hm, did you type the number correctly? it's 4000000000000341
that guide walks through the process of creating, canceling, and updating subscriptions, along with answers to a lot of common questions
ashd joined the channel
mightymart: the 4000000000000341 number will create a token and you can attach that token to a customer object, but attempting to create a sub will fail
mightymart
ok and if it fails, is the status information stored inside the subscription object? because right now it says that the subscription is active if i use this number 4000000000000341
m0rh joined the channel
ajs_
mightymart: what's the ID of the customer you're seeing?\
the one with the active subscription using that source?
mightymart
ahhhhh it is NULL
davisonio joined the channel
i guess if its NULL then it failed right?
ajs_
mightymart: well you'd get an error back when attempting to create the sub
specifically a decline for that customer
mightymart
where this error code or message is stored exactly?
you'll get an error response back from the API. you'd want to use some exception handling as shown there to display the error to your customer
stripe439
helloo
ajs_
stripe439: hellooooo :-)
ftknox has quit
stripe439
i need to integrate my application to be able to take money from my customers credit cards
android applicaiton
ajs_
stripe439: cool. are you a developer?
stripe439
do i have to add any server side code ?
ajs_
you do, yes
stripe575
Is there a way to see the new orders vs payments on the email in a way that they dont look identical and will be easy for us to confirm which is which.
stripe439
professional developer
ajs_
stripe575: can you clarify the question a bit?
dqsf joined the channel
Tenhi_ joined the channel
stripe439: cool. so yeah, you'd use the android library to create tokens
stripe439
yes i do create tokens but when i try to charge the card an exception is catched
ajs_
stripe439: then you'd send that token to your server from the app and use some server side code to use that token to create a charge or customer