That should do what you want in a somewhat more elegant way. :)
Basically what it's doing is setting up both Checkout and the Payment Request button up front. It'll hide the Checkout button by default, but if the Payment Request button can't accept a payment, it'll hide it and instead display the Checkout button that was previously hidden. :)
It doesn't really matter if they tamper with the publishable api key. So don't defend against it.
To avoid them tampering with the amount, you should use an enum that maps some string to some value in your backend/frontend.
In other words, rather than passing an amount to your backend, you should pass a string that represents the product purchased. Then your backend should figure out how much that product costs and create a charge for that amount.
maestrojed joined the channel
cagomez has quit
Guest38224: That's correct.
cagomez joined the channel
Guest38224: tl;dr: the only thing a publishable key can do is encrypt card details and that happens as a request from the customer's machine to stripe directly (without you--) the merchant being involved. Then with Javascript, you intercept that token and pass it to your backend where you call the Create a Charge API endpoint ( https://stripe.com/docs/api#create_charge ).
stripedude: when you collect the customer's payment info, you create a token(via e.g. stripe.createToken in stripe.js) instead of a source. If you can share the ID of the customer you are trying this on I can take a look and advise you a little better.
stripedude: if you're already using sources, just use the shared card sources approach I linked to, it's a little more flexible
shared customers are for when you are using tokens, but if you're using sources(the newer abstraction) you can just directly share the sources
stripedude: yup, you should be able to do that
Robin___
Hello :) For some reason my customer line1 (billing address) ADDRESS ADDITION is always set to null eventho i send space or nothing at all. Is it required to set an address addition?
karllekko
stripedude: glad to hear it!
Robin___: hmm, which field exactly are you referring to? I'm not familiar with 'address addition'
If I add "Test address 167 " i get: "Test address 167 null""
'Test address 167 ' -> 'Test address 167 null'
Also if I pass this:
'Test address 167' -> 'Test address 167 null'
karllekko
Robin___: that sounds strange, do you have a customer ID(cus_xxx) I can look at?
Robin___
sure PM
karllekko
Robin___: you can share it directly on the channel, it's not sensitive. Also I don't think PMs are working right now because we have a moderated mode active on the channel due to recent spam attacks
so I would double check the code. Maybe you're doing something like `address + foo` and foo is null?
Robin___
hmm, what the... that is so weird.
thats exacly what I do, but I transform foo to ''
stripe839 joined the channel
my bad i fixed it :p
david____ joined the channel
karllekko
david____: it's not, no
stripe839: it's the same for every currency. It's 2.9% of the charge amount, plus the flat 30c. But pricing questions are best suited for our support team at https://support.stripe.com/email, this channel is mainly for developers to get technical help with the Stripe API
stripedude has quit
Mowee_
Hello there !
karllekko
Mowee_: hi!
Mowee_
How are you karllekko ? :)
karllekko
Mowee_: I'm good, how are you?
Mowee_
I'm good thanks !
Thank you for the infos about the refund flow, everything is fine
karllekko
Mowee_: glad to hear it, if I can help with anything else, let me know
Neo123 joined the channel
Mowee_
Oh yes, do you know if stripe will be able one day to hold funds in wallets ?
Neo123 has quit
or do you have some tips to give me to reach this kind of feature ? I was thinking about dispatching funds with transfers between merchants by I am not sure what to legally expect
karllekko
Mowee_: I can't really discuss our future plans but that's not really something we're currently pursuing
Mowee_: if you switch the connected accounts to manual payouts, you can accumulate funds in their balances for up to 90 days
karllekko: Mhh yes I've seen that but I'm looking for something that I could manage myself eventually
karllekko
Mowee_: could you explain a little more about what you're aiming for?
Mowee_
Any chance that we can talk about this in private ?
SerialNumberGuy joined the channel
karllekko
Mowee_: not really I'm afraid, this is a public channel for technical help with the Stripe API. If you have sensitive information to share I's suggest reaching out to our support team, who could advise you in more detail.
Mowee_
Sure, I undestand
karllekko
Mowee_: I don't know what you're aiming for with a wallet, but we did recently announce our Issuing product which might have some relevance to you : https://stripe.com/issuing It's still in private beta for now