#dev-help
1 messages ยท Page 126 of 1
Subscription 'sub_Jrebwp2vUgnrWN' and same invoice id : "in_1JEHmSDx27GMXSIcM0HyjHru"
while setting proration behaviour to NONE, getting this error:
The method setProrationBehavior(SubscriptionScheduleUpdateParams.Phase.ProrationBehavior) in the type SubscriptionScheduleUpdateParams.Phase.Builder is not applicable for the arguments (SubscriptionScheduleUpdateParams.ProrationBehavior)
You want SubscriptionUpdateParams, not SubscriptionScheduleUpdateParams
.setProrationBehavior(SubscriptionUpdateParams.ProrationBehavior.NONE)
This looks to be a bug as far as I can tell. You should write into Support (https://support.stripe.com/contact/login) and they will file a bug report to get this fixed up.
OK thanks for checking.
no it does not resolve yet again showing error
is that a new error or the same one?
Ah I see you are updating SubscriptionSchedule hence the code looks a bit different. How about jumping in that function .setProrationBehavior()and check its signature for parameter?
.setProrationBehaviort() in this there is 't' at the end is this correct? because i have not found any function with this signature
yes, sorry!
oh no problem
but why is this showing error on this signature
The error says
resolved
setProrationBehavior(SubscriptionScheduleUpdateParams.Phase.ProrationBehavior)
Guess you figured it out
yes i didn't add phase
glad it is resolved!
Thanks
i am having some issues with stripe
and integrating it into whmcs
i keep getting this error
and logs dont seem the help much
i am new to stripe so if anyone could tell me what is wrong that would we excellent
Hello team! In stripe-react-native is it possible to separate the number, expiry date and cvc fields in different inputs, just like you can do in stripe.js. Thanks!!!
Are you using test mode and using test card information? You can file a support ticket at https://support.stripe.com/ and we can look into it further
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
i am using live mode and a read card
Did the integration go well in test mode?
okie, and it doesn't show any failed request in your logs? Hmm
i mean there were some failed requests in the logs but i contacted NameHero (my host im using) about it
this what the error looked like
That error states that a webhook needs a HTTPS domain, not HTTP. You will need to have one to set for Stripe webhook.
I am not sure it caused the error in whmcs's UI, you can contact them asking for more detail
apparently it is a "payment gateway misconfiguration error"
but i will contact whmcs
Yes, the hosting site won't know much as whmcs. But in the end, you will still need an HTTPS endpoint for setting up webhook anyway, so make sure you prepare one.
hi
@dire dagger Hey!
@summer prairie Not possible right now unfortunately. <CardField /> is the component you'd need, but that's the equivalent to elements.create('card').
https://stripe.dev/stripe-react-native/api-reference/modules.html#cardfield
Documentation for @stripe/stripe-react-native
Hi, we need to improve in a website this WP plugin https://calendarize.it/add-ons/payment-options/ whit Stripe to accept payment. What Stripe plan do you suggest?
Thanks @hollow prairie, do you know if this will be possible in the near future?
@vocal wagon Seems like they already have support for Stripe payments. What are you asking specifically?
@summer prairie I'm not sure! The best place to ask (and track ongoing work) is on the GitHub repo. I would open an issue there with your request: https://github.com/stripe/stripe-react-native
Is there any particular Stripe plan to activate? Is the Stripe account creation enough and then use API to configurate the wordpress plugin?
@left valley Hello! I'm afraid I don't think it's currently possible to disable that. Here's the parameters you can pass when calling initPaymentSheet: https://stripe.dev/stripe-react-native/api-reference/modules/paymentsheet.html#setupparams
Documentation for @stripe/stripe-react-native
@vocal wagon Ah, gotcha! There's no specific plan to per se, you'd just provide the required Stripe keys to the plugin and you'd begin accepting payments. Stripe pricing can be found here: http://stripe.com/pricing
@pine sky Hello! Happy to help, ask away
ok thanks
I tried to add discounts to Stripe Checkout but when I add it, it seems its not working.
Hi there @hollow prairie, I'm having issues with confirming payments when using the android stripe SDK with google pay.
In particular, the call to client.confirmPayment(fragment, confirmPaymentInentParams) is logging a 200 response but
the payments are not being marked as approved in the console (test environment).
I tried to follow this from the documentation but the response from the create session is this:
@pine sky Can you provide a specific request ID for the Checkout Session creation? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
@north ether Hello! Do you have a PaymentIntent ID I can look at?
Hello, I am using setup intents to add cards/sepa accounts to my customers to charge them once a month. If the user didn't use a setup intent, are we supposed to create new ones or should I store existing setup intents that were not used yet? I am just wondering, because currently when a user reloads the page a new setup intent gets created and the old one was not used. I could store the old one to return the same intent id and not create a new one, but I am not sure if this would be the correct way. Any help is appreciated, thanks ๐
pi_1JEzYfLZMMa5HMOVlXwqsefd
@north ether Thanks, taking a look
@hollow prairie here is the ID: cs_test_b1BAlUAHchPkeORc8PL2tbxmYYG16KbHbhdTqL9B9ecL55rXVPXXzA5Qoz
Thanks, spent some time with your team yesterday who confirmed we were creating the payment intent correctly, but said our integration isn't confirming the PaymentIntent with the Google Pay PaymentMethod
@north ether There's no payment method attached to the PI, which is why you'll see status: "requires_payment_method" on the PI object
right. and that's something we should be setting in the ConfirmPaymentIntentParams when we call stripeClient.confirm?
@pine sky Hmm, there's no discounts field passed when you're creating the Checkout Session: https://dashboard.stripe.com/test/logs/req_9SOefa4fF5y4cF
when I breakpoint before our call to client.confirm I can see a paymentMethodId in the confirm params that we supply
let me double check @hollow prairie .
@north ether Are you using GooglePayLauncher (https://stripe.com/docs/google-pay)?
@pine sky What is Stripe.createSession? Looks like your own custom function that wraps our Node client?
those are the docs we've used yes
Thanks @hollow prairie for the quick help!
@proven wharf Hmm, you don't really re-use a SetupIntent. They're used to setup card usage for future payments by saving payment data to a customer
@north ether In that case, I'm not sure why you're calling confirmPayment. Sorry not overly familiar with our Android SDK!
If I can grab the http request/response might that help you?
@north ether Potentially! The PaymentIntent you shared earlier only had a single HTTP request associated with it (creation)
Yes, currently my customer visits a site, for example /onboarding/payment and it creates the setup intent as soon as visiting. Now it might happen that the customer does not fill out the forms or reloads the site. In which case currently he would trigger the setup intent creation again and the forms use the new setup intent, while the old one was never used. My question is just if it's okay that way or if I should store the id of the first setup intent and the form should us the existing one on reload
our payment intent creation is via a backend service that reuses unfulfilled intents I believe. but the payment confirmation happens on-device using the android sdk
@proven wharf Ah, gotcha! Yeah we advised against storing them for use later on as they may have expired when you come to confirm them. This is mentioned here:
Also, donโt maintain long-lived, unhandled SetupIntents as they may no longer be valid
Learn how to save card details and charge your customers later.
Perfect, thanks! ๐
@proven wharf So if creation happens on page load as opposed to form submission, then they're safe to just discard I guess
@north ether Yep, that's the recommended workflow. But as I said, I'm not sure confirmPayment is applicable in the case of Google Pay
Hi - it looks like the instructions on this page(https://stripe.com/docs/google-pay) have changed - potentially in the last 24hrs or something? the steps I followed look like this(https://web.archive.org/web/20210508031140/https://stripe.com/docs/google-pay) - that's an archive link from may this year, but it looks exactly like the steps I was looking at even yesterday
Learn how to accept payments using Google Pay.
Learn how to accept payments using Google Pay.
is there maybe another page of documentation explaining these changes?
@north ether Yep, I just checked that was a recent change (~last week). There's some context here: https://github.com/stripe/stripe-android/pull/3994
Hi. I'd appreciate a steer regarding the approach to use to charge a customer and capture the charge later - car hire use case. Seems there are two approaches - using payment intents as per this example https://stripe.com/docs/payments/capture-later or to use the Charge object https://stripe.com/docs/api/charges/object It seems that the charges API is older than the payment intents API, is that the case?
Separate authorization and capture to create a charge now, but capture funds later.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@analog mantle Hey there. Yes, we'd advised against using the Charges API in any integrations now with the enforcement of SCA rolling out across Europe. The first doc you linked is an up-to-date workflow for the auth and capture integration ๐
Hi, Im currently working with Stripe API with Unity. When I try to make a connection I get this error. Does anyone know the way to solve it?
Thanks!
@warm dust Hello! Looks like one of your Stripe key is hardcoded directly into the source code of your integration. Are you familiar with environment variables?
When adding a payment method via the setup intent and visiting the stripe control panel --> customer it shows the payment method but when clicking on Actions --> Create payment it's greyed out and says "To create a payment, please add a payment method to this customer that can be charged." โโ what exactly is missing?
@warm dust https://support.unity.com/hc/en-us/articles/360044824951-I-need-to-start-Unity-with-an-environment-variable-s-set-how-can-I-do-that- this seems relevant
Symptoms:
I need to configure Unity by setting some environment variables, but I don't know how.
I need to contact my network administrator to use Unity with a set of environment variables.
...
we're supposed to go live on thursday ๐ฎ with this new api will the payment method data be added inside the GooglePayLauncher logic or is there something we need to implement?
@proven wharf Can you share the ID of the SetupIntent or the Customer object?
cus_Jszoq73c2lfKgW / seti_1JFEjME40JD3keIAhtd3aqTz
@north ether You'd use GooglePayPaymentMethodLauncher: https://stripe.com/docs/google-pay#creating-a-paymentmethod
Learn how to accept payments using Google Pay.
@north ether These new APIs are new to me too I'm afraid, that doc has the most context for a full Google Pay payment flow on Android
@proven wharf Thanks, looking!
@proven wharf
Actions --> Create payment
Is this in our Dashboard?
Hi everyone.
@proven wharf Oh, cool! That's a pretty new feature. First time I've seen it ๐
@vocal wagon Hey!
Rubeus helped me a lot last night.
Now mydev tool console gives a "Id is missing in session response" when I test my checkout session (payment mode)
session with paymentIntent options all set.
Any clue where this error is coming from?
Nice to meet you. My name is daichi.
I am building to send a request to aws lambda with webhook with api gateway.
I am sending money to my connect account by transfer when the payment is made, but the money is not sent.
No error is displayed in the cloud watch log.
If you know the cause, please help.
Hello
this is webhook code
@vocal wagon Can you share the Checkout Session ID or a request ID to create the Session?
What I also don't really understand is; when creating the setup intent I have the option to confirm it. I can't confirm it because the payment method doesn't exist. I'm adding the payment method with the JavaScript SDK client side and "confirmSepaDebitSetup". When checking the Setup Intent it has the status "succeeded" so there is no need to confirm it? Or how it the flow supposed to be
sessionId: "cs_test_a1yib3UEa1PYGmZnwNOJUj8LXpm96UPKn3bdkqEKxFDNqtJ95h3p17mGqU"
@proven wharf Checking on this is for you
Thanks! ๐
Hello, we can help better if you can share the id of your payment (PaymentIntentID)
Can I clone an existing payment method from a stripe account to another one ? I don't have a connected account yet.
@proven wharf If status: 'succeeded' then no further action is required
thankyou!!
pi_1JFEgQDEZeQcJl0a2FpjvNSn
@vocal wagon Hello! You cannot I'm afraid. Payment Methods can only be cloned from a platform account: https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
@hollow prairie I have to create them for the connected account, or can I create the payment method from a stripe account, then send it to the connected account to be available for the other stripe account ?
@vocal wagon Is there a specific error you can share? Can you narrowed it down to a specific part of your integration code that I can see? Nothing jumps out from that Checkout Session you shared
@vocal wagon You would create the Payment Method on a platform account and clone it to connected accounts(s) as per the document. But there must be an existing connection between those 2 accounts
@hollow prairie How to create the connection between the 2 accounts ?
@vocal wagon This is not really valid if you're not wanting to use Connect though. Why exactly do you need to clone Payment Method data?
Hmm that PaymentIntent looks normal to me. Is your code that generating transfer not emitting anything to your console log?
Yes, it quits without outputting anything.
Trying to output with try catch did not change.
@hollow prairie The ownership of the 2 accounts is different (not same linked bank account). After a certain delay, a customer (and its payment methods) have to move from a stripe account to another one.
Here is the aws cloud watch log.
The error seems to be coming from the stripe.js (so client side?)
@hollow prairie the second stripe account is actually a debt collection account.
Hi Nik. I was confused with the confirm and the payment method. Crucially is that only the create setup intent happens server side and the payment method construction, attachment to customer and the confirm setup intent happen on the client side. Although the example is Swift specific, the flow is the same for whatever your client may be - https://stripe.com/docs/payments/save-and-reuse
I tried to handle Giropay redirect manually,after submitted the payment intent and got the url from the next_action ,opened the url in browser, and then closed the browser tap before finishing the payment. Next, I tried to open the same url again, then I got an timeout message in German: DIE WARTEZEIT IST ABGELAUFEN . So, is the giropay redirect url a one-time thing. Anyone know about it.
@vocal wagon Sounds like you should be using Connect then: https://stripe.com/docs/connect/standard-accounts
Even that console.log(query) doesn't yield anything? Can you tell me the stripeParentAccount in that request? I can try lookup if the request is actually created
@vocal wagon Can your share your code from that file (dmxStripe.js)?
@vocal wagon Do you have a PaymentIntent ID I can look at? pi_xxx
Yes, nothing is output to this console.log (error) either.
"stripeParentAccount": "acct_1JEqmDRkQaAz3Udc"
@hollow prairie To connect the 2 stripe accounts, this is the API ? https://stripe.com/docs/api/account_links
@dry hatch
I have tried many times and have output a query for stripe.transfers.create.
@vocal wagon You'd need to use OAuth to connect a pre-existing Stripe account: https://stripe.com/docs/connect/oauth-standard-accounts
This is the payment Intent Id pi_1JFDr2A2nSxmc3CmOmSb0wwe
@vocal wagon Thanks checking now
Sorry I have confused. So when you try to log the query, sometimes it is in the log, sometimes it isn't? You code is guaranteed to output it everytime.
@hollow prairie I have to do it one time ? It's not really a M2M API
I also noticed there are some successful transfer requests, ex: req_sWn5ExS7EAALST
sorry.
I see the log below.
console.log (query);
However, the following log is not displayed.
// Create remittance details
try {
const transfer = await stripe.transfers.create (query);
console.log (transfer);
} catch (error) {
console.log (error);
}
Yes, there is only one successful request for some reason.
However, the cause is unknown. ..
@dry hatch
I'm leaving my seat a little, so my reply will be delayed.
sorry
np, I will also come back a bit later
@hollow prairie there is not a simpler API to connect 2 stripe accounts ? I don't want to integrate another PSP, just copy payment method between stripe accounts.
@vocal wagon Yep, because payment authentication failed (I guess because the auth flow was existed), the payment method has been detached from the PaymentIntent (hence status: "requires_payment_method"). You need to provide the payment method again with confirmGiroPayment: https://stripe.com/docs/js/payment_intents/confirm_giropay_payment
@vocal wagon I'm afraid not, no
I don't really understand the process.
@vocal wagon What part don't you understand?
STEP 1. Create a connected account on both stripe account ? stripe.Account.create(...)
So the redirect url is not a one-time thing ?,it failed to open at the second time, because of the authentication failed
@vocal wagon You don't need to create an account as you already have the accounts.
- You'd create an OAuth link as the platform account (where your customers/payment methods currently exist). Using the doc I linked.
- The account where you want to clone the customer to (the connected account) then clicks the link and completes the steps.
- The connected account is then redirected back to the site where they clicked the button.
- The platform account confirms the connection using the returned token.
@vocal wagon Yep, it is a one-time thing which is why its expired. You've used it, the auth wasn't complete so now its no longer valid. You need to call confirmGiroPayment again (passing a payment method), and the response will contain a new redirect URL to handle auth
Hi, we have a client that is using WordPress/WooCommerce/Stripe but recently over the last few weeks most purchases are failing, we need advice
Large file... Selecting what seems relevant:
methods:{
checkout:function(e){
var t=this;if(this.props[
"session-url"
]){
var n=this.props[
"session-url"
];window.WebviewProxy&&(n=window.WebviewProxy.convertProxyUrl(n));var r=new XMLHttpRequest;r.onload=function(){
if(200==r.status){
var e;try{
e=JSON.parse(r.responseText)
}catch(e){
return void t.error(e.message)
}if(!e.id)return void(e.error?t.error(e.error):t.error("Id is missing in session response."));dmx.stripe.instance.redirectToCheckout({
sessionId:e.id
}).then(function(e){
e.error&&t.error(e.error)
}).catch(function(e){
t.error(e.message)
})
}else t.error("An error occurred during the transaction.")
},
r.onerror=function(){
t.error("An error occurred during the transaction.")
},
r.withCredentials=!0,
r.open("POST",
n);try{
r.setRequestHeader("Content-Type",
"application/json"),
r.send(JSON.stringify(Object.assign({
},
{
lineItems:this.props[
"line-items"
]||[
]
},
e)))
}catch(e){
t.error(e.message)
}
}
@hollow prairie then I use the stripe_user_id to create the customer token, finally create the customer from the token in the second account. (https://stripe.com/docs/connect/cloning-customers-across-accounts). Payment methods attached to the customer in the first account are now available for the second account ?
@vocal wagon This looks like the compiled/minified output. What's the actual source (that you've written) look like? Is it React?
@vocal wagon Hello, can you share the ID of a particular PaymentIntent that has failed? I can take a look and point you in the right direction
is this available in the WooCommerce interface or only in the stripe account?
Hello. Can anyone help me. I am trying to get my Stripe account linked to another website, but it's not accepting the API Publishable key or Secret Key. What am I doing wrong? Thank you
Thank you, I'll take a look ๐
@vocal wagon I'm not sure about WooCommerce, I've never used it. But you can find payment data via Stripe Dashboard: https://dashboard.stripe.com/test/payments
ok thanks
Thanks.
@vocal wagon If you're using PaymentMethods, this doc is more relevant: https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
@obsidian cloud Hello. What are trying to use with Stripe? Is there a specific error?
I dont see any of the failed payment data within the stripe dashboard
@vocal wagon Can you share your Stripe account ID? You can find it here: https://dashboard.stripe.com/settings/account
Hello, I am using 2 Stripe accounts. In the older one, when I create a product I can specify an API ID. In the new one I can't. Is there some setting to change? Rr the possibility to specify an API ID when creating a product (via the Dashboard) has been removed?
@vocal wagon Hi. I'm trying to link it to my pic-time account. It's not allowing me to. The message is showing "Could not connect with Stripe. Please check your information"
@naive kettle Hey! You mean via the Dashboard, or the API?
Via the dashboard
@obsidian cloud I guess you're talking to me! I would contact the other vendor about that, as they would own that integration
@vocal wagon Yep, totally fine
acct_17uSq7FbDH7JKUx3
I can see the failed "incomplete" payment now
@hollow prairie Cloning customer will only clone the customer, not the Payment Method attached ?
@vocal wagon Thanks, let me check
@hollow prairie via the dashboard
Failed 3D secure?
@hollow prairie Sorry for the confusion. Thank you, I'm trying now to get in touch with them
@vocal wagon Which specific payment are you looking at? Can you share the ID? pi_xxx
@obsidian cloud No problem! Hope you get it resolved
pi_1JFFDlFbDH7JKUx3ENVwyHAR
@vocal wagon They're 2 separate processes. One for the Customer, one for the Payment Method
@vocal wagon Yep, so the payment method failed 3DS/auth checks. This is an expected error, and isn't indicative of an issue with your site. Your customer simply didn't authenticate the payment correctly. You should ask them to try again
@hollow prairie Thanks !
ok the reason I am concerned is because this only started happening about 3/4 weeks ago
so what we see is a customer trying multiple times and failing then having to call the company and complete over the phone....with the same CC?
@vocal wagon Yep, that's fair! I'm not sure how familiar you are with SCA (https://stripe.com/docs/strong-customer-authentication), but enforcement is now being rolled out across European banks so these additional security checks are now becoming more common
also one customer said their Post Code would not be accepted
Hi i need to know for React native how to disable the Card Field when i need to update existing card
ok thats interesting and makes sense. What are we expected to do?
is there anything apart from putting up a notice on the site?
advice please thanks
@vocal wagon Your integration already supports these SCA flows, but for whatever reason your customers are failing the required checks from the bank. It's a catch 22 as in some cases these measure can prevent fraudulent transactions
Thanks for the info ynnoj
Yooo, is there any way to retrieve the Publishable test key from a transaction ID?
I need to implement SCA, and my colleagues are asleep, and I don't have access to the backend
@queen stratus Hello! Can you elaborate on your use case a little more?
What we do in React web is to use hooks and if that baddy
@green notch Hey. There is not, no. We don't return the publishable or secret keys from the API in any object. You'd retrieve these from your Dashboard: https://stripe.com/docs/keys
return (
<>
{isEditingCard ?
<CardForm /> :
<CardInfo />
}
</>
)
So I just have to wait until the americans starts waking up?
@queen stratus Yeah there's no prop to disable the <CardField /> component: https://stripe.dev/stripe-react-native/api-reference/interfaces/cardfieldprops.html
So I'd just conditionally render it as @green notch suggested
Documentation for @stripe/stripe-react-native
@green notch I guess so!
thanks anyways!
@hollow prairie Yeah got it bro
@hollow prairie If i have card number Expires month/year are i able to give it as default value to the Field?
I am asking Like TextInput prop like value={name} @hollow prairie
@queen stratus There's no way to pre-populate the fields, no
Okay thank you @hollow prairie
I'm using a no code framework tool (wappler) than generates PHP, JSON files. Does this piece of code help to pin point to the reason for the error?
methods: {
checkout: function(e) {
var t = this;
if (this.props["session-url"]) {
var n = this.props["session-url"];
window.WebviewProxy && (n = window.WebviewProxy.convertProxyUrl(n));
var r = new XMLHttpRequest;
r.onload = function() {
if (200 == r.status) {
var e;
try {
e = JSON.parse(r.responseText)
} catch (e) {
return void t.error(e.message)
}
if (!e.id)
return void (e.error ? t.error(e.error) : t.error("Id is missing in session response."));
dmx.stripe.instance.redirectToCheckout({
sessionId: e.id
}).then(function(e) {
e.error && t.error(e.error)
}).catch(function(e) {
t.error(e.message)
})
Can you have methods in json? ๐ฎ
@vocal wagon Seems like e is not what you're expecting it to be. Can you log e out before you call redirectToCheckout?
that's weird, but I suspect there is a bug with that node.js code (?) rather than a problem calling Stripe API. If you can see a log in Stripe dashboard, then the transfer is created
Not sure what you mean by "log e out" but I "fetch" a cs_ID after the session is created.
maybe i'm not using the right ID?
@vocal wagon Well, the Checkout Session is returned by the XMLHttpRequest request, but e is seemingly not the Session object (as e.id is falsy)
@vocal wagon Where is that screenshot from? That's not a standard Stripe object
This is the Response Preview from my Chrome Dev Tool, network, XHR filter
@vocal wagon Yes, the error you're seeing:
Id is missing in session response
Is thrown because of yourifstatement
@vocal wagon Try this:
dmx.stripe.instance.redirectToCheckout({
sessionId: e.sessionId
})
Here is the standard object response for the session
I'll update you after making some manipulation... Stay tuned.
@proven wharf Hey! Sorry it's taken a while to circle back, was just checking up on that Action Button as it's pretty new! Turns out the Payment option only works with certain payment methods types currently, and SEPA Debit is not one of them
@proven wharf I can see it's working now as you've added some cards to that Customer
:question: @visual canopy Have a non-technical question, account issue, or need one-on-one support?
We wish we could help, but this community is focused on developers and technical discussions. Our support team will be able to assist you better than we can: https://support.stripe.com/contact
In one of my accounts I see this option for creating a price, in the other I don't. Is this intended?
@naive kettle yes, the ability to define a custom ID for a Price/Plan is an old behaviour we only let existing accounts who were using it in the past have access to by default so it would make sense to see it one account and not another
we highly recommend using lookup keys (https://stripe.com/docs/api/prices/list#list_prices-lookup_keys) instead of setting the actual object ID (the opaque IDs like price_xxx lets us encode some information in the "xxx" part that helps to speed up your API requests' performance which can't be done if the ID is a custom string)
@meager hawk do you have an example of setting the lookup key of a price/ product? I only can find examples of fetching/listing ๐ฆ
it's a parameter passed when creating the Price : https://stripe.com/docs/api/prices/create#create_price-lookup_key like
const price = await stripe.prices.create({
unit_amount: 2000,
currency: 'usd',
recurring: {interval: 'month'},
product_data:{name:"foo"},
lookup_key:"foobar"
});
the dashboard doesn't support setting it right now unfortunately
Hi
hello there
I can try, what's the issue you're facing?
I want to pass the dynamic amount in my payment request button
and my value store in php varibale
i want to pass that
I have tried but its not working
var paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Total',
amount: 2999,
},
requestShipping: false,
requestBilling: false,
requestPayerName: true,
requestPayerEmail: true,
});
Here in place of 2999
I want to pass my custom varible
I have tried to store php variable value in jquery variable and then that jquery variable I have passed in to this array but its not working
Hey
Is there any way to test paymentRequestButton (Google / Apple pay) for the insufficient costs error or any other error codes?
I already configured Google Pay test mode, which gave me the list of pre-installed test cards, but don't see any way to emulate any payment failure with them
@limpid scaffold there isn't, we convert all cards used with the button to the 4242424242424242 card in test mode. If you need to test specific cards I would do it with your fallback Elements form instead; or you could mock things out(like pass the string pm_card_chargeDeclinedInsufficientFunds to confirmCardPayment at https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-complete-payment instead of the actual PaymentMethod from the event)
@maiden meadow can you say more about it "not working", what do you see instead, is there an error in your browser console or something else?
if you have a public page I can look at that if you think it helps demonstrate the issue you're facing.
Got it, thanks
This is the restaurant application in which i have added the payment request button
@maiden meadow that's not possible, no. I can try to help you with Stripe-specific questions but adding a variable to your Javascript code from your PHP application is really business logic you'd build as the developer of this system. Can you describe in more detail what is "not working" exactly, what code you're using and the errors you see? That link you shared seems to need some logins, are there specific instructions for what you'd like me to do/check?
okay sure
Actually my value store in $total
and I have created var total = <?php echo $total ;?>
and then pass that total jquery variable in the
var paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Total',
amount: total,
},
requestShipping: false,
requestBilling: false,
requestPayerName: true,
requestPayerEmail: true,
});
it should work
but that is not working infact button is not displaying
that's my issue
That how can i pass dynamic amount
is there an error in your browser console when you visit the page or try to click the button?
ok
let send you that also
just give me few mins
Uncaught (in promise) IntegrationError: Invalid value for paymentRequest(): total.amount should be a positive amount in the currency's subunit. You specified: 26.64.
at Z ((index):1)
at X ((index):1)
at new n ((index):1)
at Ja ((index):1)
at e.<anonymous> ((index):1)
at e.paymentRequest ((index):1)
this is the errror coming when I am passing the dynamic value
I think it should just be 2664 instead of 26.64
ok! I think the error is clear, right?
in both places when creating the paymentIntent using CURL and a payemnt request button also
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.stripe.com/v1/payment_intents');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "amount=$total¤cy=usd&payment_method_types[]=card");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, 'sk_test_51IdirPJL5kmflh3PxmozB5B32RqOsEfvxqXQoL3ZGpnD7Eoq2PzFrOtruditjOBfVShtFXqclWoRhrVmAM9hnuKm00FixYuHZY' . ':' . '');
You should specidify in subunits
like how many US cents (or eur cents or dkk รธre or etc...)
I guess you could put it like that
yep, in all parts of Stripe's APIs and products(creating the PaymentIntent, and creating a PaymentRequest) you specify amounts using the smallest currency unit, so $26.64 is 2664 (cents) , so you need to write your code to format the values that way.
also you shouldn't be using curl like that โ we have a PHP library : https://stripe.com/docs/libraries
So total amount should break in cents and then pass it
so if you want the customer to pay 26 USD and 64 cents, you have to format it as 2664
basically
okay
'Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ยฅ100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. '
but we have got this call from stripe docs only
Hello
@vocal wagon hello there
I have a question about "setup_future_usage" = "off_session"
@maiden meadow if there are docs that show passing a number like 26.64 instead of 2664 please link them so I can get them changed as that's a mistake
So my current total amout is $26.64
The payment method is attached with the customer only if the payment intent succeeded ?
but still its not working
okay
@vocal wagon yes, we only attach the PaymentMethod used with the PaymentIntent that succeeded. So if the customer tries a few different cards to confirm the PaymentIntent with, it's only the successful one that gets attached
can I by pass it ?
@vocal wagon what do you mean exactly?
okay so finally I have to break this total amount in that specfic format and then it will work fine
Some times the pi failed because insufficient founds
@maiden meadow it would be a start! the error message is quite clear, so you'd fix that and then see if things work, if not, then you'll get other error messages that might hint towards the problem.
okay thanks
@vocal wagon yes, that can happen. So we don't save the customer's card since if you weren't able to charge it, why would you want to save it? That's the logic.
Also consider using the official Stripe lib for PHP
Sure
#StopCurlAbuse
Thank for the help
@maiden topaz of course! how can I help?
Is there a way for me to know if the user has successfully connect their stripe account using connect onboarding for express?
@maiden topaz You as the platform account?
Hi I'm not sure if I'm in the right place, I'm not a developer but us stripe. The payouts keep getting delayed until the next day, there is nothing on dashboard saying why either.
:question: @peak sage Have a non-technical question, account issue, or need one-on-one support?
We wish we could help, but this community is focused on developers and technical discussions. Our support team will be able to assist you better than we can: https://support.stripe.com/contact
@hollow prairie I want to know if there is a return object or token if the seller successfully connects to stripe with connect onboarding for express in my website
@maiden topaz As per https://stripe.com/docs/connect/express-accounts#handle-users-not-completed-onboarding, you can check the charges_enabled field on the account object for a general indication as to whether they're onboarded
https://stripe.com/docs/api/accounts/object#account_object-charges_enabled
Express enables your platform to manage payout schedules, customize the flow of funds, and control branding. Stripe will handle onboarding, account management, and identity verification for your platform.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@maiden topaz Also indicated in the Dashboard at https://dashboard.stripe.com/test/connect/accounts/overview
Yes, I see that in my dashboard.
@maiden topaz Does that help answer your question?
@maiden topaz What exactly does that button do?
@hollow prairie It is a button that lets you create an express account on stripe.
@maiden topaz Yep, but can you share the exact code/function the button invokes
@maiden topaz You'd likely need to make an API call to retrieve the account in question: https://stripe.com/docs/api/accounts/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This is fixed, so thanks a lot. User gets redirected but now I get: message: "No such payment_page: 'cs_test_a10Nt5vmGcFPID7yn0fuImsB6rdwUHA53wkLNmj7JvaEy4We8f7o435KeH'"
Yet the redirect url does contain the cs_id: https://checkout.stripe.com/pay/cs_test_a10Nt5vmGcFPID7yn0fuImsB6rdwUHA53wkLNmj7JvaEy4We8f7o435KeH#fidkdWxOYHwnPyd1blpxYHZxWjA0TF1dQGxHY1w8bGFCYDdwMVNEb1VNS0hKdU9OYG0zUl1JTTcwQWdCPGYyakF1V1dNbj1oTzRuYl13Nkw1ZjxGYXA3aEM0f0pUfFBdbmo2TDx1X1BGcFQ9NTU9bDY8aFI9MCcpJ2hsYXYnP34nYnBsYSc%2FJzA3Z2NmZzdkKDQzPT0oMWc2MihnZDw3KGAyZj0zYDIzN2BjYDJjZzNnNycpJ2hwbGEnPydkMjM0Mjc3YSgxYzEyKDEzPGEoPTM3PCgwNmNhNjNkYTQ9MD03ZjVmZjInKSd2bGEnPydjNTRgZ2dhZig2PWM8KDFkN2coZDRhNyhgZDxhNTc0YT0yYzdnZmQ1MzIneCknZ2BxZHYnP15YKSdpZHxqcHFRfHVgJz8ndmxrYmlgWmxxYGgnKSd3YGNgd3dgd0p3bGJsayc%2FJ21xcXV2PyoqaGBhbGRhZHZtK2ZqaCd4JSUl
@hollow prairie Is there a way for me to get the Account Object after they completed the flow when clicking the button?
@maiden topaz Yep, see: #dev-help message
@vocal wagon Are your secret (sk_) and publishable (pk_) keys from the same Stripe account?
@vocal wagon The url field on the Checkout Session object works for me: https://checkout.stripe.com/pay/cs_test_a10Nt5vmGcFPID7yn0fuImsB6rdwUHA53wkLNmj7JvaEy4We8f7o435KeH#fidkdWxOYHwnPyd1blpxYHZxWjA0TF1dQGxHY1w8bGFCYDdwMVNEb1VNS0hKdU9OYG0zUl1JTTcwQWdCPGYyakF1V1dNbj1oTzRuYl13Nkw1ZjxGYXA3aEM0f0pUfFBdbmo2TDx1X1BGcFQ9NTU9bDY8aFI9MCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYCkndnF3bHVgRGZmanBrcSc%2FJ2RmZnFaNExjPE59QHB3YV1HSVxXVyd4JSUl
@vocal wagon In some cases now you don't need to use redirectToCheckout anymore as you can redirect directly using that field
Yes from same platform acct. however, I do not use the (sk) in the header of the create session, only the Connected Account? Shall I add the (sk) too?
Hi devs i need help with an error code that i am getting when i try to charge by ach. I have a plaid implementation, and everything goes fine (I get the bank token from plaid, create the client and affix the token) until I try to create the charge. The error says: "this account cannot create payments" with the code "invalid_request_error". The strange thing is that if I try to charge by credit or debit card it lets me.
Yep, I can see the account object but if I manually copy and paste the connected account id from the dashboard. What I want to do is to pull the account object right after they do the express stripe account.
Works really? Because I get this over here!
@vocal wagon Seems like you're passing an account ID to stripeAccount that's the same as the account keys. That's not necessary
@nocturne cipher Hey there. Sounds like your account is not yet ready to process payments. I'd recommend reaching out to support directly: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Im passing a Connected Account to that session, so that this session by this user is attached to that Account. So I remove it and add the (sk) in the header instead?
@vocal wagon You've passed acct_1If9KxEurdXBLYRR which is the same account as the API keys you're using. This will have no effect. Is it intentional?
@maiden topaz What do you need from the account object? What are you trying to achieve with that data?
@hollow prairie Yes I was thinking about that since on my dashboard I get this notice: "Your account does not meet the requirements, Unfortunately, your company cannot use Stripe because it does not meet our Terms of Service. If you think this may be an error, please contact us."
But since it was letting me charge by credit card I assumed it was something else.
this account is a Connected Account. The (sk) is that of our platform.
@nocturne cipher You will need to speak to support I'm afraid. We can't really help with account questions like this here
@hollow prairie No problem I just wanted to rule out that it was that and not a coding error, thanks.
@hollow prairie I want to save the account id to my database for me to be able not to manually input their account id when their is a transfer happening.
@vocal wagon This request to create a Checkout Session (https://dashboard.stripe.com/test/logs/iar_9m8qwNUOp2056n) was made with the keys from acct_1If9KxEurdXBLYRR. Which is the same account ID you're passing to the stripeAccount parameter
@maiden topaz You should probably handle this async via a webhook: https://stripe.com/docs/connect/webhooks
Learn how to use webhooks with Connect to be notified of Stripe activity.
mornin' folks
@maiden topaz You'd subscribe to an event (like account.updated) and in your webhook handler you'd receive the Account object once onboarding is completed. You can then action that as needed
@hollow prairie I'll try that. Thanks very much, will update you later.
@maiden topaz Np! Let us know if you have any follow-ups
@vocal wagon You must have initialised Stripe.js (for redirectToCheckout) with the public key (pk_) from a different account
@vocal wagon As I said though, redirectToCheckout is redundant now. You can just redirect in the browser using the url field
I don't get it. The "Standard keys" I use from page https://dashboard.stripe.com/test/apikeys belong to platform acct acct_1IXXEiBfY9idGe2u not to the Connected Account.
@vocal wagon They're not being used in the request you've shared I'm afraid
redirectToCheckout is automated by the JSON file I shared with you earlier.
@vocal wagon I'd suggest you double check the keys you're using when creating the Checkout Session, as currently they're from acct_1If9KxEurdXBLYRR
@vocal wagon The secret key used to create the session and publishable key used to redirect with Stripe.js must be a matched pair for the same account, and as @hollow prairie explained we're seeing keys from two different accounts (connected account vs platform)
WTH, i feel on another planet now ๐ Im in front of my dashboard and see the Standard keys for the platform account. Both pk and sk start with pk/sk_test_51IXXEiBfY9idGe2u. They are from our platform, not some Connected Account
Hmm let me double check this request
Oh, maybe the create request with secret key is with your platform?
Yes, that looks to be the case - sorry about that confusion
OK, given that @vocal wagon i need to scroll back and see what the current roadblock is. one min.
FYI, in my session header, i add the Connected Account acct_1If9KxEurdXBLYRR and the platform api key sk_test_51IXXEiBfY9idGe2u...
Stripe.js uses the (pk) pk_test_51IXXEiBfY9idGe2u....
What is the problem, I am not getting it
@vocal wagon When you initialize Stripe.js, are you including the stripeAccount option with the connect account id? My best guess is that that's what's missing here:
https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
eg: var stripe = Stripe('pk_test_123', {stripeAccount: 'acct_456'})
Complete reference documentation for the Stripe JavaScript SDK.
Hi team, I see for every express account, $2 will be charged and for every payouts 0.25% .. This amount will be deducted from connected account or from market place ?
kindly respond ..
Please be patient - it's only been a few minutes.
These connect fee are paid by your platform
Ok so in my case: var stripe = Stripe('pk_test_51IXXEiBfY9idGe2u....', {'acct_1If9KxEurdXBLYRR'}) Is that the exact syntax?
I want to access historical data (charges, refunds, etc) related to a previously connected account, all created while that account was connected. However, that account is now no longer connected. What are my options? From what I gleaned, I can only iterate over application fees, expand their charge objects, and so on. However, this has left charge refunds' properties unexpandable because reaching that far through an application fee hits the maximum expandable level limit.
Yea, that looks correct
Hi team, I'm trying to get payout.failed webhook events published into staging environment, I see the connected account's payout failing but no webhook event was published. I tried to manually send the webhook event and it works properly.
Thank you.. I thought those fees ll b paid by the connected account holder ..
Can you provide an example request where you're doing this, or an object id you expect to be able to access but can't?
@blazing geyser Can you share an example event you expect to receive but don't (evt_123)? Do you have to webhook endpoint ID handle (we_234 in the dashboard URL)?
Thank you, I've actually been inspired while trying to reply and now may have a possible workaround. In any case, I'm still interested in knowing if there was an alternative I wasn't aware of that would let me directly access refunds from a now-unconnected Stripe account. If I try to retrieve the refund from such an account, it tells me that there is no such refund.. presumably because it won't let me load it up as the account isn't connected anymore.
i have updated stripe dll version 39.59.0.0 in web API when i try to call stripe checkoout API i am facing below issue,
With Standard accounts, this is an expected consequence of disconnecting. The connected account has decided to no longer grant you access to their data, even if you were previously involved with their payments.
I was going to suggest you might be able to expand one more layer if you request a single object instead of a list, which i suspect you figured out too. For anything else, i'm afraid you won't be able to access it and you should ensure you collect any such data at the transaction time while you have the connection. Refunds that happen after the connection is severed should be the responsibility of the connected account.
Yep, exactly what I was inspired to try ๐ I was one level off, so that made all the difference. I see, and thanks for the explanation.
@vocal wagon did that work out for you?
Please give suggestion
I'm not sure how to help here @kindred frigate - can you provide some context? When do you hit this error? What causes it? There doesnt appear to be any reference to Stripe requests/objects/SDKs in that error message, so what kind of help are you looking for?
hi! Quick question - is there a setting or something to pass on stripe fees to my customers?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
but it's honestly not very helpful and leaves me with more questions than it answers
Not like i think you're asking, no. Can you explain what you need with an example, and how that support article fails to provide what you need?
This error occurred when i change my API framework version and updated stripe dll file 39.29.00 to 39.59.00
It's simple really, I want to charge my customer $100, and pass them on the fees, right.
If they paid by bank, there's one fee. If they paid by card, there's another fee, etc.
I want stripe to charge the customer 103, 100.68, or whatever the fee is, and then the webhook to hit the server with $100 so it can top up the account with $100
Hi team, so will there be any charge on express connected account ? yearly or per transaction?
If that's not provided, the article should explain how it should be implemented (should the fee be added as a line item, should it just be calculated at the end and deducted from their account balance, etc etc)
along with all the different fees for all different payment methods
That's not supported - you need to charge your customer the amount you want to charge them. Note in that article that some jurisdictions prohibit this kind of fee payment, so be aware. This is not legal advice.
What do you mean? There shouldn't be, unless you charge them application fees or debit their account.
Then, is there a way to determine, when stripe hit the webhook, with the invoice payment success,
The article does explain it - it depends on the expected fee rates for the individual payment, which vary by country & payment method
that the customer paid by card, or bank, so that the appropriate amount may be added
it doesn't matter if it's not exact, I need to at least determine if they paid by card or bank, when they hit the webhook
Which webhook do you mean, here?
case 'checkout.session.completed':
case 'invoice.payment_succeeded':
case 'payment_intent.succeeded':
these
I checked the stripe event and didn't see anything useful that can help me determine this
Well sure, you can look at the payment intent for any of those and inspect the payment method used & fees assessed. but the payment is already completed at this point.
Doesn't matter that the payment is completed, I can topup their account with less depending on the source
At least this is the second way I can think of doing this, if it's not supported
@vocal wagon You would retrieve or expand the payment intent from the checkout session:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent
https://stripe.com/docs/api/expanding_objects
then look similarly retrieve/expand the payment_method
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method
and look at the type:
https://stripe.com/docs/api/payment_methods/object#payment_method_object-type
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
uff.... I suspected I'd have to go down this route, was hoping for something easier
thanks @daring lodge
np - you can combine this in a single call with nested expansion, so it's not too onerous
See the example here: https://stripe.com/docs/expand#multiple-levels
Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.
(it's specifically for this checkout -> payment method case @vocal wagon )
Hi @daring lodge .. thanks for ur quick response .. one more question, cld u pls tel me wats the difference between stripe checkout and stripe billing ? that ll help a lot ..
Two different offerings with some interaction. Checkout is a hosted payment page for making payments, collecting card details or settings up subscriptions. The subscription part uses Billing, which is recurring payment service.
What are you trying to do?
OK, but that doesn't answer the question about what action triggers this error. Is it request related?
Hello Again
Hi there, would it be possible to get some support with GooglePayLauncher in version 17.0.0 of the android SDK? Specifically, the SDK states that the launcher must be initialised in activity.onCreate, however during the google pay authentication verification the activity is destroyed and recreated so the result callback would never be invoked. I've followed the steps here: https://stripe.com/docs/google-pay
Learn how to accept payments using Google Pay.
Actually we are setting up a platform , where customer are allowed to subscribe our monthly or yearly plan .. and also onboard helpers as express account who gonna fulfill the customers needs. once helper's job is done, we will make payment from customer to connected account.
Jus planning on what r the stripe features and functions v can leverage for our application.
Hey there - I'm not an android expert but can try to help or get help. Is this related to the issue you were having yesterday with the test/live google pay error?
Gotcha, well, there are lots of offerings, and we're happy to help with any technical implementation questions. For broad product support support is another option available to you: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I still have a question about setup_future_usage. This will not attach the Payment Method to the Customer when the Payment Intent doesn't succeed. But some of the failure are recoverable, has insufficient_funds or try_again_later (some times do_not_honor). I looks like a premature optimisation. Is it possible to attach the customer at the reception of charge.failed because of an insufficient_funds or it will fail ?
okay thank you... one more quick question. Do stripe provide option to set the tax rate as percentage directly rather creating tax on stripe and set as txr_Id
yep, so to follow up on that - at the time we were using 16.10.0, which matched up with the docs here: https://stripe.com/docs/google-pay. Yesterday we confirmed that the intents were being successfully created but the payment confirmation taking place in android was failing. I captured the POST to https://api.stripe.com/v1/payment_methods and it was returning 200.
I raised this this morning and was directed to look at the same page as above. It referred to new api details, and I was pointed to this pr, https://github.com/stripe/stripe-android/pull/3994, showing that the docs changed some point in the middle of last week.
My preference would be to continue to get support for our 16.10.0 implementation, rather than work through the issues I've had setting up 17.0.0 today.
No, everything is done using tax rates by reference. Depending on where you operate and what you use, you might have an easier experience with Stripe Tax: https://stripe.com/tax
okay thank you
To understand my use case, I am providing a recurring payment product. When a payment fails, I send an SMS to the customer to set up a new card. When the configuration of the new card fails, the next day when I try to use the payment method again, I receive "The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first". This is annoying because most of the time the payment intention failed due to insufficient funds, so the following days the payment method should work when the bank account is replenished.
Got it .. Thanks
In those decline cases you'd need to supply another payment method for the payment intent, and if successful the new one should be attached to the customer. Is that what you mean?
Can I do a preflight check on tax?
For that kind of a request pattern you may want to attach to the customer first: https://stripe.com/docs/api/payment_methods/attach
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@daring lodge this is how work setup_for_future_usage If I understood correctly
I'm making a website, mainly for Danes, and we expect the tax to be directly on the label
Not at checkout
@daring lodge I did a refactoring to remove the attach because of the 3ds
This needs to be done with an on-session payment though, so if it declines you should get new details from your customer right then
So I'd like to ask the Stripe server what an individual's tax rate is while they're browsing the catalogue
@daring lodge on online mode, I use setup_future_usage to attach the pm to the customer
hey there! I'm trying to figure out what the data requirements are when using Stripe Connect Custom Accounts for individuals. Stripe CLI stripe country_specs retrieve AE adds some company related fields (i.e. company.{name|structure|tax_id}, individual.business_vat_id_number) which I don't see in Stripe API docs for the Account object. And the docs here (https://stripe.com/docs/connect/required-verification-information#AE-full-company--transfers) won't let me select 'individual', only company. Can someone help me figure out what's required and what is not?
Learn what required verification information you need to collect for each country when using Connect.
But if the payment intent failed, the payment method is not attached
If you mean discovering their tax amount ahead of time, no, that's not available.
Where do I file feature requests?
๐
Because that is something I'd absolutely love to have!
On online mode => setup_future_usage=off_session, if Ok => customer automatically attached to the customer, if KO and decline_code=insufficient_funds, when I received the charge by webhook, attach the payment method to the customer. The purpose is to save the payment method to be reuse the next day if the bank account is replenished. 1) Is it a good pattern ? 2) Attach the payment method to the customer when the payment intent failed because of decline_code=insufficient_funds will work ?
@fallow carbon the individual is a representation of the business representative/owner/executive, if i recall. Those people (where required for a company) would each be individuals/persons in the API. THe required verification info page you linked to has the details of what's required for each.
@daring lodge on that page I can only select business type 'company' and then a subcategory (i.e. LLC), which doesn't apply to our scenario, as we'd be working with individuals
maybe that page is not set up properly yet for UAE as Stripe is still in beta(?) in that country
We can pass that along ๐
@north ether hello! I'l back on, catching up, could you bring me up to speed on anything new
Hello,
I am getting below error in web api c#
Warning >> The primary reference "Stripe.net" could not be resolved because it was built against the ".NETFramework,Version=v4.6.1" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.2". stripeAPI
Right, but this is only true for the first PI with that PM right, when your customer is online?
hi - using 16.10.0 I captured the POST to I captured the POST to https://api.stripe.com/v1/payment_methods after a successfully created payemtn intent, and it was returning 200. But the payment was never accepted.
@kindred frigate hello, one sec
I've had a crack at integrating 17.0.0's GooglePayLauncher today but it isn't looking like a suitable option for us because the launcher creation logic that is sat in the activity.onCreate is recalled when google play destroys & recreates the activity if it has to hand off to another activity eg for passcode validation
i'd really like to fix our use of 16.10.0 if at all possible
No, you need to complete the first payment while the customer is on session to handle the auth and you get the successful response, the PM will be attached. If there's a failure you collect new payment details right then.
If you don't want to collect payment up front with the customer, you should use a setup intent to handle the auth instead, which attaches the payment method to the customer without a payment:
https://stripe.com/docs/payments/save-and-reuse
Learn how to save card details and charge your customers later.
@north ether so I don't think implementing GooglePayLauncher will fix the issue for you, we're still referring to the issue we spoke about yesterday, right?
the issue with payment intents being created but payments not actually being completed
It looks like only businesses are supported today, but I'd recommend reaching out to support to find out whether your use-case is supported: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
This looks like you need to update your .net framework version to use the selected version of the Stripe SDK
which version it will support
@north ether can you share a request ID to where you got a PaymentMethod created? Want to see if it was a Google Pay PaymentMethod being created
@north ether and yeah I can help you with 16.0.0, let's not go the GooglePayLauncher yet as I think there might be an integration issue on your end (if not something else)
starting pm_xxx ?
much appreciated ๐
please suggest .net framework version
@north ether yes the pm_123 ID, or the req_123 request ID
pm_1JFERqLZMMa5HMOVUzn70Sfy
The error says 4.6.1 is the target version, right? So I would expect that. Looks like that was added with 35.11.0: https://github.com/stripe/stripe-dotnet/blob/master/CHANGELOG.md#35110---2020-03-30
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - stripe/stripe-dotnet
@north ether ok great so that is a Google Pay PaymentMethod card.
So really, that helps me the most in that your Google Pay integration is working fine.
Really what is not happening is that your code is not confirming the PaymentIntent, with that PaymentMethod. So looks like your code is missing something and should be fixable
Would be a harder problem to solve if Google Pay was not working, but it is here
so potentially the params I'm passing to stripe.confirmPayment are missing some details about the intent? maybe I could capture those params and drop them here?
@daring lodge I cannot use Setup Intent, it's very disturbing for customer to have a 3DS at 0โฌ
@north ether you need to pass the PaymentMethod ID from earlier, into the confirmPayment() function. I actually think your code isn't calling confirmPayment()
@vocal wagon hello, I'm catching up, could you bring me up to speed?
@north ether because the PaymentIntent IDs you shared yesterday, I didn't see any confirmation requests on it, so I don't think confirmPayment() is being called at all. Or something along the lines but that is the code I'd debug on your end, add logs, view the params being passed to confirmPayment()
Hi there, when I cam trying to cancel a subscription it is saying that it doesn't exist but when I view the customer on dashboard they have the subscription id ( "sub_sched_1JFKeSKHMXCcrj1e0PLOCi85")?
var service = new SubscriptionService();
var cancelOptions = new SubscriptionCancelOptions
{
InvoiceNow = false,
Prorate = false,
};
Subscription subscription = service.Cancel(subscription_id, cancelOptions);
any help would be great
@north ether To understand my use case, I am providing a recurring payment product. When a payment fails, I send an SMS to the customer to set up a new card. When the configuration of the new card fails, the next day when I try to use the payment method again, I receive "The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first". This is annoying because most of the time the payment intention failed due to insufficient funds, so the following days the payment method should work when the bank account is replenished. On online mode => setup_future_usage=off_session, if Ok => customer automatically attached to the customer, if KO and decline_code=insufficient_funds, when I received the charge by webhook, attach the payment method to the customer. The purpose is to save the payment method to be reuse the next day if the bank account is replenished. 1) Is it a good pattern ? 2) Attach the payment method to the customer when the payment intent failed because of decline_code=insufficient_funds will work ?
yep makes sense thanks. Is there somewhere I can confirm what params should be supplied in ConfirmPaymentIntentParams, so I can see what's missing?
hi mate, I'm not stripe staff sorry
@dire quarry that is not a Subscription ID, it is a SubscriptionSchedule ID, you're calling an API to cancel a Subscription so you need to pass the Subscription ID
@vocal wagon I think you meant me haha
Hello, any developers in here that can answer my question? I have a customer who has updated his email address (as his old one was compromised). We use Zoho to process subscriptions. Nothing from us is still being sent to his old email, but confirmation of payment from stripe is still getting sent to his old email. How do I go about updating his email with stripe?
Yes @bold basalt sorry
Thanks mate, lack of sleep lol
@north ether just log out what PaymentIntentConfirmParams are being passed to that function, you need to pass the PaymentMethod ID there. Use the Android Studio debugger and set breakpoints or log out the params being passed to that function (or if it is even being called)
@eager torrent hello, not sure how your integration works via Zoho but I imagine the answer is updating the Customer's email in the Stripe Dashboard? I can't really say as it depends on how this is working with respect to Zoho. Are they sending their own emails or emails through Stripe?
@vocal wagon reading your q
it's sent from a stripe email address to him and says
You're receiving this email because you made a purchase at Producertech, which partners with Stripe to provide invoicing and payment processing.
at the bottom
@vocal wagon why not attach the PaymentMethod to the Customer first, so that you can re-use it later? Like your main use-case hinges around charging a PaymentMethod multiple times. The way to do that is attach it to a Customer first, so it is reusable, otherwise it just becomes consumed when used the first time
ConfirmPaymentIntentParams(paymentMethodCreateParams=null, paymentMethodId=pm_1JFKp3LZMMa5HMOVzW2rZINs, sourceParams=null, sourceId=null, extraParams=null, clientSecret={{pi_XXX_secret_XXX}}, returnUrl=null, savePaymentMethod=null, useStripeSdk=false, paymentMethodOptions=null, mandateId=null, mandateData=null, setupFutureUsage=null, shipping=null, receiptEmail=null)
(I've redacted the client secret). Should those braces be there?
@eager torrent ah gotcha, I'd talk to Support about that at https://support.stripe.com/contact, they're experts at Dashboard so they'll be able to help you out in updating the Customer email, mention that you basically want to send the Invoice to a new email
@bold basalt I have lots of 3ds issue when I attach the customer first
Thankyou so much! @bold basalt I had a feeling i was in the wrong place to ask my query
๐
@north ether ok the params look fine but yeah the clientSecret doesn't look right. Also is your confirmPayment() function being triggered? or is it validating the clientSecret format and throwing an error?
@bold basalt stripe support tell me to do not use the API attach payment method
I wrapped it in a try-catch expression and it didn't hit the error breakpoint
@eager torrent no worries, for context we help developers who are coding their Stripe integrations with their questions here
@north ether the error would trigger in the onSuccess or onError callbacks, no?
@north ether do you see any API request going out to /v1/payment_intents/:id/confirm
nope
Stripe.confirmPayment(fragment, confirmPaymentIntentParams, stripeAccountId) doesn't take a callback, or return a value
@vocal wagon based on what you said, I think you should go that route. Like really, based on the error you shared, that is what you would do. You would do that after the first call failed or before but either way you need to if you need to reuse the PaymentMethod
Shared with the team and as a follow up: what kind of payments are you using? With Billing/subscriptions you can use the upcoming invoice API to preview taxes:
https://stripe.com/docs/tax/subscriptions#preview-price
But for one time payments via Checkout this isn't available
Learn how to automatically calculate tax on your subscriptions.
@north ether so your function is probably validating and not actually calling the API, most likely due to your clientSecret value, it needs to be just a string, not wrapped in {{ }}
I haven't started developing my system yet. But it's going to be a run of the mill commerce
so you add your books to a cart and then checkout
no subscription
@north ether also not sure if this changed in the version you are on but this is how you handle the callbacks with onSuccess and onFailure after calling confirmPayment
@north ether you implement that in onActivityResult() so it isn't right where you call confirmPayment()
I can't see where I'd register those. I have callbacks for createPaymentMethod, and in the success one I call confirmPayment
@north ether in your onActivityResult() as shown in the code snippet example I shared with you
@green notch Gotcha - so for one time payments Tax is only supported via Checkout today, not custom payment intent-based integrations, and there is not currently a way to preview those taxes. Are you planning to use Checkout, or build your own payment flow?
@north ether so I think you need to fix 2 things here: 1/ implement the callbacks for confirmPayment() and 2/ make sure the right params format (like clientSecret) are being passed to confirmPayment()
I believe that should make it work right, just 2/ alone will allow you to confirm the PaymentIntents but 1/ is important too
You can attach to the customer, but to do future off session payments you must successfully complete a payment or setup intent with your customer on session
dropping the surrounding braces worked ๐ . I'm still struggling to see where I actually supply the callback - could you possible share the code sample again?
@vocal wagon for example, if the payment intent fails with insufficient funds, your flow could fall back to using a setup intent to collect the details and save the card to try off-session the next day
@north ether was referring to the code snippet following in this section: https://stripe.com/docs/payments/accept-a-payment?platform=android&ui=custom#android-submit-payment
and yay it worked! was hard to debug because of the missing callbacks, nothing logs!
Securely accept payments online.
Gotcha. Makes sense. Just be aware this isn't supported by Stripe Tax today.
I gathered as much
I just want the price label to have tax up front
Wayyy up front
I'd buy you a beer if I could
@north ether haha thank you for the kind words but we're here to help
You would need to collect customer information to be able to do this in many cases, but since you'd need to manage the tax rates yourself for this payment flow you can include it where you like.
bye for now ๐
Hi there, the support forwarded me to this discord, thank's for this community support!
We are having issues with some (not all though) GiroPay PaymentIntents (transfer_data.destination is set to a connected account with a platform fee for the payment if that's relevant) authorised with the Stripe.js API 'confirmGiropayPayment' method. The PaymentIntent ends up in the Incomplete status with a "Payment failed" due to failed authentication in the timeline (status is "payment_intent_authentication_failure") - I can provide you with an example id / dashboard link if that's usually done here / would help you.
As the support confirmed this is usually caused by the user aborting the payment authorisation before being redirected back to our website again but we've gotten reports from multiple users that they were indeed redirected back to us and I was able to confirm this once with a test payment (not again afterwards though).
My best guess for the reason of this issue was an accidental redirect on our site to a different URL within our website. My assumption was this might have caused the redirect from not being confirmed but the issue persists after I fixed that redirect and the user stays on the redirect page. I just remembered though that one query parameter still changes after the redirect.
Might the URL change on our side be the cause for the payment failing or how is the redirect after the GiroPay authorisation on the bank website confirmed? My assumption would be the Stripe.js SDK integrated on our website? If that's done on your side before the user is redirected back to us is there any other reason you can think of for this error?
@trim turtle hello, reading one sec
@trim turtle example ID of a PaymentIntent would be great
Thank you! Sorry for the wall of text ๐
@trim turtle all good, more detail the better
Is there a way of setting a subscription schedule phase to last forever?
@stray skiff with end_behavior: release you basically get it to continue the underlying Subscription which continues forever https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@trim turtle could you pls share the PaymentIntent ID of one such Giropay payment? I can work backwards from there
Sure: this is one: pi_1JFFevEzBYXlqFmpR1Cdao0a
@trim turtle thanks looking
Hi @bold basalt just dropping in again as I've not managed to detect the callback after client.confirmPayment.
You pointed me to this logic (stripe.isPaymentResult I assume): https://stripe.com/docs/payments/accept-a-payment?platform=android&ui=custom#android-submit-payment
but that method isn't evaluating to true.
Securely accept payments online.
@north ether oh you're on an older version of the SDK right, you might need a different syntax, one sec
I'm on 16.10.0, that's just the only version of the docs I could find
@north ether yeah docs are on the latest version of the SDK so they're using a newer syntax (trying to recall the name for what to call it)
@north ether hmm wait you're on v16.10.0 ? not 16.0.0 ??
@north ether cause that wouldn't be old, 16.10.0 was this month
@trim turtle is stripe.isPaymentResult() evaluating to false in the createPaymentMethod() callback? I think it would be true only for confirmPayment() callback
defo 16.10.0. Archived docs I've looked at today are for 16.8 to be fair
@north ether no worries, I think I misread earlier and assumed it was 16.0.0
I create a schedule to upgrade the users' subscription at the end of the current billing cycle and I want that phase I make for the new subscription they want to stay forever, the end behavior stuff just keeps the original one running, doesn't it? So if I upgrade from A -> B then after a month the phase is done and then it continues the original A payments? Or does it continue with the B payments?
@trim turtle ok so here's what I'm seeing (and caveat that I have limited visibility into what happens during authentication)
You call confirmGiropayPayment from Stripe.js, that shows the authentication page, now I think either the customer isn't authenticating or they are failing authentication. So basically a payment cannot be created and they're brought back to the page you passed in return_url .
With that said, I wasn't sure about the later parts of your questions, what they meant. But that is the state as I see it above^ , so let's start there
@stray skiff I would assume it continues B, not A. After you make the change, inspect the underlying Subscription and see what Prices / SubscriptionItems it has on it, whatever that has will be continued
think this one was for me. I call confirmPayment in the createPaymentMethod success callback, and I'm checking isPaymentResult in the main activity onActivityResult, but it's never true.
ah yeah sorry wrong @
Cool, thank you. I'll create a really quick subscription and see what happens I guess haha
@bold basalt authenticating would mean logging in on the website of their bank and approving the payment there? The users usually report that they see a charge on their bank statement afterwards (that get's reversed a few days later because the payment failed of course)
@bold basalt The later part of my question was intended to ask if we can mess up the redirect confirmation (e.g. with a redirect within our website) on our side or if that's done before the user get's back to us from their bank website
@trim turtle don't know the full mechanics of it but yes it would be some page/redirect Stripe.js shows where they log in or SMS verify to authenticate and get redirected back
they see a charge on their bank statement afterwards (that get's reversed a few days later
don't fully know how Giropay works downstream (if that is expected or not) but the reversal ultimately sounds right as the authentication declined (again can't speak to the details on how that works downstream)
@trim turtle
if we can mess up the redirect confirmation (e.g. with a redirect within our website) on our side or if that's done before the user get's back to us from their bank website
not sure I understand but basically you're using Stripe.js so once it handles authentication, it just redirects back to your webpage. So it would happen after the customer is done with authenticating.
@north ether reaching the limits of my Android debugging skills here but can you make sure the right activity is being passed into stripe.confirmPayment(...) ? cause as I understand, the Intent is passed to that Activity that you're passing into confirmPayment() so it can call your completion callback on it. That is what I could think of
I'll have a look. I also spotted suspend fun Stripe.confirmPaymentIntent(confirmPaymentIntentParams, idempotencyKey) in StripeKtx.kt. Is this an alternative I could use instead of the confirmPayment that takes an activity?
@bold basalt Yes, it's a page actually provided by their bank if I understand correctly that redirects them to https://hooks.stripe.com/redirect/authenticate/... (see evt_1JFFv7EzBYXlqFmp1hnmEBLn for example). Just my understanding and might be different though. The event I referenced appears very shortly after the request to confirm the PaymentIntent and is what's transferring the PaymentIntent to the requires_action status
@bold basalt Yes, it's happening after the user was redirected back from the bank website to us after authorising the payment
passing the correct context (activity not fragment) did the trick
@trim turtle yeah so that event is basically the interstitial event from the PaymentIntent being confirmed on your webpage. So it goes into requires_action status and Stripe.js displays the authentication page (the hooks.stripe page).
Once that is authenticated, they're redirected back to your webpage (the return_url )
@north ether great!
@bold basalt Ah okay - and because Giropay is authorised on the banks website the customer is actually redirected away from our website to the bank website instead of "just" a popup or similar by the Stripe.js SDK?
@trim turtle it would be either a "modal popup" or a full page redirect, I thiiink Giropay is a full page redirect .. yeah fairly certain it is a full page redirect
@bold basalt Yes, can confirm from testing that it is a full page redirect
@bold basalt And the redirect_to_url action to the hooks.stripe page from the event I referenced is the redirect to the customers bank? Or is it the redirect from the bank site back to ours?
@trim turtle so in that redirect_to_url hash, url field would correspond to the bank authentication page
return_url is your page that will be sent back to
Since you're using Stripe.js, it handles those for you so you don't have to worry about those, like it redirects to the bank page, then after completing that, returns your customer to your return_url
@trim turtle I think your return_url page is assuming payment is successful , I would instead re-fetch the PaymentIntent and look up the status of the PaymentIntent and only call it "successful payment" if the status is succeeded. Not sure if you're already doing that or not, just wanted to call it out
@bold basalt Thanks, yes we are refetching the PaymentIntent / updating it's status and handle different states accordingly. This was actually the wrong redirect I referenced in my initial message which we fixed, the status check still returned pending, most likely due to a race condition. This race condition is why I suspect there is some form of confirmation happening after the redirect
@bold basalt This would come back to the later part of my original question. Is there some form of confirmation (probably by the Stripe.js SDK) that the redirect to the return_url actually happened / succeeded?
@trim turtle
Is there some form of confirmation (probably by the Stripe.js SDK) that the redirect to the return_url actually happened / succeeded?
what do you mean by "confirmation", do you mean in general terms or the API terms (e.g. confirming a PaymentIntent)
But the redirect happened is basically if you end up on your page or not, so basically if your redireect page's code is triggered, then your customer was brought there. It would happen in both successful or failed payments. Customers can authenticate but still not be redirected to your page e.g. if they close the page right after redirecting.
@bold basalt I meant some kind of technical confirmation, e.g. the Stripe.js SDK sending back to Stripe that the redirect was completed or does the outcome of the redirect back to the redirect_url not affect the confirmation / authorisation of the payment at all and the error has to occur earlier?
@bold basalt The URL contains a few extra query parameters after the redirect in addition to the ones set in confirmGiropayPayment, among them redirect_status=succeeded which would indicate whether or not the authorisation was successful or not, correct?
@trim turtle ah I see
@trim turtle the PaymentIntent status is the source of truth here, which you're already fetching and looking up the status of
@trim turtle the PaymentIntent is what moves funds, so if it were succeeded it would mean it was authorized
hello, i have a question
@bold basalt It returned requires_action, at least in my test. But the required action is the redirect to the bank website from which I just came
@trim turtle do you have a PaymentIntent ID for that one? and this was after you fetched it on your redirect, right?
@bold basalt This one: pi_1JAGLLEzBYXlqFmp6EoCx5ph Yes, the status requires_action was returned when fetching it to render the page set in redirect_to_url
๐ @bold basalt had to step away, but I'm taking a look now!
Hello @dim hearth and thank you very much @bold basalt for your very detailed support!
We're still looking into it, but what we do see so far is that particular payment intent went through an atypical flow - while the redirect to giropay was successful, we initiate a cancellation + refund soon after which is why the intent didn't transition to a successful state
@dim hearth Thank you very much! I'm not 100% sure but if I recall correctly all the test payments afterwards (pi_1JAGzGEzBYXlqFmp0NTeK02C is the only other prod test and a bunch of payments in the test mode) returned succeeded as the status and didn't cause the wrong redirect on our page. That's the reason I am mentioning the redirect or any form of technical conformation after the redirect to the redirect_to_url so often
@trim turtle We figured it out! What's happening for that particular payment intent is that there was a request made to update it (req_eH5G5fk8Ax5aYm) after the user had already been redirected to complete payment. This update cancelled the underlying source, and so by the time the user had completed the redirect we immediately refund any funds that had moved and the payment intent does not succeed. Does that make sense?
@dim hearth Oh, I see. Yes, makes total sense. I'll have to check our code then and find out why we trigger that update call and fix this. Thank you so much!
@dim hearth Am I missing this update call on the first example (pi_1JCNAOEzBYXlqFmpNugjWi4J) or did this happen there too? I fixed one of these duplicate call bugs (which resulted in updating the PaymentIntent if there already is one for that particular customer / item)
No, that one isn't failing because of a subsequent update call. For that PaymentIntent Stripe never received confirmation that the user completed the redirect - which is usually because of an issue between the issuer and PPRO
@dim hearth All right, thank you! For that payment we have asked the customer about more details to understand the issue better so I cannot confirm whether or not they were redirected
Hello, I am trying to integrate Stripe with my website product page. On my website, it shows that Stripe was connected, but I received an email saying that the endpoint was not working, and asked me to add a new endpoint, but I don't know how to add a new endpoint... Also, do I need to create a new API key every time I try to integrate Stripe with a new platform?
@dim hearth Hello, I am trying to integrate Stripe with my website product page. On my website, it shows that Stripe was connected, but I received an email saying that the endpoint was not working, and asked me to add a new endpoint, but I don't know how to add a new endpoint... Also, do I need to create a new API key every time I try to integrate Stripe with a new platform?
You can add a new webhook endpoint through the dashboard (https://dashboard.stripe.com/webhooks) or through the API - when you look at your current webhook endpoint what responses are you seeing returned for events?
@languid vault And no, you should not need to create a new API key every time you integration with a new platform.
I see. I copied the "Secret API" from Stripe to my website where it asked for Stripe Secret Key, then it showed "Connected" on my site...
Are you using a plugin or are you integrating yourself?
It is a platform to build online stores...
Sorry to redirect, but In that case you will need to talk to that platform's support team if you are running into issues!
It is showing "Connected" on my end...
Yep this is a plugin's site so we don't control that. You will need to work with that plugin.
This is part of the email I received from Stripe...
As karbi mentioned above, you can add a new endpoint via the Dashboard or API, however I would suspect the plugin you are using is handling this for you so you will likely need to work with them to solve the reason your current endpoint is not responding to the events successfully.
One more question, is there a way to set up a subscription based products on Stripe in advance?
Are you interested in setting up the products themselves or creating the subscription in advance of it starting?
Thank you. I will talk to their support as well. I just thought I'd talk to you guys first, in case the issue is with Stripe or how I set up my Stripe API
Creating the subscription in advance...
When I tried that, Stripe was asking me to fill out product name, and client information...
I'm definitely happy to help if I can... from what I can tell your plugin is managing your webhooks so unfortunately they would control the issue. If you set up an endpoint on your own server then feel free to let me know and we can debug further.
You can't actually create the subscription in advance without using a trial period.
I see. Currently, "Trial" is disabled in my Stripe account, so do I need to enable "Trial" first?
I think you are confusing the plugin you are using and your Stripe account. Trials are not something you enable/disable on your Stripe Account -- they are available by default. So, you will want to talk to the plugin about that too for how to use trials with their system.
Sorry... had a typo there... trials are not something you enable/disable on your Stripe Account
(I edited)
Using callback from a checkout session, how would I get the id of products the customer bought?
do I need to use the payment_id and fetch info related to that?
You would want to retrieve the Checkout session and expand the line_items: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
I believe in my Stripe settings, there was "Enable" toggle next to trial period...
I thought I saw it when I was setting up my Stripe settings a couple days ago, now I am really confused...
So how do I set up the trial period then? On Stripe side or with my store platform?
The screenshot you provided earlier is not from your Stripe settings; that is from the plugin you are using. Was it on the same site that you saw that trial toggle?
The way plugins work is that they control your Stripe Settings for you. So only they will know how their system works and what you need to do.
This is the screen when I tried to create a subscription on Stripe...
Ah okay, yes that is from your Stripe account and yes you would add a trial using the "Add trial" button at the bottom of the screenshot.
The very first box is "Customer"... How can I create a subscription in advance?
Is there a way to make it so that automatic payouts through Stripe don't occur if the account is below a certain balance?
It is still the same even after I clicked "Add Trial" and entered "7" days...
It sounds like you want to use the "Schedule subscription" button in the top right if you want to schedule on for the future.
@languid tulip can you expand with .redirectoToCheckout() method?
It is still asking for the customer name first...
Yes, you are required to create a customer to use Subscriptions
@wispy star No, you would need to turn off automatic payouts and use manual payout logic on your end to do that.
So I can't sell a subscription product to a new customer at a checkout page?
And I can't enter a customer's info manually into Stripe as a subscription product buyer?
I dont see an option looking at the docs for expand so I would have to request in a webhook?
Are you using webhooks? The easiest way would be to listen for the checkout.session.completed event to retrieve the prices
@languid tulip I want to know what product the user bought, not the price.
e.g. if two items are $5, I want to know which one they bought
i dont see an option to implement expand using redirectToCheckout()
so would I just have to make another call to the API after successful purchase?
Yep the "products" are actually referred to as Prices in the API: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price
Yes correct. Sorry for not specifying before.
How would i go about using the returned object to go fetch the items they bought exactly?
You can manually create the customer object before starting the Subscription. Ideally you would not be collecting their payment information and manually entering it (due to PCI compliance). Yes you can start the subscription via the Dashboard as you were doing, but you must have a customer object created first and if you are using 'charge_automatically' then you must have payment information ahead of time as well.
@languid vault Taking a step back, can you tell us a bit more about what you're trying to build at a high level? As mentioned above, you can start a new Subscription from the Dashboard, but typically you would define Products and Prices that would then be used by your code or a plugin to create Subscriptions rather than you doing it manually.
We have digital marketing services that customers pay on a monthly basis... So it would make sense that when they check out on my website, they are automatically added to the subscription and they will be charged automatically every 30 days...
I was told that PayPal has that feature, but my clients are business owners, they prefer to pay with their cards...
You would listen for checkout.session.completed and then fetch that Checkout Session from the API and expand the line items (https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items). The product will then be in line_items.data.price (https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-product) and that is expandable as well.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@languid vault Usually the easiest way to build something like that would be to use Stripe Checkout in subscription mode, but it sounds like you're using a plugin. Do you know if the plugin you're using supports Stripe Checkout?
I don't think so. The developer asked me to get recurring payments set up with PayPal, and use Stripe in the mean time while I wait for PayPal to get set up...
How do you get the Stripe Checkout in subscription mode?
@languid vault We have a guide for Subscriptions with Checkout here: https://stripe.com/docs/billing/subscriptions/checkout
Learn how to offer and manage subscriptions with different pricing options.
I can build a checkout page with a different platform if necessary...
Thank you for the info
๐
Hey how do i get in touch with customer service?
Hi @peak nest - you can reach out to support here: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Hey Guys, need to check one question, recently i am upgrading the Stripe version from 8.1.0 to 16.7.1 in Android for my project. After some steps, i observed that stripe.createCardToken(card, "", "", new ApiResultCallback<Token>() {}) is always jumping to onError method instead of success and error message is showing as:
*The provided key 'pk_test_********************************************************************************************eHQxUV'
does not have access to account '' (or that account does not exist). Application access may have been revoked.
Does anyone know what could be the issue here and what am i missing?
Can you share the request id that returns that error?
https://stripe.com/docs/api/request_ids
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Actually, i dont have access to the Dashboard so far but whenever i checked online so it says it would need some Account ID and i am passing that already "Stripe stripe = new Stripe(AddCreditCardActivity.this, stripeApiKey, "acct_XXXX");"
Where are you seeing this error then?
I can see in my android code
Oh okay, found a very silly mistake and changed the method from stripe.createCardToken(card, "", "", new ApiResultCallback<Token>() {}) to stripe.createCardToken(card, new ApiResultCallback<Token>() {}) means from 4 parameters to 2 and it started to work.
Hey - interested to know if there's a way to prevent a charge from being included in a payout. As an example scenario we are charging users $5 and then transferring 90% of that to an instructor on our platform but only once that instructor has completed the class they are offering (that the user paid $5 for). A user may be able to pay weeks ahead of time so in order to prevent a scenario where our balance may be too low is there anyway to prevent that $5 charge from paying out on our main account until we transfer to the connected instructor account
Ah nice, no more issue then?
Thanks for your help at least you started to look into this. @daring lodge
@serene moon you either need to use manual payouts on your own account to manage your balance, or alternatively transfers the connected account amount right away but use manual payouts for your connected accounts based on some kind of pending/owing tracking on your side.
No cannot selectively exclude some amount/payment from automatic payouts.
okay, thanks - that's what I thought
hey all! question about API keys... does Stripe have any protections on how an API key is used? For example, can I specify that Stripe should ignore API requests with a certain key unless they originate from a specific IP address?
Quick question ๐ When allowing a customer to add/replace card on file and using setup intent, is it necessary or recommended for any reason to cancel previous attempts if they exist? Is it okay to just create a new one and forget about the previous one?
i'm also curious about that, except in my case PaymentIntent. my account is filling up with incomplete payments. is that ok?! eeek
@safe tundra Please contact support to ask about this for your account ๐
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
will do, thanks!
@open crystal doesn't sound great. I'm not really seeing any urgency (yet) from the docs to remove previous intents for my case. But it's there for a reason...
You don't need to, except for your own data management reasons, these can be safely ignored. If you know you have no more need, canceling is tidier.
@daring lodge I'm not storing them in my database, but enforcing that methodology when attaching a card to a customer. Any reason I should be storing the intents?
Same for you @open crystal - these can be ignored using the other payments tabs in dashboard, or with status filters
What I'd really like to do is replace the existing card on file ... using elements, to benefit from 3d secure and all the other features.
We don't want customers having multiple methods on file
i'm creating a temporary order (in my database) with each of my created PaymentIntents, and converting it to a real Order after webhook confirmation. Using PaymentIntents as described in docs/tutorial lead me to some icky development path, i feel
@open crystal the reliance/recommendation on webhooks is what's hanging me up a bit
same!
I have a customer in real time updating information
To replace the existing saved card when you only want one in the steady state, I'd recommend using a setup intent to authenticate the new card, then updating any subscriptions or the customer invoice default payment method, and any representation you have for the "default" PM for that customer, then detach the previous payment method
so with webhooks that would be handled when the setup intent succeeds, you process the new payment method as described, remove the previous one
@daring lodge Agreed. But because I'm using elements, I can't decide on whether or not to wait for the webhook or do a lookup on the payment method after the fact. It 's hard to explain my hang up on the webhook. They seem reliable, but it's more about deciding a path for real time. Hard to explain my issue. It's probably just me.
I do see that I can await on stripe.setupCard
i'd recommend a two prong: await the async result from confirmCardSetup and call to your server to Do The THings.
As a backup, have a webhook handler (sometimes 3ds fails to redirect users back etc) and when you get the setup intent success event, you check if the PM has already been replaced, and if not, Do The THings
I wonder if there's a way to tell if the webhook fired from app initiated API request compared to stripe dashboard
Hello, Is it possible to work with stripe payment intent with 3d secure validation without webhooks to check if payment is successfully validated by the client ?
@fierce flume as @daring lodge just mentioned, there are cases where they are redirected, so you'll have to handle that when they come back to your app.
๐ข no love for webhooks
The new Stripe CLI is pretty awesome though!
You can await the result of confirmCardPayment as in most cases this should work well, but issuers sometimes do funny things with 3ds and it can lead to a customer not getting directed back to your app, so you should not 100% depend on that, even if it works most of the time. We recommend listening to webhooks to catch any cases where something in the user device/browser interferes with a synchronous handling.
This is similar to (but distinct from) redirects after checkout -- you shouldnt rely 100% on customer redirects to your success page for fulfillment. You can handle this and check the session result when the customer hits your success page, but you should also listen for checkout success webhooks incase the redirect fails or the customer closes their browser after paying before they get to your page.
If a customer's invoice/subscription status is unpaid (expired card for example) and they update the method, does this new smart retry thing I'm reading about pick up on that? Or would I need to manually initiate a collection request for unpaid balance?
@sage acorn hello, I think you need to set the new card PaymentMethod as the default_payment_method on the Subscription first, then it will be picked up for the Subscription's retries
@bold basalt sounds right. I'm about to deviate from the subscription level and set as default for invoice payments on the customer object. There's no reason in our application for a customer to have multiple cards. Hoping the same retry applies there as well
@sage acorn yeah should work the same there, assuming the Subscription doesn't have default_payment_mehtod set and is already leveraging invoice_settings.default_payment_method from the Customer object
Hello! Iโve a question about the api. Iโve got 2 api keys that I can connect with, but when using the public keys only one returns a fingerprint. Is there some setting I have to fiddle with to get both keys to return a fingerprint? This is specifically when dealing with the BankAccount object.
Anyone have experience writing unit tests for webhooks? Webhooks are working as I want them to in my staging environment but I want to be extra safe. My webhook endpoint is "/api/payments/stripe/webhook/<webhook name>"
can I just simulate post requests to that endpoint?
/api/payments/stripe/webhook/customer_created/ for example? doesn't seem to be working
@sacred totem fingerprint is a secret key only field, not viewable via publishable key, that is by design.
@sacred totem you can do a server-side roundtrip to look up the fingerprint of a token
@vocal wagon I created a single controller to handle all webhooks from Stripe. It's just a switch statement to determine what actual method to call, which allows for dependency injection. Since a unit test should be detached from any network related functionality and be isolated, I would make sure your webhook entrance point is very simple, which triggers a separate method to handle the payload.
@bold basalt I see, thank you!
@vocal wagon you would set up a mock event body and pass that to your webhook handler function instead of mocking the whole POST request
hmm - I'm using dj stripe so I don't have one webhook handler function
Mine are set up this way -
@webhooks.handler("checkout.session.completed")
def checkout_success(event, **kwargs):
so when i have the result of confirmCardPayment, i have to call again my backend app to make payment in success ?
All webhooks are sent to this endpoint via djstripe
path("stripe/", include("djstripe.urls", namespace="djstripe")),
@fierce flume hello, confirmCardPayment will result in a successful PaymentIntent
@fierce flume you don't have to do anything further with that PaymentIntent
@vocal wagon https://github.com/dj-stripe/dj-stripe/blob/master/tests/test_webhooks.py I know this is the main repo but perhaps it'll help
yes but in thread i have an particular case
@fierce flume can you link to that earlier msg for context
this
ooooh thank you! I'm pretty noob developer and not really sure what to do with this though lol - could you help point me in the right direction?
I don't need to write my own tests since dj stripe already has these pre-written, is that the case?
or I will need to import them and customzie them to my project?
@fierce flume sure but my answer still stands. You don't have to do backend logic to make the payment a "successful" payment. Are you asking "do I need to check the status of the PaymentIntent after confirmCardPayment() completes?" if so, sure you can check that server-side but you don't have to do anything to the PaymentIntent server side to make it succeed.
@vocal wagon I don't know much about djstripe, but generally speaking you don't test external libraries, but rather test the result that they generate... not their core functionality.
@vocal wagon I'm in .net world so it's beyond me ... sorry ๐ฆ
I see - that makes sense! I think my struggle is how to mock up those results if I can't call a specific endpoint to get that result
no worries I appreciate the assist!
@vocal wagon Sure. You may ask a question directly on their repo... someone there may be able to help.
ok i see your logic.. i have a Charge object with a state ( paid / pending / failed / refused / complaint ) to make my app Charge from pending to paid, i have to know if payment intent is success after frontend exchanges with stripe api
i have to make a call after stripe response ( confirmCardPayment result ) to update my app object ? and also a webhook to catch any other update ?
it's radio silence over there the last few days ๐
tried there first
@fierce flume ok so in that case, after confirmCardPayment promise resolves, you can then send that PaymentIntent ID to your server, look up the status and then update your own charge object record
and if my customer loss his connexion between confirmCardPayment response and sending PI ID to my server ?
Hi! I sell a Discord bot but we do not want to do the VPS to do the Stripe payments, we want to use Stripeโs checkout. How can we implement a custom field so the user can put their UserID when they checkout?
@fierce flume that is why you need to listen to webhook events, to handle that case
@frigid sonnet hello, Checkout itself doesn't support a custom field on the page itself yet, you could set up a text input before displaying Checkout, and validate that on your end (whether it is a UserID or not), then send that as metadata on the CheckoutSession or the underlying PaymentIntent of the Checkout
Is there any intent for custom fields to be added to checkout?
okay now i see, i have to make 2 endpoints for catch this, thanks
@fierce flume why 2 endpoints, what is the first one for?
@frigid sonnet I think I've heard feedback around that but not sure there's anything in the works on that
Alright. Thank you for the insight!
Is it possible for a webhook to contain data that's not available immediately when fetching from the API? For example, on attaching a new card via elements, on the webhook if I immediately try to fetch that payment method, it's not found. I have a breakpoint in the code. It's certainly there now in Stripe, but at the time of the hook, not found.
@sage acorn I don't think that would be possible no. Like I'm assuming the webhook event you're listening to is related to that object you're fetching? in which case it would already exist in the API.
@bold basalt I'm going to try again to confirm.
@bold basalt So it appears there is a difference between { customer.default_source } and {customer.invoice_settings.default_payment_method}
@sage acorn yep
I tried to set both
@sage acorn you shouldn't be setting both, only the latter
What's the point of the first one?
If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.
In the docs, is the previous prop deprecated in favor of payment methods API?
@sage acorn first one was pre-PaymentMethods, for Tokens/Cards/Sources, looks like you're using PaymentMethods.
PaymentMethods don't work with default_source
@sage acorn and yes Tokens/Cards/Sources are not now considered legacy
I shouldn't have waited all these years to come back to a new stripe project
Is there any benefit to setting the default payment method on the subscription itself rather than the customer settings?
It does that in the guide / example but I'm trying to keep this as simple as possible. One payment method for a c ustomer... period.
And thank you @bold basalt for your help.
@sage acorn if you have multiple Subscriptions that use different PaymentMethods attached to the same Customer, then you'd use default_payment_method
@sage acorn but yeah for the simple case, just use invoice_settings.default_payment_method
[โ Question] Does Fraud Prevention rules have access to "metadata", we have some additional data fields we would like to send while creating charge as these fields are custom can these be sent using
[โ Question] Does Fraud Prevention rules have access to "metadata": https://stripe.com/docs/api/charges/create#create_charge-metadata , we have some additional data fields we would like to send while creating charge as these fields are custom can these be sent using "metaData" field with Charge object while creating charge: https://stripe.com/docs/api/charges/create, so we can use these fields and create custom Fraud rules. I was not able to find anything to see if this is possible wondering if any one had done something like this before to create fraud rules using "metadata"
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yup, you can definitely use Radar with metadata specified on the payment - I'd suggest reading through this (https://stripe.com/docs/radar/rules/reference#metadata-attributes) to get started
Learn more about the structure of rules and the order in which Radar processes them.
nice this is good
Hello!
Can you please let us know if we can code payment routing logic to distribute payments from one Stripe account that initially collects payments to connected accounts? We have different reseller accounts and need to allocate payments based on shipping address and product type. Thanks!
Hello! That's something you can definitely do with Separate charges and transfers - https://stripe.com/docs/connect/charges-transfers
With Connect, you can make charges on your platform account on behalf of connected accounts, perform transfers separately, and retain funds in the process.
Are there any negatives to responding to a Stripe webhook with a "BadRequest" ?
The webhook for a charge success fired before the payment had been recorded in my database... The webhook was perfectly fine, I just couldn't match it to the payment that triggered it at that second
Usually we recommend that you go ahead and respond with a 200 anyways to signal to us that you successfully received the event. I believe we'll attempt to retry sending the event if you respond with something that isn't a 2xx
Great, thank you! Can we do all that with Shopify account? Will we be able to use shipping address or other custom parameters we're getting from Shopify checkout to build the routing logic?
Yeah, I'm going to whip up a service I can fire to my job queue to try to process it later if it isn't there right away
it was a microsecond gap, the webhook fired and then the row was there
I just retriggered the event from the dashboard but I don't want to babysit it, and I don't need anything from Stripe after I verify the data in the webhook anyways
Hi! Is there a way to delete all PaymentMethods on a Customer? I only see detaching one-by-one or deleting the Customer...
I assume yes, but I don't know the specifics of Shopify's integration. I'd just start by checking your own account's Payment Intents/Charges for the information present there and also reach out to Shopify to verify how you can get this information
Hi there! Yup, those are the only two options that I can think of (detaching one by one or just deleting the customer)
got it, thank you!
Does Stripe report your revenue to the government?
I am a web developer, a customer asked me that what information does stripe gives to the government of Canada? If they submit a report of income on your behalf, do they include where the money was generated from, for example, which website the transaction came from? Do they give a breakdown point of each transaction they process or the total amount of revenue that you generated within a given duration of time? Does anyone know their contact info, phone number within Canada, I couldn't find it on their website?
Is it possible to send a payment amount from the website or do the prices have to be preset? i.e. use a value in an input field to send the payment amount.
Hi, I want to create a card in the back end. where do i get the source string from? i thought it was an object with required parameters like exp_month card number..etc
That would be a better question for support https://support.stripe.com/contact
The specifics depend on how you're integrated, but you can definitely pass payment amounts from your website (frontend) back to your server to use in payment
integration? Are there specific requirements for implementation?
Here's an example of how you would create a source in the backend w/ card data:
curl https://api.stripe.com/v1/sources \
-u sk_test_XXXXX: \
-d type=card \
-d currency=usd \
-d owner[email]="jenny.rosen@example.com" \
-d card[number]=4242424242424242 \
-d card[exp_month]=12 \
-d card[exp_year]=2022 \
-d card[cvc]=123
If you're handling raw card data on your server you should make sure you are PCI compliant
Sorry, grammar mistake! Should say "How you're integrated", but the basic gist of what I said still applies. You'd just pass this informatino from your frontend to your backend
so looking for what I would consider relatively simple setup. Generating payment options for website running on a php server. Allow page to accept payment amount from customer. From that value calculate a final amount (adding fees, etc). Then processing the payment.
Can u please send me the link to this example? i need the node version. Thank you.
@atomic locust yes, what you can do is follow our step by step guide here https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Securely accept payments online.
The only change you will need to do is to add a form for your user to input the amount they want to pay and you would update pay the payment_intent https://stripe.com/docs/api/payment_intents/update#update_payment_intent-amount with your final value
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you want to charge the customer including the fees etc.
Do I need to be concerned with PCI compliancy?
@atomic locust as long as you are using Stripe Element, you are exempted from PCI check see here https://stripe.com/docs/security/guide#validating-pci-compliance
const newCardSource = await stripe.sources.create({
type: 'card',
card: {
number: '4242424242424242',
exp_month: 7,
exp_year: 2022,
cvc: '314',
},
});
I heard to accept a payment the products/amounts had to be preset in our Strip account and the site had to pull from that as offerings for the website? Is that true?
you don't have to as I mentioned, you can do that if you follow this guide. https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Securely accept payments online.
Stripe API has the flexibility to support different user cases
Having product/price catalog could help you to create subscriptions or charge user fix amount and help you with reporting etc.
for a php server will any dependencies be required on the server? e.g. can this run in a shared hosting environment?
@atomic locust no requirements on your hosting environment as long as your hosting environment is secure and could access Stripe API
secure? meaning ssl certificate for the site?
yup, also you will have to store your secret key, db credential somewhere. you will need secure them.
what is SOP to secure those?
what do you mean by SOP?
sorry, standard operating procedure. ๐
I don't know. I mean security is not entirely about integrating with Stripe, Your site needs to be secure in general from different attacking surfaces. Securing your Stripe key is definitely one of it. You can take a look our doc here https://stripe.com/docs/keys#safe-keys
Manage your API keys to authenticate requests with Stripe.
Thank you
Error: Stripe webhook failed with TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView, KeyObject, or CryptoKey. Received undefined
Code:
exports.handler = async ({ body, headers }) => {
try {
// check the webhook to make sure itโs valid
const stripeEvent = stripe.webhooks.constructEvent(
body,
headers['stripe-signature'],
process.env.GATSBY_STRIPE_WEBHOOK_SECRET
);
// only do stuff if this is a successful Stripe Checkout purchase
if (stripeEvent.type === 'checkout.session.completed') {
const eventObject = stripeEvent.data.object;
console.log(eventObject)
}
return {
statusCode: 200,
body: JSON.stringify({ received: true }),
};
} catch (err) {
console.log(`Stripe webhook failed with ${err}`);
return {
statusCode: 400,
body: `Webhook Error: ${err.message}`,
};
}
};
This code was running fine before but now it's giving me this error in my webhook
Hello are we out of working hours now?
I found the solution, i needed to install stripe in my functions folder
@pale belfry do you have any questions?
@lucid raft Oh hello, well, I have this code for Creating a Bank Account token, but when I run it, I don't even get a console log of anything below stripe.tokens.create ```
const SellerForm = (props) => {
const dispatch = useDispatch();
const history = useHistory();
const { currentUser, userErr } = useSelector(mapState);
const [businesstype, setbusinesstype] = useState("");
const [businessname, setbusinessname] = useState("");
const [accountnumber, setaccountnumber] = useState("");
const [routingnumber, setroutingnumber] = useState("");
const [errors, setErrors] = useState([]);
const CreateAccount = (bankToken) => {
const accountform = React.useRef("account-form")
const formdata = new FormData(accountform)
formdata.set('external_account', bankToken)
console.log('it worked')
fetch('/create-account', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(Object.fromEntries(formdata))
}).then(function(r) {
return r.json();
}).then(function(response) {
JSON.stringify(response, null, 2)
});
}
const handleStripeConnectBtn = (event) => {
event.preventDefault();
console.log("hello1");
stripe.tokens.create ({
bank_account: {
country: 'US',
currency: 'USD',
accountnumber,
routingnumber,
// account_holder_type: businesstype,
account_holder_name: businessname,
}
})
.then(function(response) {
// debug("created bank account" + response.token.id)
console.log("hello2");
CreateAccount(response.token.id); // btok_xxxx
})
};
I'm using react, the problem is that the 'const handleStripeConnectBtn' function stops running after console.log("hello1")
@pale belfry do you see any console errors in the browser dev tool? And if you add .catch() after .then, will you catch any errors?
@lucid raft I tried adding .catch(error) to the end but I don't think I know how to do this in JS
Working on it now
@pale belfry You can simply do this after
.then(function(response) {
// debug("created bank account" + response.token.id)
console.log("hello2");
CreateAccount(response.token.id); // btok_xxxx
}).catch((error) => {console.log(error})
You can go to your browser dev tool e.g. in Chrome by Option + โ + J (on macOS), or Shift + CTRL + J (on Windows/Linux)
to see if there any errors thrown
Can anyone help me I have some doubts regarding the stripe address? Does stripe validate the billing address? Like I am in Canada and adding input as USA but card is of Canada does that validates ?
When I try to fetch from the stripe API, I get a 401 error. Is there something wrong with my endpoint?
@vocal wagon if you are using node in your server side, I would recommend you to use our stripe-node library https://github.com/stripe/stripe-node
You can using axios though, but you will need to follow the syntax of axios, let me check
Hi All, I hope that somebody might be able to help with this error message: Failed to execute โpostMessageโ on โDOMWindowโ: The target origin provided (โhttps://js.stripe.comโ) does not match the recipient windowโs origin (โhttps://www.holmanindustries.com.auโ).
I am experiencing the issue that the form fields cannot be filled in by the customer when we send out the customer payment page. The normal checkout has no issues.
@lucid raftHow would I fetch using the stripe api? I am using a webhook for when checkout is completed. I then want to use that id session to get the lineitems for the session using fetch (in this case axios)
The rest of my code is using the stripe library
Help - Read Payment Form Field
I am just not sure how to fetch and if I could with stripe
Hello - I am building custom stripe payment form and below is my code. Could you please help read the CVC, Expiry, Card Number entered by the user?
@vocal wagon you can fetch the session using
const session = await stripe.checkout.sessions.retrieve(
'cs_test_xxxxx'
);
Change Event - Value is empty
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ill give it a look, thank you
@lucid raft Thanks for that, the function seems to stop completely after console.log("hello1"), meaning that stripe.tokens.create is not running at all
@swift hearth that is expected. Due to PCI requirements, you will only get the value for non-sensitive data like postcode code. CVC is considered sensitive data which is not retrievable on the frontend
https://stripe.com/docs/js/element/events/on_change?type=cardElement#element_on_change-handler-value
Complete reference documentation for the Stripe JavaScript SDK.
I cannot access the site you shared, can you share more of your code and where the error was thrown?
@vocal wagon I have deleted your message because it contains a secret key even though it is a test key. Please don't share the key with anyone.
@lucid raftOh sorry, i must have missed that. Thank you again!
@pale belfry I will need your help to provide more information unfortunately. In your console tab and network tab in Chrome. Do you see any errors?
https://www.holmanindustries.com.au/checkout/order-pay/33315/?pay_for_order=true&key=wc_order_36knGVMC2ym2e this is the payment page for the customer to enter their payment details.
@lucid raft - Thank you for helping. I will look further into how to create a payment method on stripe, But this is helpful.
the page loads ok but then the fields do not load. <div id="stripe-cvc-element" class="wc-stripe-elements-field">
<!-- a Stripe Element will be inserted here. -->
</div>
@valid grotto there are a lot of errors on your page and it seems that you are using some third party plugin? https://iconicwp.com/products/flux-checkout-for-woocommerce/ ?
Do they provide the Stripe checkout for you or you are integrating with Stripe directly?
I have tried and disabled the plugin before. Does not change the outcome. I just deactivated it now for you to check. It also seems a very recent issue.
I mean how do you integrate with Stripe? Are you using Stripe Elements and implement it yourself? Can you provide the the source code that I can check?
It's integrated directly through woocommerce. so the woocommerce stripe gateway plugin
I see a "recent error" on my Developers dashboard, but when I click on it, no info loads. I tried clearing the filters and still don't see it
Do you get any information like a request ID? If not on the page then the URL might have it
hmm and when you click on it nothing happens? Do you get an error?
No, the Logs tab loads with 4 filters set (Date/Status/This Account/Outgoing Connect requests) with "No Results"
clearing all filters on the failed tab doesn't show it
What's your account ID? I can have a look from our end
is that the acct_ value? I can post that without too much issue then?
You can't do anything with an account ID without the corresponding secret API key ๐
Unless you work at Stripe, which I do
ah okay ๐
acct_1HElt4KBxM5FymZf
would have been at 4:07 PM PST
(or is it PDT??? I never know)
In test mode, right?
no, this is live
Yeah this is odd
I'm seeing the same thing, I'm just looking into whether this is a dashboard bug
I do see that we had a terminal used for a purchase around then
just wondering if it's a me issue, or if it was something the staff did
I have no idea why this isn't showing up on Dashboard and I'm going to file a bug report for this, but you did have an error on 2021-07-20 23:07:32 UTC with the following error message:
{
error: {
message: "The Stripe Terminal ConnectionToken has expired. Please generate a new one using v1/terminal/connection_tokens.",
type: "invalid_request_error"
}
}
As far as errors go no biggie, you probably already fixed it by getting a new ConnectionToken and activating the device before it expired
If I had to guess, staff had our "store purchase" page up for a loooooong time and then tried to run a transaction
thanks!
yeah I don't think there's anything wrong with your integration, just a user error ๐
What's the proper way to request line items?
const session = await stripe.checkout.sessions.retrieve(eventObject.id, line_items=true); ?
You'd want to expand that property: https://stripe.com/docs/api/expanding_objects
In depth guide here: https://stripe.com/docs/expand
tl;dr you'd want:
const session = await stripe.checkout.sessions.retrieve(eventObject.id, { expand: ['line_items'] });
Hello, for the invoice receipt email we send the customer, is it possible to have a custom invoice number?
stripe dev help is probably the best support discord i've encountered
I would have assumed that this would be the issue.
Yes, to a certain extent. Have a look here: https://stripe.com/docs/invoicing/customize#invoice-numbering-schemes
Customize the content and branding of your invoices.
@lucid raft When you first load the page all the fields are there as well showing the correct placeholders. the fields disappear shortly after page load though.
I'd investigate that then, sounds like you have a bug somewhere where your UI fields are disappearing before they should
Hey all, I have an API that handles two Stripe events: ['checkout.session.completed', 'invoice.paid'].
For context, although you may already know, Stripe sends webhook requests in random order (or at least they are received in random order) which creates complexity for consumers (e.g. me).
What's the best way to manage race conditions?
Here are two ways that I've thought of myself, which have proven to be insufficient solutions:
- Send Stripe a 500 Internal Server Error to force a webhook request retry (which takes an hour for the second request to take place).
- Create application logic that deals with this complexity. In my case, I create "Customer" and "Payment" records in my own database (I'm using Prisma ORM). Because "Payment" records require a "CustomerId" on create, I'm required to create the "Customer" record in a place where I don't have all of the required information. Long story short, because Prisma ORM doesn't support table locking out of the box, I'm SOL for this approach.
Does Stripe offer a public bug tracker?
thanks Paul. this only appears when we send the customer payment page. There is no issue in the normal checkout procedure for new customers. I hope this helps?
It doesn't really, I can't really do much here but tell you to add more logging/debugging into your code to try and figure out what the problem is
Nope, but if you think you've found a bug you can describe it here or preferably in the #842671282917998633 channel
It's already reported; just was curious if it was fixed.
I can check internally if you give me some details on the bug
Sure yeah; it's a Tax Bug where it replicates price points with the same exclusive and inclusive settings respectively. (inside invoivces)
Definitely don't recommend sending 500s ever, as that can cause your webhook endpoint to be disabled if it happens too often. We recommend implementing a queue system where if the event is out of order (which should be rare) you "queue" the event to revisit once the expected event has been received: https://stripe.com/docs/webhooks/best-practices#event-ordering
Implement these best practices when using webhooks.
Understood. What are some of the best practices you've seen with the "queue" approach? Does the aforementioned approach eliminate the need for database table locking? Lastly, does this approach eliminate the benefit of webhook retries if something goes wrong with a 5xx error (since you'd be sending off the initial request to a background process and sending a 200 back to Stripe immeditately)?
The queue approach is similar to what you mentioned (returning a 500 to Stripe so Stripe retries the event later) except it's all internal to your systems rather than relying on Stripe. You essentially push the event to the back of your queue to be processed later, preferably after the missing event has landed and been processed.
In general you should avoid returning a 500 at all, as anything but a 200 response instructs Stripe to try again later. Too many non-200s will cause Stripe to automatically disable your webhook endpoint. Even if you send the event to a background progress you still received the event and should acknowledge that as such to Stripe.
Another option is if you get an out of order event is to retrieve the object in question directly, which is guaranteed to be up-to-date and reflect that object's most recent state.
Do you remember who helped you with this last time?
Alex was on the call; give me one second to find the person that confirmed the bug. (They stated they knew about the bug before I contacted them)
(inside support itself)
Jessica confirmed it
Can you give me your account ID? I should be able to find it then
Sure; one second.
Thanks! Back in a sec
Of course;
To find out the status of that bug you're best off replying to your support thread directly
That helps. If I used something like Bull (https://optimalbits.github.io/bull/), how would I ensure the order was correct in the queue? Or if Stripe has any other example repositories to look into, I'd greatly appreciate it.
Will do; thanks.
How do people generally get the Strip service fees back at the time of charge? It looks like the only option is either by immediately calling a balance_transaction request or via webhook. Webhook I'm guessing is the only real option but am I missing something? No way to get that back with a charge return? What is considered best practice for this?
@sacred crest the queue itself will guarantee the order however Stripe event notification does not.
https://stripe.com/docs/webhooks/best-practices#event-ordering
So your event processing logic should not expect the ordering of the event.
Implement these best practices when using webhooks.
@copper panther It depends on your integration path, for general blended fee structure where you are paying x% + y cents, you can calculate the fee amount and added to the amount you charge your end customer
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
last question of the night for me, creating a payment intent with confirm=true,offsession=true,paymentmethod=pmWhatever is functionally the same thing as creating the payment intent WITHOUT those values, and then confirming with them?
@lucid raft so essentially, since my event processing logic will not expect the order of events, one thing I may need to do is an "upsert" query for "Customer" since data from both events are required for the full hydration of the model. Does that sound right?
Yes, it will be the same as long as you are eventually passing the same parameters. It is just that now you will need to make multiple API calls which might be slower than making a single call.
Thanks but the scenario is for connected accounts. The fee is x-y% + z cents. The issue we are running into is that in order to update our sales reporting accurately to reflect what is paid out to the connected account, we need to know the actual Stripe processing fee and it can vary. We need that info returned back to store in our DB else we run the risk of bad info (guess that is not updated). Make sense? Seems like it would be best to have that returned with the charge object but it is not. Am I not seeing something? Thanks
Sounds right to me. You would need to get the current status of the entity before inserting blindly into your DB
Stripe was too fast for me! the record didn't exist in my database when I got the webhook stating it was successful! It was put in a milisecond after that, but still, easier to have it be there before I try to confirm the payment to prevent issues.
@copper panther I think it varies depends on the payment method types? e.g. for credit card, the fee might be x%+z, while for bank transfers you will have y%+z.
So if you want to calculate the fees, you might need to get the payment_method information first and determine the fee structure. then based on the fee structure, you will calculate the final amount that your customer needs to pay
The fee will be available in the charge.balance_transaction object https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-fee_details
Which event you are listening, regardless how you call the API, the charge success event will only be sent to you after your call confirm=true with the payment_method
charge.succeeded
but I was originally creating the payment intent with confirm/the method/off session, but now I'll create the payment intent first, grab the Id and then confirm off session if needed
@echo pollen what information are you storing in your DB? Payment_Intent ID ?
1My apologies. I'm not understanding the logic. Let's say our client has connected to our platform with a Standard account. We are just calculating a platform fee based on our agrement and charging that. We then need to know how much the Stripe fees are so that we can add that to our database so they have an accurate itemized sales report - Total Sale | Platform fee | Stripe Fees | The client's net. We are aware of the balance_transaction but that is a separate call after the charge info has been returned. This leaves us with having to either insert incomplete or "best guestimate" Stripe fee and client net amounts and make another call to balance_ transaction (two calls for each charg?) or rely on a webhook which adds a possible point of failure to update if something goes wrong. FYI - the balance_transaction call directly after the charge throws an error evidently due to some latency in the system. None if this seems ideal by any stretch. This is why I think we may be missing something. Is there a way to get the charge confirmation and Stripe fees back in the same call. If not, what is best practice?
I have information about what invoices are being paid for, and by whom (since our setup allows for the invoiced person to pay, or their boss if they are feeling nice), at what time, ect. But yes, I store the payment intent id and the stripe customer ID if the payment is going to stripe to be processed (aka all payments but Paper Checks)
so the webhook fired, but my logic couldn't find the record to process and record as paid/setup payment history/fire off a payment webhook to our invoicing software, because stripe was too fast and I hadn't inserted my record yet :p
I see, sorry, I misunderstood your ask, I thought you want to pass down the stripe fee to your end customer.
What you are asking is breaking down the fees in a charge.
I misunderstood that your client is your connected account , not the end customer
I was originally going to store the webhook in my job queue table to process later, but creating the intent and getting that Id first seems the better solution for me at this moment
@copper panther n1. The fee information WILL be available in the balance_transactions.
Depends on your integration path, are you using Direct charge? destination charge? These will all impact the Total Sale The client's net. not the stripe fees or platform fees.
What you can do to get balance transaction in a Single API call is to use expand feature when you create the charge. https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@copper panther but be aware that this single call will only work for synchronous payment like Credit card and you are not using auth and capture
rely on a webhook which adds a possible point of failure to update if something goes wrong.
Stripe integration heavily relies on webhooks and it is very common integration path.
You should not shy away from using webhook as Stripe will try our best to ensure the webhook are delivered with retries https://stripe.com/docs/webhooks/best-practices#events-and-retries
Can you simply insert it when you can not find the payment_intent id? So the logic is if not found, insert a PI with success status. If exists, update the status.
Thank you. RE: balance_transactions - yes, understood. It is the having to make a separate call at a later time that was bugging us. Good information with the expanding responses. I was not aware of that. Do you know if the Stripe fee is even available at the time of charge? If so, this will work. We are using single call synchronous CC payments as of now as well. Either way, we will weigh the benefits/uture limitations of that vs. webhooks.
yeah a few different ways to make it work, I'm brainstorming for tomorrow morning now
I just can't babysit my internal DB logs watching for the error I throw when stripe sends me a webhook for a payment intent I don't "know" about yet
Do you know if the Stripe fee is even available at the time of charge? If so, this will work.
It is immediately available for synchronous payment like Credit card and you are not using auth and capture \
@copper panther ^
I'm glad I caught it today, vs having to try to hunt it down a month from now when the accountant does some reconciliation work
Perfect. Thank you!
@copper panther and it is available for blended fees like x% + zcents; some merchants are using IC+, the fee will not be immediately available
Another thing you can try is use the metadata when create payment_intent. The metadata contains some of your internal reference ids. In this case, you get the event with the internal reference ID, you will know if you make that request or not. https://stripe.com/docs/api/metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah, thinking of what works best for me
How can I know that the trial has ended? I couldn't find a proper webhook event
@hollow nebula Three days before the trial period is up, a customer.subscription.trial_will_end event is sent to your webhook endpoint. You can read more about trials in detail here : https://stripe.com/docs/billing/subscriptions/trials
@golden cosmos Thank you for the quick response. I like to get an event just when the trial ends. 3 days before is good, but in my case I like to get notified of the exact time trial ends. I have set cancel_at_period_end for the trial subscription. So, will I get notified using customer.subscription.deleted webhook?
onesec, let me verify what happens and i'll get back to you as soon as possible!
For SCA to work in an iframe, I need the right server side response, if I'm using elements?
My code is erroring out with the "authentication required" when using a test card requiring SCA
(Also I finally got the publishable test key)
@hollow nebula yep! looks like you'll get a customer.subscription.deleted if you set cancel_at_period_end
Great, thanks for the help
hello @green notch! are you following the documentation here : https://stripe.com/docs/payments/3d-secure#custom-iframe when attempting to display an iframe for your customers to authenticate? would you happen to have a sample of your code which we're able to use to replicate the issue you're seeing?
Currently the frontend is not designed to handle SCA
i see, anything which we can help you with here? or is the guide sufficient for now?
I'm confused about the docs. Is there a way to get the SCA website to be shown from the frontend, or should the backend send the site?
hello,
I am getting below issue when try to call stripe checkout API in c#
That doesn't look like an error with Stripe API
If you provide a request Id we can check how it went
I have call API from react
The stripe.js should handle the flow including displaying SCA website
@green notch if you use confirmCardPayment and handleCardAction in your frontend, Stripe will automatically display the authentication UI in a pop-up modal. This link might help make things clearer on how to implement to handle 3DS : https://stripe.com/docs/payments/accept-a-payment-synchronously#web-handle-next-actions
this method requires the Client Secret, right?
@green notch yep that's right!
Our current setup is such that we just send our server a request and then that handles the rest
So I guess the backend needs working too
Can I see the full code of your ChargePaymentNew?