#stripe

/

      • kaylined
        brian___, it still shouldn't work, because of the other issues I pointed out above(mimetype mainly).
      • brian___
        yes that solved it
      • Clueless joined the channel
      • luposlip
        timebox: just for the record, I can use scripts from google maps and other places without any issues.
      • brian___
        re: multipart/form-data : adding enctype="multipart/form-data" in the form fixes this?
      • kaylined
        In the form? No.
      • You're not using the form at all - you're using AJAX.
      • brian___
        okay yep that makes sense
      • kaylined
        brian___, contentType: false would do it.
      • above/below data
      • brian___
        :)
      • kaylined
        Anyways - I've got to run for a bit. Good luck!
      • luposlip_ joined the channel
      • timebox
        luposlip: For sure. This _should_ work. It's unfortunately really hard to diagnose here. Are you using this? https://github.com/zyra/cordova-plugin-stripe
      • brian___
        @kaylined thank you for all of your help !
      • kaylined
        brian___, no worries!
      • luposlip_
        timebox: (my sh*tty macbook just died) Nope, I'll take a look at it, thanks again! :)
      • Clueless has quit
      • kaylined
        wait - is this an ionic app lupos?
      • you need this on cordova/ionic -> <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
      • luposlip has quit
      • I believe the whitelist plugin is essential for all CORS when using Cordova/Ionic/Phonegap, etc.
      • luposlip_
        kaylined: I have set the content-security-policy, but a bit stricter that the completely open version. But I'll try opening it up for everything.
      • kaylined: I'm using the whitelist plugin. It used to work perfectly with Stripe V2 JS API.
      • hugo_
        @timebox @koopajah I just create a gist for stub stripe when you need to have sort of unit testing. https://gist.github.com/lethe0690/b4dde27f41731...
      • abilicom joined the channel
      • brian___
        @kaylined just a heads up - ading contentType: false to the ajax request results in this server error: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
      • timebox
        hugo_: That looks like it's just stubbing out your stripePayment method, rather than stubbing out Stripe though, right?
      • hugo_: But cool nonetheless - thanks! :)
      • kaylined
        brian___, interesting.
      • brian___, I'd have thought it the other way around - I don't really use jQuery/AJAX
      • brian___
        yeah me neither, thanks again ^.^
      • kaylined
        luposlip_, hmm well open it all up and then restrict it piece by piece and see where the breaking occurs!
      • hugo_
        @timebox if you are able to mock stripe.charges.create then you can do almost everything else like customers blabla, as long as the behaviour is known you can simulate many cases
      • bwn has quit
      • timebox
        hugo_: Right, but you're doing it by wrapping the Stripe API call in another function - so you're really just mocking the wrapping function. That's all I meant. But if it works, it works. :)
      • luposlip_
        kaylined: opened it all up with this: <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: * 'unsafe-eval' 'unsafe-inline';">
      • Still doesn't work. Same error. It must be on Stripe's side.
      • kaylined
        Huh, that's weird.
      • luposlip_
        Especially when https://js.stripe.com/v2 works without issues.
      • timebox
        luposlip_: Can you write into support about this one? https://support.stripe.com/email
      • luposlip_
        I guess they decline request with origins starting with "file://"
      • timebox: Yeah, I'll do that. Thanks for your time guys! :-)
      • timebox
        luposlip_: They don't. That was changed recently. But awesome - that way it can get routed properly. Thanks! :)
      • hugo_
        @timebox hmm. yeah you remind me, I will see if there is a more 'legal and better' way to do the mock. any way thanks for the help~~
      • get off now, have a good night every one
      • timebox
        hugo_: You're welcome! :)
      • hugo_ has left the channel
      • bwn joined the channel
      • gilmoregirl has quit
      • aphelion_
        hey. when i create a charge, can i get the amount i got after stripe's fees?
      • i have a charge object here, i can't seem to find something in the api reference unless im blind
      • kaylined has quit
      • timebox
        aphelion_: If you expand (https://stripe.com/docs/api#expanding_objects) the Balance Transaction (https://stripe.com/docs/api#balance_transaction...) - either when you create the Charge or when you retrieve it later, you'll find that information in the Balance Transaction object.
      • aphelion_
        do i have to do a retrieve request to expand it, or can i just add some param when doing charge = Stripe::Charge.create(
      • timebox
        aphelion_: You can add it when you create the Charge.
      • aphelion_
        i guess it falls under the "opts" param?
      • def create(params={}, opts={})
      • Eric has quit
      • i guess i'll find out when i run it anyway ;p
      • timebox
        aphelion_: `balance_transaction`
      • (instead of `balance`)
      • (also, with quotes, not ticks :D )
      • aphelion_
        how do i access it in the charge?
      • charge object, i should say
      • timebox
        charge.balance_transaction
      • aphelion_
        thought as much, ty timebox :)
      • "amount": -37769,
      • why is it a negative? timebox
      • timebox
        aphelion_: Where?
      • aphelion_
      • shows amount and net as negative integers
      • timebox
        aphelion_: In the docs?
      • aphelion_
        yup
      • timebox
        aphelion_: That's pulling something from your account as an example that happens to be negative, I think.
      • (From your test account, I mean)
      • aphelion_
        ah, yeah, i see i was logged in
      • that's weird it's a negative lol
      • timebox
        ¯\_(ツ)_/¯
      • aphelion_
        my test account is mostly just a spam of a bunch of stripe test payments to get my thingy working
      • well now i'm curious why it's negative
      • oh wow, switching to my stripe test account almost made me forget it's a test account
      • looking at the balance... i almost bought a one way ticket to hawaii or something
      • timebox
        :)
      • aphelion_
        net_income works like a charm, thanks timebox :)
      • i say net_income, i mean net, net_income is what i save it as in my db
      • luposlip_ has quit
      • brian___ has quit
      • spacecadetbrown joined the channel
      • timebox
        aphelion_: Awesome! You're welcome! :)
      • spacecadetbrown has quit
      • leo-unglaub joined the channel
      • leo-unglaub
        good evening, are some people of the support stuff around?
      • timebox
        leo-unglaub: Hi! Do you have a question?
      • leo-unglaub
        timebox: yes, i have a problem. i integrated stripe into one online shop for one of our customers and for me it works great
      • nickers
        Would it be fine to store the pk_ key in an ap
      • android app
      • leo-unglaub
        but the customers complains that he gets a lot of calls from customers unable to pay
      • timebox
        nickers: Absolutely - that's what the `pk_*` keys are for.
      • leo-unglaub
        every time i test stuff it works fine, but people keep complaining to my customer
      • timebox
        leo-unglaub: What errors are they seeing?
      • leo-unglaub
        timebox: i don't see errors at all, thats my problem :)
      • timebox: as far as i am concerned stripe works perfectly, but they really started to hate you guys and i would love to debug that because i like your service
      • timebox
        leo-unglaub: Ok, well, you could have your customer write into Support (https://support.stripe.com/email) and have them look into it, but without error information, it's impossible for us to help diagnose unfortunately. Are you able to access their server logs to see if there are any errors there?
      • leo-unglaub: ...but ultimately, this sounds like something Support will have to help with, as it may require digging into details that we can't see here.
      • leo-unglaub
        timebox: yes i see the server logs, no errors there. the only differenct i notices is that in some "parsed request post bodys" the fields guid, muid and sid are empty
      • in the payments that worked the log shows that they are always set
      • thats the only difference i could find
      • timebox
        leo-unglaub: I think the best bet here is for your customer to write into Support and have them look into it.
      • koopajah has quit
      • leo-unglaub
        okay, i will
      • thanks dude!
      • timebox
        leo-unglaub: You're welcome - and sorry I couldn't be of more help here!
      • cuba__ joined the channel
      • rainer_ joined the channel
      • rainer_
        I'm testing Stripe and following the example on this page: https://stripe.com/docs/checkout/php
      • When I run a test transaction, customer@example.com is what shows up in the customer column on my payments dashboard. If I replace that email address with $_POST['stripeEmail'] in the PHP script and run a test transaction, I see a customer ID on the payments dashboard instead of the email address. Am I doing something wrong?
      • timebox
        rainer_: Can you share the code you're using in a Gist or Pastebin?
      • rainer_
      • dro32 joined the channel
      • Gsham has quit
      • kies joined the channel
      • timebox
        rainer_: Have you tried logging the output to $_POST['stripeEmail'] to make sure it contains something? Are you using Checkout or Elements to create the Token?
      • anotherguy joined the channel
      • anotherguy
        I'm using Stripe Checkout to capture charges automatically, but it's not sending receipts. I thought I followed the documentation correctly, but I still have to manually send the receipt from the dashboard. Is there a way to automate this? I read through this but didn't see anything new. https://stripe.com/docs/dashboard/receipts
      • rainer_
        @timebox looks like $_POST['stripeEmail'] doesn't contain anything. I'm using Checkout to create the token.
      • timebox
        anotherguy: Live or test mode? How are you creating the Charges server side?
      • rainer_
        is there a way to grab the email address from Checkout?
      • timebox
        rainer_: I'd try logging the whole of $_POST and see what it says. Are you using a basic or custom Checkout implementation?
      • anotherguy: And just to be clear, Checkout itself won't capture charges; it only converts card details into a Token, which you then use server-side with one of our libraries (https://stripe.com/docs/libraries) to create a Customer or Charge.
      • wsl has quit
      • mezod joined the channel
      • anotherguy
        Test mode. Creating the charges using this documentation - https://stripe.com/docs/charges
      • timebox
        anotherguy: Receipts are never sent automatically in test mode; only in live mode. You can manually send the receipt from the Charge details page though.
      • anotherguy
        Yes, I'm grabbing the email address and added it into the Charge call using ""receipt_email" => "example-email-here"
      • oh, ok!
      • So not in test mode
      • timebox
        anotherguy: Yup - but it will work in live mode. :)
      • anotherguy
        I'll put it into Live mode and try a real charge just to be sur
      • Great tip. Thank you!
      • timebox
        anotherguy: That's generally not a good idea - you shouldn't test in live mode as the banks tend to frown upon that.
      • anotherguy: But I can assure you that if you put a valid email address in `receipt_email`, it will be sent. :)
      • anotherguy
        Oh. Didn't realize that. OK. I'll just hope for the best. If it doesn't work, I can manually send the first few through and try to find a solution later.
      • Stripe has come through on everything else so far, so I'm not worried, just like to test everything. Thanks again!
      • cweiss has quit
      • timebox
        anotherguy: Fair enough - and you're welcome! :)
      • dro32 has quit
      • anotherguy has quit