#dev-help
1 messages · Page 124 of 1
sorry one last thing: I do have examples of this flow working, e.g. seti_1JDYZmE5lzrKASelCzIfNDK7 today uses the same strategy
👋 Me again 😅 Is there a "simpler" way to refund an application fee other than calculating the amount by checking the amount refunded for the related charge (as a percentage)? Doesn't ApplicationFee#create_refund automatically detect that the charge involved was partially refunded? Thanks 🙏
Okay let's back up for a quick second - I didn't realize you were doing the manual confirmation flow for 3ds (which is totally fine). To answer your original question, nothing is wrong with your flow it just so happens that authentication failed (which can happen for any number of reasons like the cardholder rejected, the issuer rejected, etc). I believe if you look at the SetupAttempt associated with the SetupIntent you can find more information on what specifically went wrong there (probably under payment_method_details.card.three_d_secure https://stripe.com/docs/api/setup_attempts/object#setup_attempt_object-payment_method_details-card-three_d_secure)
Hello! I don't know off the top of my head - give me a few minutes to check
When creating an application fee, setting amount is optional - if you leave it out the entire application fee for the provided ID (fee_xxx) will be refunded. You can get this fee ID from the charge object (https://stripe.com/docs/api/charges/object#charge_object-application_fee). I also want to mention, if you want to refund the application fees as part of refunding a whole direct or destination charge you can set refund_application_fee: true when creating your refund (https://stripe.com/docs/api/refunds/create#create_refund-refund_application_fee) to automatically refund the application fee while refunding the charge
Thanks a lot @dim hearth , does that also apply for partial refunds?
If you're doing a partial refund, then only a proportional amount of the application fee will be refunded. If you want to do a partial refund and also refund the entire application fee you would have to do it separately
@dim hearth Awesome, thanks again 👍
@dim hearth Is that feature available in the Stripe dashboard or only through the API? (the refund_application_fee: true feature)
hi I'm currently working on pulling MRR from the stripe API but my numbers are significantly different than what the billing analytics DB tells me and I'm stumped as to why. All I'm doing is pulling subscriptions, applying discounts who's duration is forever, monthly-normalizing them and summing. I've tried to follow Stripe support's guide and some guides I've found online, but I'm getting numbers that are ~8k off
Just checked - it looks like there's a checkbox in the refund modal that pops up that says "Refund the application fee"
Hmmm.... MRR can get very complicated and it's not something we handle here often, but let me see what I can find. Do you have a subscription ID I can take a look at just so I can look at some of the subscriptions you have on your account?
Thanks -- so "result_reason" is "rejected" but "authentication_flow" is null. Is the null authentication_flow meaningful to you? The customer insists they are doing everything correctly so I'm trying to go back either with a bug or information about why auth failed.
Are you seeing anything in result? Also, has the customer contacted thei issuer?
result is failed. I don't think they've contacted their bank yet because Stripe support told them "that the payment was never reaches Stripe. Which means the payment issue occurs while attempting to process it through your third party plugin." 😬
yeah I do: sub_HqyCqcI4aMtEx6, so I don't actually need a truly correct MRR, I just would like to get the same number that the stripe dashboard is pulling
Hmmm - well they're kind of right in that payment never goes through (because this is just a setup intent, and no actual payment is being made), but I definitely can confirm that the Setup Intent is reaching us and authentication is being attempted. I was hoping this information would be something reflected in the SetupAttempt, but from what I can see on my end, the issuer sent back an error message to us that means "Transaction not permitted to cardholder". They should contact the issuer to find out why this is happening for their card to get it fixed.
Great! That error message is very helpful, and is enough for my next step. Thanks for your help @dim hearth!
When you're pulling subscriptions you're just pulling all your currently active/past_due subscriptions right?
Hello can anyone help me with this
What is your question?
@dim hearth yeah, so im pulling active/past due subscriptions -> filtering out metered billing -> grabbing the "amount" field of the "plan" of the subscription -> applying discounts -> accounting for "plan_interval" by dividing those yearly subscription amounts by 12
I did find that there are a small amount of subscriptions whose plan field is null like sub_Jg7QdT8I8W7c8z
but on the actual stripe website, they are subscribed to a plan
also, stripe dashboard gives me ~24k, internal calculation gives me more in the ~15k range
Ideally, what would be really helpful is how the calculation is done for the billing analytics dashboard and then I can see if I'm even pulling from the right endpoints
Do you have any subscriptions that have a quantity >1 for any of their plans?
oh yeah I also multiply by quantity
Hmm... so nothing is jumping out to me as wrong about your calculation (but I also know very little about how MRR is calculated) - I'd suggest two things:
- If you look at Price/Product on the dashboard, you can also see the MRR that specifically applies to that Price/Product. You don't have an unreasonable amount of products, so I'd suggest taking a quick look at all of them and see which specific numbers aren't matching up with how you're making calculations. It's not perfect, but it'll hopefully narrow down the scope of the problem
- Contact support https://support.stripe.com/contact. They may have better methods/suggestions for digging into the difference in MRR you're seeing
@dim hearth ok thanks I sent a ticket, I suspect it might have something to do with those subscriptions whose plan field is null, as I checked one of them and it was a fairly large total
hello
Hey, does anyone know if Stripe's new React Native SDK can facilitate integration with their BBPOS card swiper directly through JS? or is calling their native iOS/Android SDKs the only way to use that swiper?
The RN SDK is a wrapper and such for Stripe.js, whereas Terminal has its own SDK which does not have a RN version.
I'm not familiar enough with using straight JS inside of RN, but you might be able to use the Terminal JS SDK in some capacity.
Ah, feared that might be the case. It's a shame that the BBPOS Chipper's only options are native, but the Verifone P400 has a JS SDK. The BBPOS is smaller, cheaper and perfect for what we need 😦
Thanks for the response.
"months without interest" isn't anything that you'd do in Stripe -- sounds like you want Shopify's support instead, but if you can elaborate on what you're trying to do on the Stripe side, we can verify if it's something we can help with
I would like to integrate stripe with shopify and months without interest in stripe
Sorry, but that still doesn't sound like anything on the Stripe side. You likely want Shopify's support who can help with setting up payment plans on the Shopify side (Stripe is used to process the payments, but we don't control Shopify's integration with us).
how can activate months without interest in stripe?
Please don't keep asking the same question. See my previous response.
You want to ask Shopify's support team, and they are not on this Discord.
Someone helped me, I encountered a technical problem
What specifically are you looking at?
I’m in another country and I don’t have an account. It seems that it takes 400 USD to complete Bank of America, right? Can we talk privately?
Are you sure this is something to do with Stripe?
If it is, it's certainly not technical, and you'd want the support team via https://support.stripe.com/contact/email
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.
Yes, because I cannot complete the transaction, you can help me apply for a bank account, right?
Get your questions answered and find international support for Stripe.
We cannot help with that in this Discord, no. You want the support team as mentioned above.
We cannot help with that in this Discord, no. You want the support team as mentioned above.
Hoping I can get some help or direction. We integrated Stripe into our platform and generate ACH Credit Transfer Account for each Customer automatically. The one issue we run into is when the customer goes to their Stripe portal to add a payment method the Payment Method block is missing. If I manually add a different payment method and the ACH Credit Transfer is no longer Default the Payment Method Block reappears. If i reset the ACH Credit Transfer as default the Payment method block disappears again. Is this by design or a bug? Seems they should be able to Add a credit card to their account regardless of current default
To clarify my understanding: is all of this a bug you're seeing in the UI on the Customer Portal, or are you running into any issues on the API calls as well?
Hello everyone. In this documentation for failed refunds (https://stripe.com/docs/refunds#failed-refunds) it states that it can take up to 30 days for the funds to be returned to the stripe account, and a webhook event is emitted that contains ths the failure_reason and failure_balance_transaction.
- Is the 30 days for a failed refund amount to return a consistent amount of time? Or does it depend on whether it's ACH vs Card?
- Is this event only received when the funds are finally returned to the Stripe Account balance? Or are we notified earlier that a refund failed?
Just in the UI for the customer Portal
As it's written in that doc, it's up to 30 days (not consistently 30 days). The event will fire when the refund actually fails, unrelated to movement of funds.
OK. You'd want to contact the support team for that via https://support.stripe.com/contact as they can work directly with the UI team to determine if it's a bug or account specific.
Awsome! I noticed there's not average response time for the failure webhook. Any idea how soon we'd receive the failure event on average?
No idea, it could be anywhere up to and including 30 days for any given refund.
One of the inputs to any such average would be the issuing bank you're dealing with, and all their systems are unique.
Fair enough, but we would most likely know the refund failed in advance of the funds being deposited back into our stripe account?
The funds would never be returned before the event fires, but really how often they would be "quickly returned" isn't something I have data on personally.
Super fair! Thanks for the info. 🙂
hi! I was wondering if the API provides withdraw limits (ie. payouts) for connected accounts anywhere
I believe I have heard somewhere that if the payment method attached to the connected account is a debit card, there's a $3000 withdrawal limit? but I can't find that in the balance or payout documentation
Are you looking to retrieve the maximum amount that an external account allows, or are you asking how to manually make payouts no greater than a certain amount per a given period?
the maximum amount that an account will allow
There's nothing like that in the API, no.
Any limits would be on the bank's side and we wouldn't have stored information on any of that
okay so Stripe doesn't limit how much a connect account can cash out per transaction, ever?
support hasn’t been able to help me out with payouts in test mode. is anyone able to help me out here?
I couldn't answer that, but the support team would know if we ever do via 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.
What are you trying to test, specifically?
i’m wondering why the expected dates keep getting pushed back and why i haven’t seen one go through yet
it’s been 2 weeks
In test mode? Do you have an example id of such a payout?
yes test mode. the payouts don’t even get created
but on the dashboard it says i should have some expected
@mossy cape testmode doesn't send payouts edit: i'm wrong
@mossy cape can you share the account ID for the account in question?
@mossy cape it might be the delays or it might be not having an external bank account attached. could be a few things, can check with the acct ID
okay cool so i’m trying to test payouts to a connected account
would you want the connected account i’d or platform
id*
@mossy cape the Connect acct ID.
acct_1J7uky2HK7sHtjOE
@mossy cape which account does it work for? can you share that acct ID? I think I might know what it is
this is a connected account on a different test platform account acct_1IVlXqQozDBmmJQi
same country etc but payments were made via cc not direct debit
@mossy cape one sec
We are creating fixed-price-subscription in Stripe. The question is, for the test environment, is there a way to shorten the subscription period? That way we don't have to wait a month to see the renewal webhook calls?
Ideally, we would like to just wait minutes.
For anyone in the future here is what Stripe said: "Portal only supports card payments. Once you set the default back to the card on the dashboard for the customer it should then show a way to update on the portal. It is due to the unsupported payment method being set as default. In other words when that ACH is set to default it won't allow portal to work correctly. it will only work if default is set to a card since that is all portal supports."
@bold basalt no worries
What specifically are you trying to check? You have a couple options here depending on what it is you want to test
- Update the subscription's
billing_cycle_anchorto now to trigger a new billing cycle - Test with prices that renew every day (instead of every month)
I'm also going to start taking a look -just want to check, acct_1J7uky2HK7sHtjOE is the one where payouts aren't working and acct_1IVlXqQozDBmmJQi is the one where you are seeing them work fine?
correct thanks @dim hearth
It looks like the external bank account listed for acct_1J7uky2HK7sHtjOE an invalid routing number - for the account acct_1IVlXqQozDBmmJQi you used the 11000000 so maybe try that?
@mossy cape Yeah finally found the doc I was looking for https://stripe.com/docs/connect/testing#account-numbers - you definitely want 11000000 for the routing number. The current routing number you used for acct_1J7uky2HK7sHtjOE was 00011000
awesome thanks
hey, is it possible to use customer credit balance in stripe connect destination charge?
or does the source need to be a card?
Customer credit balance is just used with Stripe Billing - not with plain old destination charges
Hello! Can a Connect platform account transfer funds to a connected express account from the stripe dashboard? Or is it required to use the API to initiate a transfer? I see the reference in the API docs for that, but no mention of how to do it through the dashboard.
@dim hearth thanks, is there some concept of credit that we could use in a destination charge?
our clients has credit - can we include it somehow in a destination charge?
@vocal wagon there's a Send funds button on the connected account Dashboard
Okay thanks
Can you clarify what you're trying to do a bit more? You can use invoices with destination charges and that should still use the customer's credit balance (https://stripe.com/docs/invoicing/connect#destination)
clients can have credit on a platform
we would like to do a direct/destination charge where part of the charge is taken from a card and the rest is taken from a client's credit
that is just not supported today
the way you do this is that you look at their balance, decrease the PI amount by that much and then clear the balance
Hello!
Wich one is the endpoint to get all payments done by a customer??
When you say "client" do you mean a customer? If so, you can retrieve all the charges for a customer by passing in the customer ID (https://stripe.com/docs/api/charges/list#list_charges-customer)
Yes! Thank you!
You can also do the same thing with Payment Intents (https://stripe.com/docs/api/payment_intents/list#list_payment_intents-customer) if that's what you prefer 👍
This one is what i need, to show to user his transactions.
Hello, I am building a platform with many sellers, which itself is located in the USA but has many sellers in Europe using Stripe Connect. Sellers can offer subscriptions, of which our platform takes a percentage cut. To do this, from my understanding I cannot simply use destination charges when the connected accounts are in Europe. So, I've set up products, prices, and cloned payment methods to all be on the connected account. Processing payments now seem to work, but I'm no longer receiving webhooks as confirmation in order to process the subscriptions. Am I missing a step, and am I generally correct in my approach?
@bronze hedge you will need to setup webhooks explicitly for your connected account on your platform. There is a section for you to add endpoint there
Regarding cross border destination charges support on subscription; let me check
@bronze hedge actually you can still use destination charges subscription with connected account in Europe. The only thing you need to do is to add on_behalf_of of accounts not in US https://stripe.com/docs/connect/subscriptions#on-behalf-of
With Connect, you can create subscriptions for connected accounts, optionally taking fees in the process.
@lucid raft Hmm, it seems when I try to do that I get this error: "code":"parameter_unknown","doc_url":"https://stripe.com/docs/error-codes/parameter-unknown","status":400,"message":"Received unknown parameter: on_behalf_of","param":"on_behalf_of",...
do you have a request id ? req_xxx
req_lyhkf9lEzenJGc
Full error is : {"code":"parameter_unknown","doc_url":"https://stripe.com/docs/error-codes/parameter-unknown","status":400,"message":"Received unknown parameter: on_behalf_of","param":"on_behalf_of","request_id":"req_lyhkf9lEzenJGc","type":"invalid_request_error"}
ok, the feature is supported, but your account needs to be reviewed in order to use that.
Do you mind writing to our support and they can review and enable your account to use on_behalf_of
:question: 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
^ this link to contact support
I will do that! Thank you very much!
np
I am playing around with the node.js sample integration which processes a test transaction of $14 and I am trying to figure out how to change the test transaction amount from $14 to $10? Can anybody help?
@thorny vault what is your integration path? are you using checkout or stripe element with payment_intent or?
and you want to modify the amount based on your customer's shopping cart I guess?
@thorny vault just a reminder, don't post your secret key in anywhere even with Stripe and even for your testing account
I will delete that for now
I see, so you are using PaymentIntent
I copied this code from the Stripes documentation for a sample integration and I am trying to change the default transaction value from 1400 (eg. $14) to 1000 ($10)
If you see that code, the amount was calculated based on the items
I have changed it but the transaction value still stays the same
How did you change it? you will need to update the payment_intent https://stripe.com/docs/api/payment_intents/update#update_payment_intent-amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
After you create the payment_intent, you will need to update it with a new amount
Do you have any sample code for how to update the payment_intent with a new amount
?
yup, the link I gave has the sample, not with the amount parameter. but you can do something similar
const updatedPI = await stripe.paymentIntents.update(
existingPaymentIntent.id,
amount: 1000,
);
as simple as that. You will just put that in the right place where you want it updated
sure. 🙂
what is your questions @kind python ?
I just made the "Accept the payment" part https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements and I did all the steps and added some CSS but it won't let me press the Pay button after I put in all the information for the test card. Here is my code: https://replit.com/@KaviGupta1/Stripe-Checkout-Integration#index.html
Hi I signed into my nifty gateway account and it shows that my payout was sent to an unrecognized bank account. How can I speak with someone to resolve this?
:question: @old kite 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
@lucid raft are you still there?
@kind python yup, I am here. Trying to reproduce the issue. The problem is in your client.js card.on("change", function (event) {
The button was disabled there and there was some errors
So do I just remove: card.on("change", function (event) {
// Disable the Pay button if there are no card details in the Element
document.querySelector("button").disabled = event.empty;
document.querySelector("#card-error").textContent = event.error ? event.error.message : "";
});?
ok
I have integrated a Sepa payment in one of the project and In test api, the subscription and payments are "Succeeded" but in live mode they are in "Pending" status. Can I know what is the cause behind this?
the clientSecret is not defined in line 30
app.get('/secret', async (req, res) => {
const intent = // ... Fetch or create the PaymentIntent
res.json({client_secret: intent.client_secret});
});
@kind python in your app.js, you will need to call Stripe server side to get create the payment_intent
How would I do that?
@kind python I don't know how replit runs the node server, but what you need is
- in your app.js, create a payment_intent in your app.get('/secret') endpoint. You don't need your server.js
- In your checkout.html or client.js, fetch the secret
follow this https://github.com/stripe-samples/accept-a-payment/blob/main/custom-payment-flow/server/node/server.js
Ok I will take a look at that, and I should delete my server.js file correct?
https://github.com/stripe-samples/accept-a-payment/blob/main/custom-payment-flow/client/html/card.js
yup
Ok thank you very much.
I have integrated a Sepa payment in one of the project and In test api, the subscription and payments are "Succeeded" but in live mode they are in "Pending" status. Can I know what is the cause behind this? Can anyone help me ?
I was reading it and didn't understand this part: // Replace if using a different env file or config
const env = require('dotenv').config({ path: './.env' }); what other configs could I use or how do I get .env file?
SEPA Direct Debit is an asynchronous payment method. That means that it takes some time between submitting the payment and getting confirmation that it succeeded: https://stripe.com/docs/payments/sepa-debit/accept-a-payment?platform=react-native#confirm-success
Can someone please help me...my website is going live on saturday and my web developer just diappeared he still hasnt added my stripe account into my woocommerce and i have no idea how to do it...
Thank you @bleak breach. I was also reading the docs where it said SEPA payment can take upto 14 business days but I was unsure. Once again thank you, I will wait for it to be as "Succeeded". Thanks
If anyone can help me integrate it into my website i will be forever grateful
That's unlikely to be something we can help with here as there's a lot of context missing. I'd try to get back in touch with your developer, or failing that hire a new one to help you through this last step
I imagine it is, but it's hard to say without knowing your experience level, what your site's structure is and what you're trying to do
I would start by reaching out to WooCommerce directly, they might have some guides that can help you
ok thanks is there a number i can call i cant seem to find it
For WooCommerce? I'm not sure, closest I could find is https://woocommerce.com/contact-us/
@lucid raft I read the git hub thing and I put the code in my site and now it won't mount the input please help
thank you
Are you getting an error?
No, no errors the input won't show up
do you have a number?? I cant find the number?
here is a link to the code: https://replit.com/@KaviGupta1/Stripe-Checkout-Integration#client.js
You have an error in your code:
Uncaught ReferenceError: stripe is not defined at client.js:2
This is probably because you are attempting to access Stripe.js before the page has fully loaded. You should wrap your code to only run once the page has finished loading:
window.addEventListener('load', () => {
// add your code here
});
ok i did that but it didn't work do I have to install window?
window is a native JS property, you shouldn't have to
ok
window.addEventListener('load', () => {
// add your code here
// Set up Stripe.js and Elements to use in checkout form
var elements = stripe.elements();
var style = {
base: {
color: "#32325d",
}
};
var card = elements.create("card", { style: style });
card.mount("#card-element");
card.on("change", function (event) {
// Disable the Pay button if there are no card details in the Element
document.querySelector("button").disabled = event.empty;
document.querySelector("#card-error").textContent = event.error ? event.error.message : "";
});
var form = document.getElementById('payment-form');
form.addEventListener('submit', function(ev) {
ev.preventDefault();
// If the client secret was rendered server-side as a data-secret attribute
// on the <form> element, you can retrieve it here by calling form.dataset.secret
stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: card,
billing_details: {
name: 'Jenny Rosen'
}
}
}).then(function(result) {
if (result.error) {
// Show error to your customer (e.g., insufficient funds)
console.log(result.error.message);
} else {
// The payment has been processed!
if (result.paymentIntent.status === 'succeeded') {
// Show a success message to your customer
// There's a risk of the customer closing the window before callback
// execution. Set up a webhook or plugin to listen for the
// payment_intent.succeeded event that handles any business critical
// post-payment actions.
}
}
});
});
});
this is my client.js code
It is still not mountiong the input
Here is my checkout.html:<html>
<head>
<title>Buy cool new product</title>
<script src="https://js.stripe.com/v3/"></script>
<script src="client.js"></script>
<link rel="stylesheet" href="global.css" />
</head>
<body>
<header>My Store</header>
<form id="payment-form" data-secret="{{ client_secret }}">
<div id="card-element">
<!-- Elements will create input elements here -->
</div>
<!-- We'll put the error messages in this element -->
<div id="card-errors" role="alert"></div>
<button id="card-button">Submit Payment</button>
</form>
</body>
</html>
and im still getting stripe is not defined
You need to initialize Stripe.js first: https://stripe.com/docs/js/initializing
Complete reference documentation for the Stripe JavaScript SDK.
Ok i got it working
now my button won't let me submit
Here is my app.js:
const express = require('express');
const app = express();
const { resolve } = require('path');
// Replace if using a different env file or config
const env = require('dotenv').config({ path: './.env' });
var secretKey = ""
const stripe = require('stripe')(process.env.secretKey, {
apiVersion: '2020-08-27',
appInfo: { // For sample support and debugging, not required for production:
name: "stripe-samples/accept-a-payment/custom-payment-flow",
version: "0.0.2",
url: "https://github.com/stripe-samples"
}
});
app.use(express.static(process.env.STATIC_DIR));
var publishablekey = pk_test_51JCuQlLAJ7k6Ijx1lPl0ckK2lwdvFJBWSNKvayjmjVopUEFmILwjkcsnYeTSBaaAsSSbTRi9b7WdDBJBh18z9Bym007eKjzd4w
app.get('/', (req, res) => {
const path = resolve(process.env.STATIC_DIR + '/index.html');
res.sendFile(path);
});
app.get('/config', (req, res) => {
res.send({
publishableKey: process.env.STRIPE_PUBLISHABLE_KEY,
});
});
app.post('/create-payment-intent', async (req, res) => {
const { paymentMethodType, currency } = req.body;
// Each payment method type has support for different currencies. In order to
// support many payment method types and several currencies, this server
// endpoint accepts both the payment method type and the currency as
// parameters.
//
// Some example payment method types include card, ideal, and alipay.
const params = {
payment_method_types: [paymentMethodType],
amount: 1999,
currency: currency,
}
// If this is for an ACSS payment, we add payment_method_options to create
// the Mandate.
if(paymentMethodType === 'acss_debit') {
params.payment_method_options = {
acss_debit: {
mandate_options: {
payment_schedule: 'sporadic',
transaction_type: 'personal',
},
},
}
}
// Create a PaymentIntent with the amount, currency, and a payment method type.
//
// See the documentation [0] for the full list of supported parameters.
//
// [0] https://stripe.com/docs/api/payment_intents/create
try {
const paymentIntent = await stripe.paymentIntents.create(params);
// Send publishable key and PaymentIntent details to client
res.send({
clientSecret: paymentIntent.client_secret
});
} catch(e) {
return res.status(400).send({
error: {
message: e.message
}
});
}
});
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I dont understand the first part: const express = require('express');
const app = express();
const { resolve } = require('path');
// Replace if using a different env file or config
const env = require('dotenv').config({ path: './.env' });
the dotenv part
it says i can config a different way how do i do that
It is nice if you can format your code using triple ‘
'''alert("Hello")''' like this?
alert("HELLO")
Hi team, anybody from iOS team here. Could you please help me on PaymentSheet implementation?
Oh that was helpfull
`const express = require('express');
const app = express();
const { resolve } = require('path');
// Replace if using a different env file or config
const env = require('dotenv').config({ path: './.env' });
var secretKey = ""
const stripe = require('stripe')(process.env.secretKey, {
apiVersion: '2020-08-27',
appInfo: { // For sample support and debugging, not required for production:
name: "stripe-samples/accept-a-payment/custom-payment-flow",
version: "0.0.2",
url: "https://github.com/stripe-samples"
}
});
app.use(express.static(process.env.STATIC_DIR));
var publishablekey = pk_test_51JCuQlLAJ7k6Ijx1lPl0ckK2lwdvFJBWSNKvayjmjVopUEFmILwjkcsnYeTSBaaAsSSbTRi9b7WdDBJBh18z9Bym007eKjzd4w
app.get('/', (req, res) => {
const path = resolve(process.env.STATIC_DIR + '/index.html');
res.sendFile(path);
});
app.get('/config', (req, res) => {
res.send({
publishableKey: process.env.STRIPE_PUBLISHABLE_KEY,
});
});`
here is app.js part 1
`app.post('/create-payment-intent', async (req, res) => {
const { paymentMethodType, currency } = req.body;
// Each payment method type has support for different currencies. In order to
// support many payment method types and several currencies, this server
// endpoint accepts both the payment method type and the currency as
// parameters.
//
// Some example payment method types include card, ideal, and alipay.
const params = {
payment_method_types: [paymentMethodType],
amount: 1999,
currency: currency,
}
// If this is for an ACSS payment, we add payment_method_options to create
// the Mandate.
if(paymentMethodType === 'acss_debit') {
params.payment_method_options = {
acss_debit: {
mandate_options: {
payment_schedule: 'sporadic',
transaction_type: 'personal',
},
},
}
}
// Create a PaymentIntent with the amount, currency, and a payment method type.
//
// See the documentation [0] for the full list of supported parameters.
//
// [0] https://stripe.com/docs/api/payment_intents/create
try {
const paymentIntent = await stripe.paymentIntents.create(params);
// Send publishable key and PaymentIntent details to client
res.send({
clientSecret: paymentIntent.client_secret
});
} catch(e) {
return res.status(400).send({
error: {
message: e.message
}
});
}
});`
Your payment is failing because your client secret is undefined @kind python. You have a /create-payment-intent endpoint in your app.js code that you should use to create the PaymentIntent and return the client secret
@kind python please don't post your code over and over, I can see it in the repl so you don't need to repost all of it when you make a small change
ok
Client secret is different from secret API key
The client secret is what you get from the newly created PaymentIntent, you pass that secret back to your frontend to be used with stripe.js
I added my secret, still not working
Are you getting an error? I can't really help you if you aren't descriptive with what's wrong
If it doesn't work don't just say "it doesn't work", provide details so others can actually help you
Same error as before:
client.js:26 Uncaught ReferenceError: clientSecret is not defined
at HTMLFormElement.<anonymous> (client.js:26)
Your frontend code isn't getting the clientSecret from your backend. I highly recommend you read the docs here and follow them step by step: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Securely accept payments online.
I did follow that tutorial multiple times
hey guys, i have a small issue, i am using the @stripe/stripe-react-native package, and i used presentApplePay method.
after that, i clicked on the background, therefore the payment was not confirmed or cancelled, therefore, when i try to render new presentApplePay i get this error.
I am unsure how to handle it as the payment was not saved in stripe dashboard so i can't manually cancel it
I can' test if it will work now because I am blocked from pressing the Submit Payment button
I've seen that error happen before if you accidentally use your secret API key on your client rather than a publishable key
it was fine before, when i clicked on Cancel during the apple pay modal. however, when i clicked the background, this happens
Hmm would you mind opening up an issue on the github repo? https://github.com/stripe/stripe-react-native/issues
sure thing
If you want a working integration you can check out this sample: https://github.com/stripe-samples/accept-a-payment
I got this error : Uncaught IntegrationError: Invalid value for stripe.confirmCardPayment intent secret: value should be a client secret of the form ${id}_secret_${secret}. You specified: my key. at Z ((index):1) at X ((index):1) at yo ((index):1) at (index):1 at (index):1 at e.<anonymous> ((index):1) at e.confirmCardPayment ((index):1) at HTMLFormElement.<anonymous> (client.js:26)
I specified my secret in a variable called clientSecret
@kind python please don't share your secret key on the channel, you should keep your secret key safe
how do i get a configured .env file?
@kind python i think you may have mixed up the idea of a secret key and a client secret. A client secret typically looks like pi_123_secret_456
when you create a Payment Intent, the resulting Payment Intent object should have a parameter named client_secret
I have a question Paul told me I dont need server.js so do I transfer coder from server.js to app.js?
one second, let me catch up on the previous conversation that you had with Paul and i'll get back to you as soon as I can
@kind python sorry about how long it took for me to get back to you! Since you would need to create the payment intent in your app.js instead, yes, you would need to transfer the code from server.js to app.js
the bottom part which file does it go in?
so i can remove server.js right? and move all code to app.js right?
yes that's correct, you can remove server.js and move all code to app.js
ok
@bleak breach have created the issue on github already: https://github.com/stripe/stripe-react-native/issues/428
Thanks @past heath Hopefully SDK team will look into it
@golden cosmos I followed the tutorial you sent me here is the repl https://replit.com/@KaviGupta1/Stripe-Sandbox-Integration-v2#app.js I get the error clientSecrent not defined need some help.
I think I need to pass the clientSecret to client.js and I don't know how.
@kind python looking at it!
ok
We are creating a fixe price monthly subscription with free trial. Our goal is to have the user give us payment information before the trial is started, and for subsequent renewal to be charged automatically. However, we are having issues. Per Stripe document, we set the TrialPeriodDays when creating the subscription. Then create a SetupIntent and send the ClientSecret to the frontend JS. Looking at the call backs, it looks like the system automatically creates a subscription with an initial invoice of $0 for the trial, pays it automatically, and activates the subscription - this is all before I have a chance to colllect payment information from the user. How do we prevent that, instead only activate the trial once we have payment from the user?
@kind python so there are two points which i noticed :
- when you click on the submit payment button, you would first need to make a call to your app.js (server) to create the payment intent
- in your app.js, when it receives the call to create the payment intent, you would create the payment intent and then return the client_secret
I think I have done step one on line 15 i made a paymentIntent
And where can i find how to do step 2
@kind python i need to step out for a bit, orakoro will be helping you with your question
ok
Hello @kind python
Hi
I think you are creating PaymentIntent in Line 17
yes
so in Line 6 you need to pass in the exact variable name paymentIntent.client_secret not intent.client_secret
ok
Next, from that L4 to L7 is an endpoint of your server. You need to call that endpoint from your client side, which means the part from your L24 to L30 should be on client.js
L8 or L9 would be best place
ok done
Then you can try. If it doesn't work I will try to create a working example for you
I get this error Uncaught ReferenceError: clientSecret is not defined at HTMLFormElement.<anonymous> (client.js:35)
i think it is something wrong here var clientSecret = responseJson.client_secret;
ah ok that an extra step. You need to make that clientSecret available. How can I see your updated code?
I can just send you te code because i think it takes a while to update which file do you need?
Ah, no I can manage. Please wait a few mins
Alright
Is there an option to share or enable co-edit in that site?
i believe so do you have an account?
if not click this https://replit.com/join/hqkklktsdv-kavigupta1
Ok I am in
Ok ya i see you
Sorry I don't familiar with that UI. where are you seeing errors?
In the console but for some reason it is glitched if you go to this site https://Stripe-Sandbox-Integration-v2.kavigupta1.repl.co and inspect and go to console you can see the errors
oh
Also just curious what code editor or IDE do you use?
@kind pythonVisual Studio Code is pretty popular I believe
Ok thanks
Um I am seeing different error? That the /secret endpoint still hasn't working. Where are you seeing this?
ok ya that is the error i have too now
oh wait sorry I am getting the same error as before
I went to this site https://stripe-sandbox-integration-v2.kavigupta1.repl.co/checkout.html which is my site but not in an editor and clicked checkout put in test card info and pressed submit and when you inspect got to console and click the submit button i get that error
Yes that's correct, I wonder where did you get the Uncaught ReferenceError above. But nevermind let me look into the whole flow
These are my errors ignore the custon cursors one
That syntax error indicates that what was returned from your server wasn't valid JSON. That usually means that you have an error on your server. You should check the server logs
maybe if we move L4-7 to L23 since L4 is getting the client secret but there is no client secret yet since there is no paymentIntent
Nope
res.json({client_secret: paymentIntent.client_secret});is this naming the json to "res"?
No, that instructs your server framework to return a JSON object
ok
GET https://stripe-sandbox-integration-v2.kavigupta1.repl.co/secret 404 (anonymous) @ client.js:9 VM236:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 I think we need to fix these errors to fix clientSecret is not defined
You have an error on your server, I'd start by debugging that
hey i have a question
i want to use indian stripe for dropshipping
what are the requirements of it??
I don't recommend this, drop shipping is against Stripe's T&Cs: https://stripe.com/restricted-businesses#unfair-predatory-or-deceptive-practices
@kind python That 404 means that your server doesn't have a /secret endpoint
but lot of people are using stripe as a payment gateway
for dropshipping
people form the US
That may be the case, but it is a restricted business and will likely get your account terminated
Either way this isn't the place to talk about that. This Discord is for development and code questions. If you have questions about whether your business can be supported on Stripe I suggest you reach out to Stripe support directly: https://support.stripe.com/contact/email
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.
tried running expo install @stripe/stripe-react-native and got this error
Failed to resolve plugin for module "@stripe/stripe-react-native" relative to /Users/path/to/project
It was fine until i tried to upgrade to 0.1.5. I have the plugins section also defined in my app.json
"plugins": [
[
"@stripe/stripe-react-native",
{
"merchantIdentifier": "",
"enableGooglePay": false
}
]
]
oh it was because i had the plugin defined in app.json. had to remove it then run the expo install command and then it installed fine
Hi there, I am trying to create a subscription based app that offers a trial period initially for 7 days and then charges the customer. Currently I am using React for my frontend, so naturally I am using this - https://stripe.com/docs/stripe-js/react.
So in my backend I am using this particular code to create a subscription with the trial -
const subscription = await Stripe.subscriptions.create({
customer: customerId,
items: [
{
price: priceId,
},
],
trial_period_days: process.env.TRIAL_DAYS,
});
And this works just fine. I was just wondering what will be the frontend code for this ??
If I am not providing the trial then I would use something like this in the frontend -
const { data } = await client.post(
"/subscription/create",
{ email, customerId: customerID, plan: selectedPlan },
);
const { clientSecret } = data;
await stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: elements.getElement(CardElement),
billing_details: {
name: userName,
},
},
});
Where the client secret comes from the backend, where I would do something like this -
await Stripe.subscriptions.create({
customer: customerId,
items: [
{
price: priceId,
},
],
payment_behavior: "default_incomplete",
expand: ["latest_invoice.payment_intent"],
});
but since I am creating a subscription with a trial I cannot get the latest_invoice.payment_intent which would give me the client secret.
So what shall I do instead ??
Will this work ?? in the frontend -
await stripe.createPaymentMethod({
type: "card",
card: elements.getElement(CardElement),
});
}
@south pendant For subscription with a trial, there will be no charge / payment created, thus you will not get the payment_intent
Yes, but then do I need a card element in the frontend to create a payment method ?? Or how does it work ??
instead you should get the pending_setup_intenthttps://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
instead of confirm payment_intent, you should confirm setup_intent
see our doc here https://stripe.com/docs/billing/subscriptions/overview#non-payment
Learn how subscriptions work within Stripe.
Okay will give this a try. Thanks @lucid raft
np
Hello
what are the ways to implement 3D secure integration
@kindred frigate you can follow the standard integration path from Stripe. Our PaymentIntent API will handle that automatically for you if 3DS is required
https://stripe.com/docs/payments/accept-a-payment?platform=web
Securely accept payments online.
can you send me PaymentIntent API integration code in react js
How to create a variable amount (donation basically) with nextjs and stripe?
Is it possible to add card in test mode?
Hello,
I have setup the Stripe Payment request buttons "https://stripe.com/docs/stripe-js/elements/payment-request-button" on my website. It's only working for Google Pay and not Apple Pay. I have verified domain on Stripe Apple section and download the "apple-developer-merchantid-domain-association" file and then upload it to https:// sd gsdg s.com/.well-known/apple-developer-merchantid-domain-association path. But still Apple Pay button isn't working...
Have a look here: https://stripe.com/docs/payments/integration-builder Make sure you select the "react" button up top
Learn how to embed a custom Stripe payment form in your website or application.
If you don't mind using Checkout, here's a sample you can use: https://glitch.com/edit/#!/stripe-checkout-donate
Yes, but only the test cards available here: https://stripe.com/docs/testing
Learn about the different methods to test your integration before going live.
Let me test something real quick
If you go to this page in Safari, do you see the Apple Pay button at the top https://stripe.com/docs/stripe-js/elements/payment-request-button ?
Collect payment and address information from customers who use Apple Pay, Google Pay, and browser-saved cards with Payment Request APIs such as Microsoft Pay on Edge.
Hi, i am integrated https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#google-pay this package in my react native project, but the google pay ui is not opened
Securely accept payments online.
only showing ui for card payment screen
No, it's not working on that page.
But it's working on here. https://applepaydemo.apple.com/
That would suggest that you don't have a card saved in your Apple Pay wallet, or otherwise have Apple Pay disabled on your device
But it's working for " https://applepaydemo.apple.com/".... :\
You can't list invoices by those paid out of band unfortunately. You'd have to list them all and then filter by status: paid and payment_intent: null to indicate if it was paid out of band.
thank you so much Paul 😊
I don't know about Apple's site and their implementation, but if it doesn't show on that Stripe docs page then you still likely have a problem with your saved card
So i mentioned this last week that when a payment fails due to 3d secure we get both an invoice.payment_failed and invoice.payment_action_required webhook. It was explained it for backwards compatibility and that I can inspect the invoice.payment_intent.last_payment_error. However, in testing this seems to be null all the time? Similarly, the charge is null so I can't look for the reason there.
How do I tell and invoice.payment_failed that's and actual failure, versus one thats been triggered for 3d secure? We're sending emails based off this information, so we need to make sure we can split the two apart otherwise the customers going to be receiving two emails.
Example invoice id: in_1JDlcV2S6VvI66Gy7VfclYTO
Hey everyone 👋 I've question about how can I retrieve dashboard information via using API. I want to fetch all those information with using Stripe endpoint without calculate any data. Is that possible?
Maybe I can use invoice.payment_intent.status == "requires_action" as that would imply the invoice.payment_action_required event is coming?
Yes I am looking at that payment_intent status and "requires_action" means waiting for user's action
also the next_action states what to do next
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hi, can I capture more money than reserved or should I create another transaction for that?
Cool, and if we have a invoice.payment_failed event, and the payment intent has a status of requires_action. Would that mean a invoice.payment_action_required webhook was coming, or already has came?
I know backwards compatibility wise, it sends both, but it seems maybe we can ignore the failed, if we're handling the action_required event (when the status is action_required)
Currently it is not possible. You can take a look at reporting API and see if that could get what you need https://stripe.com/docs/reports/api
We can't guarantee. There are various reason a webhook can arrive later or sooner
it depends on the internet, network route, etc. Normally we never can give a guarantee
I mean, but it would it was always come (unless it failure occurred in the sending of it)
I'm thinking it works like this:
invoice.payment_failed event => Ignore if invoice.payment_intent.status is requires_action, handle if its not requires_action
invoice.payment_action_required event => always handle
oh really.. can't believe that is not possible :/ Has Stripe a plan for that in the feature?
Yes that sounds a safe bet. Either way make sure to look at the status of PaymentIntent to see the status
@keen goblet Try the reporting API. All the information could be obtained from reporting API. It is just that you probably needs to do data reconciliation to get exactly what you see on the dashboard https://stripe.com/docs/reports/report-types
Understand the report types available via the Reporting API.
Hello! We're trying to connect vendors to my Site. May I know how can I connect a Standard or Direct account to my Platform account?
@teal cobalt for connecting existing account, you can make use of the OAuth Link https://stripe.com/docs/connect/oauth-standard-accounts
Use the OAuth connection flow to allow a Standard user to connect to your platform.
Sounds good thanks. I've concern about how it works. That will work async or sync?
No, you can't capture more than the authorization amount https://stripe.com/docs/payments/capture-later#capture-funds
Separate authorization and capture to create a charge now, but capture funds later.
The reporting API is async as it takes time to generate the reports. After the reports run is done, you can download the report csv file
https://stripe.com/docs/reports/api#report-runs
Access Stripe's financial reports programmatically to automate your reconciliation workflow.
Let me try that. Thanks!
This might be what you are looking for: https://stripe.com/docs/connect/standard-accounts
Integrating with Standard accounts is the fastest and easiest way to get started using Connect, since Stripe will handle the majority of the user experience and user communication.
oh, sorry didn't see previous reply
Ah got it. But this approach won't fit me :/ I need to fetch by synchronously.
Hi
Hi, stripe support developer !
I want some help from developers for my small business website
Please help me directly in coding.
That is built with python, django
Hi @molten tundra can you type in your question?
Don't share your key/any kind of credential. In here we only can help with code/integration
@dry hatch yes, thanks.
@dry hatch
@dry hatch
when user click plan, all are going to admin.
@dry hatch here, dispatcher trainer can introduce some students in this site.
In this case, student should pay 90% to admin and 10% to dispatcher trainer.
@dry hatch That is 4 logic in image.
@dry hatch I can't find how to code this part.
@dry hatch 1, 2, 3 logic is already added to code. need only 4 logic.
Hello guys! is it best to use unit_amount or unit_amount_decimal if i want to support all currencies (including zero decimal ones)
USD, GBP, EUR, JPY etc
Which one is better to use 🙂
@dry hatch Hi, are you there?
Hi, I am afraid I only can help with Stripe related integration. Business detail is out of our expertise
@dry hatch OK. Thanks for your kind.
If you have any questions relate to Stripe API feel free to reach out
@dry hatch Thank you !
I am still having trouble with getting "isApplePaySupported" to return true
Steps I did
- Create identifier
- Download cert signing request and upload it to stripe
- Enable Apple Pay as capability
- Added Apple Pay merchant according to photo
- Add card to wallet on iphone
And still , apple pay is not supported, what do I miss?
I have also added merchant ID to stripe provided inside my react native app
Great! Thank you.
they should be the same except the decimal one can accepts up to 12 decimal places.
You should look into using Connect: https://stripe.com/docs/connect
Is this the Payment Request button you're having trouble with?
@bleak breach Yes
Okay let's start with some simple debugging, if you go here in the Safari browser do you see the Apple Pay button at the top? https://stripe.com/docs/stripe-js/elements/payment-request-button
This boolean check here returns false, when I remove it and just try to present the payment sheet using presentApplePay function from the hook nothing happens
That's not Payment Request, that's React Native.
Pardon, I meant react native
If isApplePaySupported isn't returning true on an iOS device, then the most likely reason is that there isn't a card saved in your Apple Wallet
Let me try to add a new one
Bear in mind that it has to be a real card, not a Stripe test card. You won't get charged with Stripe when using your test keys. Apple Wallet won't accept a Stripe test card
$customer = Customer::retrieve($plan->customer_id); $customer->sources->create(array("source" => $token)); $customer->save(); what does the $customer->save(); do?
Where does $customer->save(); customer information?
@peak flame That's how you update a customer in old versions of stripe-php
Does old version of stripe-php use old stripe API ?
@peak flame It's long since been deprecated, we recommend you use client services in PHP now: https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-services-in-7.33.0
@bleak breach the flow in our application is: We use the CardField component you provided inside the application to get the users info so that we can auto subscribe them to our product, we need the card information so that we can also charge them on the admin panel of our app. Is it possible to extract the card information f rom apple pay so that we can do this?
No, stripe-php and Stripe API version are two different things
I do not need to use one time payments, only subscription based payments
Yes you should be able to use Apple Pay for recurring payments: https://stripe.com/docs/apple-pay?platform=react-native#recurring-payments
Allow customers to securely make payments using Apple Pay on their iPhone, iPad, and Apple Watch.
@bleak breach I removed the old card and added a new one and now the payment sheet is presented! Thank you
Hello,
Can you share payment-intent API code in Asp .net MVC
Does old stripe-php use stripe API 2020-08-27 too?
$customer = Customer::retrieve($plan->customer_id); $customer->sources->create(array("source" => $token)); $customer->save(); what does the $customer->save(); do?
Where does $customer->save(); save or update customer information?
Does it save/update in dashboard?
@bleak breach Just one more quesiton regarding the recurring payments for Apple Pay, what would be the flow, do I need to pass in a token? Where can I find a guide?
Or inside of stripe?
You can yes, API version and stripe-php version aren't really linked. I highly recommend you use the latest version of stripe-php however. There's no reason to use older versions, especially since they won't have newer features like Checkout Sessions.
Yes for what?
Ok, understood.
$customer = Customer::retrieve($plan->customer_id); $customer->sources->create(array("source" => $token)); $customer->save(); what does the $customer->save(); do?
Where does $customer->save(); save or update customer information?
Does it save/update in dashboard?
Or inside of stripe?
Inside of customer database of stripe?
I don't understand what you mean by that @peak flame. When you save a customer it'll be stored on Stripe yes, you'll also be able to see that update on the dashboard
Ok
There's no official docs for that, but you could look at this: https://www.c-sharpcorner.com/blogs/implement-stripe-payment-gateway-in-asp-net-mvc
Server Side Implementation of Stripe Payment Gateway in ASP.NET MVC. There are many Payment Gateways in market which gives secure and easy implementation. And Stripe is one of them.
I have implemented stripe payments on a web page using their API. A user says they cannot click in the fields to enter their credit card information. The majority of users are fine, and making payments ok.
Is your user getting an error?
no error, their screenshot just shows the area where the credit pard details usually go
When adding a card, I got error for https://api.stripe.com/v1/tokens , Your card was declined. Your request was in live mode, but used a known test card. , what does that mean? I have used 4242 4242 4242 4242 card number.
The error is pretty clear. You were using your live API keys, but used the 4242 test card.
That doesn't look like a problem with Stripe, more like a problem with your UI. You should ask for details from your user to see if you can recreate the problem.
Hello,
Can i know what is difference between PaymentIntents or Checkout and which is preferred for 3d secure
Bun .env file, I have used STRIPE_KEY="sk_test_..."
Who calls https://api.stripe.com/v1/tokens?
When is https://api.stripe.com/v1/tokens called?
Is it called from javascript getting card information?
A PaymentIntent is what you create if you wish to charge a customer. Checkout is a product that Stripe offers which does all the heavy lifting of creating PaymentIntents and providing a UI for you: https://stripe.com/docs/payments/checkout. Both are fully SCA and 3DS compliant.
Your code should be able to tell you this. I have no way of knowing why your code is calling that endpoint.
If https://api.stripe.com/v1/tokens it is a live endpoint, what is the test endpoint?
There's no live or test mode endpoint, the only differentiating factor is which API key you use, your test key (sk_test_123) or your live key (sk_live_123)
The endpoint is always the same regardless of test or live mode
Bun .env file, I have used STRIPE_KEY="sk_test..."
Are you tokenizing from the client? If so you are probably using your live publishable key pk_live_123
Yes, it is creating token from javascript, Stripe.card.createToken(...
We have had 12 successful transactions, this is the first time we have seen this issue
The publishable key is the key you use on your frontend. It's used amongst other things to tokenize cards and confirm payments
Is it possible to extract card info from apple pay so that the user can be charged from the admin panel?
What we have now is that the user adds his card via CardInput field, and then we save that for future surcharges, but with apple pay I don't see a way how I can extract that card information
@peak flame see here: https://stripe.com/docs/keys
Manage your API keys to authenticate requests with Stripe.
What do you mean by "admin panel"? The Stripe dashboard?
@bleak breach I think it's not working for my region (Sri Lanka). But my client can see that Apple Pay button on the developed website, and when he click on that button it will appear and disappear again.
Is it because of the website modal?
Yeah, I need the card information so that I can apply additional penalty fees if the user is late with his payment
I basically need to save the user's card in the stripe dashboard, via apple pay
I don't need immediate payments, just to save the users card
@vocal wagon Hey, taking over for @bleak breach. Just getting caught up!
Hello,
i am looking OTP integration means if user entering card details they get OTP in your phone and once enter the OTP it will process for further. so can you suggest
Hi, okay! I can summarize for you real quick,
Without apple pay , we user the CardField to save the users card, and then we use that card info to subscribe the user to our product
We also use the card info if we need to apply a penalty fee to the user
I need to be able to save user's payment info somehow so that we can apply additional fees, without presenting any kind of payment sheet
hello, Is it possible to install the stripe in Spain on the shopify page?
@river star Hmm, that's strange and hard to debug without some additional context. Can you provide any logs from the browser that indicate an error?
@kindred frigate Hey! You mean one-time password for additional payment auth?
Yes
Can i confirm this with someone, using multiparty payments where i receive money from alot of customers and pay out to alot of suppliers, require i make a stripe account for every single supplier?
@vocal wagon So there's no initial payment when collecting payment details?
@kindred frigate Sounds like you're referring to 3DS, which our recommended payment flows and libraries all support: https://stripe.com/docs/payments/3d-secure
@undone hound Hello. Can you describe your business use case a little more? Sounds kind of like a marketplace, which Connect is perfect for
No, we just call the stripe.subscriptions.create once we have the user card saved
@vocal wagon Hello! That should be possible yes, although Shopify have their own payment flow built-in so not sure why you'd want to do that
Its completely theoretical at the moment, but I was thinking of something like gumroad but for slightly more expensive things
It is like a marketplace
So we have
a) User saves card
b) We auto subscribe them
c) Using the stripe dashboard, we can apply additional penalties
But our problem is, we can't "extract" card info from apple pay
but I'm based in Malaysia, and the customers and suppliers might be businesses of themselves
So I'm not too sure about creating multiple stripe accounts for businesses
@vocal wagon You should look into Setup Intents for saving payment methods (including via Apple Pay) and using them even when your customer's aren't present: https://stripe.com/docs/payments/save-and-reuse
Learn how to save card details and charge your customers later.
@hollow prairie That's a mobile device of my client. I can't debug it... 😦
Not to mention the actual payment gateway that I'm interested in implementing is FPX, which is local to malaysia, I also noticed a line that says the maximum is RM30,000 , which I think might be too low for some of the customers I intend to work with
@vocal wagon You shouldn't be handling raw card data as that would fall within PCI compliance scope: https://stripe.com/docs/security/guide
Ensure PCI compliance and secure communications between your customer and your server.
@river star You really need a way to replicate that issue directly so that we can help debug it
@vocal wagon We tokenise the Apple Pay card data on the client for this very reason
@undone hound If you wanted to automate multi-party payments then each party would need a Stripe account yes
@hollow prairie So we should always go with the PaymentSheet , to first create an intent and then subscribe?
also, the PCI is EU based no? Our clients are from US
@vocal wagon You're confusing PCI with SCA (I think). SCA is Europe focused (right now, nothing to say that won't change in the future - which is why we recommend building compliant payment flows regardless of where you currently operate)
@vocal wagon Everybody, regardless of geographic location, must be PCI compliant when handling card data. By using our APIs and libraries, you are PCI compliant because of how we tokenise payment data. If never actually touches your servers
@vocal wagon So objects like Payment Methods (pm_xxx) are tokenised versions of your customers payment data than can be re-used, without you ever actually touching the raw credit card data
@hollow prairie But we don't save the card information in our database, we save the card on the Stripe Dashboard, however we do need the users Card Number and CCV ( we use dangerouslyGetFullCardDetails prop)
@vocal wagon But you shouldn't be really (unless you have your own PCI compliance)
So how do I save the card info, do I just need to use the Prebuilt Payment UI ?
I mean, in order to make additional charges in the future. Our only payment method is subscription base
@vocal wagon There's a RN guide here for capturing payment details and saving them for future usage: https://stripe.com/docs/payments/save-and-reuse?platform=react-native
Learn how to save card details and charge your customers later.
So basically, I should use this for both regular payments and apple pay, even subscriptions only?
not by saving the card field
Do I also need to ask for permission to save data, even when using the prebuilt payment system as you linked?
@vocal wagon You should, yes:
When saving card details to use for future off-session payments, especially in Europe because of regulations around card reuse, get permission to save a card. Include text in your checkout flow to inform your customer how you intend to use the card.
@vocal wagon Yes I would recommend building your integration this way to save payment data
i am not clear about PaymentIntents or Checkout. can you explain and what are the features and how to integrate onetime password
@kindred frigate Do you have any specific questions? They're our recommended products for building SCA compliant payment flows. Checkout is a (low-code) Stripe hosted solution, where as if you build your own custom checkout you'll be using PaymentIntents directly
Hello, please can you tell me where exactly and how to call the handleStripeJsResult & handleServerResponse functions to trigger the 3DS call? Thank you
https://pastebin.com/VXguCkgG
https://stripe.com/docs/payments/accept-a-payment-synchronously?platform=web#web-handle-next-actions
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Learn how to confirm a payment on your server and handle card authentication requests.
Hello guys does stripe charges any fee when we transfer amount from our stripe account to connected account.
@vocal wagon Hey! handleServerResponse is called in step 3 of that guide you've linked, in the Promise chain of the request to send the Payment Method object to your server
@vocal wagon Here: https://stripe.com/docs/payments/accept-a-payment-synchronously?platform=web#web-send-to-server
Learn how to confirm a payment on your server and handle card authentication requests.
@river portal Hello! There is no fee to transfer between accounts, no. You can verify this in test mode
@vocal wagon Is there a specific use case for following the server-side finalisation guide? We generally advise against that flow unless absolutely necessary
@hollow prairie I am in Custom, the capture can sometimes be triggered in a second step. Thank you for your answer, I don't understand why I can't find any of the elements of the guide in my original code which worked so far (bug for about 3 weeks with the 3DS). I don't know where to intervene to unlock this.
@hollow prairie In my notes when I did the development, I noted this link which is no longer relevant? https://stripe.com/docs/payments/payment-intents/web
And I see this too ?? https://stripe.com/docs/js/deprecated/confirm_payment_intent_element
Complete reference documentation for the Stripe JavaScript SDK.
@hollow prairie Please help me, I'm not sure what to do? Do I have to completely re-code the client-side payment form (HTML / JS)?
@vocal wagon You mean you're using an auth and capture flow?
@vocal wagon confirmPaymentIntent has been superseded by confirmCardPayment: https://stripe.com/docs/js/payment_intents/confirm_card_payment
Complete reference documentation for the Stripe JavaScript SDK.
@hollow prairie The payment workflow varies according to certain conditions.
The most complete is:
1 / Customer payment (borrows) with 3DS if necessary
2 / Creation of the service provider (IBAN)
3 / Confirmation of the debit
4 / Transfer of funds to the service provider
@hollow prairie Is this why the pupop to request the 3DS is no longer triggered? Because payments without 3DS still work well.
@vocal wagon In some cases 3DS may not be required. It's not always necessary, and it's up to the issuing bank to determine whether or not it's needed. We just relay that message and facilitate the auth capturing if needed
@vocal wagon Are you testing with any specific cards? There are a variety of cards to test your integration with, some of which will force 3DS: https://stripe.com/docs/testing#regulatory-cards
@vocal wagon So if the issue is that you're not seeing the 3DS prompt, perhaps you need to try one of those cards!
@hollow prairie Yes, of course I test the cards with this: https://stripe.com/docs/testing#regulatory-cards
Learn about the different methods to test your integration before going live.
Hi! Is it possible to pay an invoice before it's finalised? I'd like to call directly Invoice.pay instead of having to do Invoice.finalize and then Invoice.pay
@hollow prairie My problem is, my code was working fine.
I am now losing around 30% of my turnover.
I would like to understand what I need to change to resolve.
@rigid ridge Hey! It is not, needs to have status: 'open' to be payable: https://stripe.com/docs/invoicing/overview
Understand the workflow for Stripe Invoicing.
@hollow prairie I've been trying to get a clear answer for weeks. Via freenode, via chat support, via suppport calls and finally I find out that you have switched here.
Please give me a clear action to do, thank you
thanks!
@vocal wagon I'm still not sure what your actual issue is. Are you saying that your current code does not capture 3DS auth when required?
@hollow prairie Yes exactly, the code no longer asks for the 3DS (The client side popup) when it is necessary on the client side before returning to the PHP execution.
For your information, however, I received this from you by email on May 12, 2021: "According to our information, your XXX account is already using our SCA ready solutions to accept payments with Stripe. Please note that we will apply exemptions and We will only ask for authentication when the cardholder's bank requires it. In addition, we will take into account for each country the timetable for the application of this regulation in order to limit the problems. "
@vocal wagon Have you verified that the 3DS flow is actually broken by testing it with a test card? Is there a specific error in the browser you can share when the code breaks?
@hollow prairie
one more thing
how much charges apply on apple pay, google pay and debit card when we deduct amount from one of these using stripe token ?
how much transaction fee is applied on this transaction
@hollow prairie Yes, I tested with a card, as said just before.
On the client side, I have no visible JS error.
On the PHP side, I end up with the require-action status
@river portal Are you referring to Stripe transaction fees or anything Connect related?
@hollow prairie Well, if I understood correctly, I have to replace PaymentIntent by confirmCardPayment and when it is done, it is on the PHP side that the 3DS will be called when necessary, you confirm?
@river portal Same transaction fees apply, regardless of how the card details were collected (i.e. via a wallet like Apple Pay or collecting card details via Elements): https://stripe.com/pricing
@vocal wagon Is your full JS integration code here: https://pastebin.com/VXguCkgG ?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@vocal wagon Where is your call to create the PaymentIntent?
@hollow prairie Yes, this is the full code on the JS side
@hollow prairie On the PHP side, it's here: https://pastebin.com/1r7CbKUS
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@vocal wagon That's code to retrieve a PI. How are they created?
@hollow prairie
what specifically do you mean by this?
"regardless of how the card details were collected "
Hey !
I have a problem, in url field, we cant add space, but its actually working, how can i fix it ??
@hollow prairie On the HTML / PHP form example here:
$ intent = \ Stripe \ PaymentIntent :: create ([
'amount' => $ tokens_price,
'currency' => 'eur',
'receipt_email' => $ util_email,
'payment_method_types' => ['card'],
'capture_method' => 'manual',
'description' => 'Recharge: 5',
'confirmation_method' => 'manual'
]);
@river portal You mentioned Apple Pay and Google Pay as if the fee would be different. I was just confirming that isn't the case. Unless I misunderstood the question!
@steady thorn Hello there. url field for what exactly? Which API are you using?
hey, im trying to remove space from, i'll give you news later
@steady thorn Can you share a request ID that you're having issues with? 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.
@vocal wagon You're doing both manual confirmation and manual capturing, so your flow is a little bit more complicated than the basic guide.
However your JS is missing the confirmCardPayment call which will invoke the 3DS flow if required (which is what requires_action indicates)
hello there
How can I cancel the future invoice for the subscription and allow users to use until the current billing cycle
@toxic quartz sounds like you want cancel_at_period_end as documented at https://stripe.com/docs/billing/subscriptions/cancel
@meager hawk which webhook event I will get at the billing end date ?
customer.subscription.deleted
thank you 👍
Hello, I have simple problem. How can I add trial to the subscription using checkout? I see options like trial_period_days but this is for subscriptions. For Checkouts I found free trial on price, but it's legacy
Ou, stupid me. Thank you!
Is there an event for when a subscription is paid or is it just the standard invoice events?
@frosty coyote it's invoice events, like an invoice.paid event happens each month as the customer gets charged.
https://stripe.com/docs/billing/subscriptions/webhooks#tracking
the event has a billing_reason field which is useful too : https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
@hollow prairie Yes, that's what I understood, thank you for this answer. So we come back to this: https://stripe.com/docs/payments/accept-a-payment-synchronously?platform=web#web-handle-next-actions
But I don't see when and how to call these functions exactly?
@vocal wagon you create the PaymentIntent on the backend, have an if-statement that checks if the stautus == "requires_action:" , if it is then you return the details to your frontend Javascript code and it calls those stripe.js functions.
ok cool, i'll just use that. We're looking to notify our customers if their payment method is expiring soon.
We don't currently have the information, so was working out the best way for me to gather it without changing too much about the current process. I think invoice paid event, and then looking for subscriptions is the easiest approach to gather and keep a list for another service to then process and send notifications as required. Thanks
@meager hawk Ok, thanks, I will try this.
@meager hawk Hi,
Could you please tell me what's the error of "req_mF7GAVdib7owS5"?
@river star
"No such PaymentMethod: 'pm_1JDnu8DRAO5UDaqFV1uqFEe5'; OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account."
What is mean SetupIntents and PaymentIntents
@meager hawk I have done this and thanks for the help but just wanted to ask you that my subscription will end next month so is there anything which I can use to simulate the end of current billing cycle for the testing purpose right now and check the subscription events
@river star you can't use a PaymentMethod created on the platform account directly on a connected account. You have to either create the PaymentMethod on the connected account (https://stripe.com/docs/connect/authentication#adding-the-connected-account-id-to-a-client-side-application , as also described at https://stripe.com/docs/connect/creating-a-payments-page for Direct Charges); or you'd copy the PaymentMethod to the connected account : https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
@kindred frigate I'd suggest starting at https://stripe.com/docs/payments/intents and let me know if you have more specific questions
@toxic quartz not really unfortunately! you could just cancel a test mode subscription immediately and it will generate the same event, so you can 'pretend' in your code that it actually happened later.
okay @meager hawk
thanks for the help
@meager hawk Actually, I'm using Payment Request Button for Google Pay and Apple Pay. Google Pay is working fine without any issue. But Apple Pay button is not appearing correctly.
What could be the issue for this?
@river star to be clear you're asking a separate question now.
that's because you didn't register the domain for Apple Pay on the connected account
you need to make the API call described there (using your livemode API key) to register the domain for the connected account and then pass stripeAccount to stripe.js for Apple Pay to work in the Direct Charges scenario.
Yeah, I think the request error is older one since I didn't get any new error requests for this... Sorry for that.
When I register the domain, the button is appear on the checkout page.
@meager hawk When I call the JS for the handleCardAction function (backend side) I have the following error, any idea? "No such payment_intent: 'pi_1JDpcmBfAoJM0K2yN6mxto… ut a live mode key was used to make this request."
I recived an error from Stripe API
Checkout does not support multiple prices with different billing intervals.
Is there workaround for this? I will have a two subscriptions to choose, one for 1 month (20 PLN) and the second for a year (40 PLN). Something like to the picture, but with 2 options. My actual solution is 2 buttons on my website. One for monthly subscription, second for yearly. It's the best possible solution?
@river star not sure I follow. That's a good thing right, you want the button to appear, right?
@gentle thicket yes the only option is to have two separate subscriptions for the customer (https://stripe.com/docs/billing/subscriptions/multiple), you can't have different intervals on a single subscription, since a subscription is basically a framework for generating a single Invoice on a given schedule
@vocal wagon I think the error is self-expanatory, sounds like you have mixed up your API keys since you create the PaymentIntent in test mode using a sk_test_xxx but try to do something with it using a livemode key pk_live_xxx so that won't work
@meager hawk It makes sense. Thank you one more time. Have a nice weekend 😄
@meager hawk Button is appeared for Google and Apple Pay. But for Apple Pay, the payment popup (When a user clicks on the Apple Pay button) is disappearing like the above screen record.
@river star yep and that's usually fixed by registering the domain on the connected account
You mean here?
That's our platform account. There are a few connected accounts as well.
ok! then you need to read https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-using-with-connect as I linked earlier. You have to make the API call it describes to register the domain for each individual account.
this part :
what I'd usually recommend is setting up your system to make this call as soon as you connect a new account to your platform so they are setup and ready to go
@meager hawk I manage to display the 3DS popup, during the 2nd call to the backend, despite my confirmation, the status remains at requires_action?
pi_1JDpzNBfAoJM0K2ytm7fAWa5
@meager hawk Thanks... That's the missing part. 🙂
I'm using .NET version. So do I need to use that created variable {var domain} response for any further requests? I mean for confirmation or any other requests.
@river star nope! It's a one-off thing, once you make the registration call and it succeeds you don't need to retain or store anything from there
@meager hawk Thanks! 🙂 It will be going to register each and every Apple Pay intent creation. Is that correct? Or is it just a one-time registration.
@vocal wagon it's not actually requires_action, it's requires_confirmation right now, which is correct and expected as you've completed authentication on it, so you'd call confirm() again on the backend https://stripe.com/docs/payments/accept-a-payment-synchronously?platform=web#confirm-payment
@river star it's a once-off for each account, you don't do it for each PaymentIntent or anything like that. As I mentioned a good approach is setting up your system to make this call as soon as you connect a new account to your platform, as like a step during onboarding the account, so they are setup and ready to go
@meager hawk Ahhh... Got it. 🙂
Hey there. In my app, there are 3 types of users. Each has 3 plans they can subscribe to. Right now, in Stripe those plans are set as 3 Products (one per user type) and each product has 3 prices (the plans the user can subscribe to).
I want to make a Billing Portal but when creating the portal configuration, it states "For each product, its price must have unique billing intervals."
The issue is: if I now create one product for each subscription, what will happen to all the current user's plans when accessing the Portal? They will still have the old plans/prices so how can I update that and keep the user's plan remaining days?
@slender relic hi! I'm not entirely sure I follow, but just creating new Products/Prices won't change anything for existing customers(except that they can maybe choose to switch to them in the Portal). If you want to explicitly change what the customer is subscribed to you'd do that directly by calling the API or using the dashboard to edit each individual subscription : https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing
Is there a need to create a customer in the PaymentIntents integration process?
Humm. Ok. I was afraid when a user went to the portal with an non-portal-existing plan it would break something. Thanks will take a look into this then.
@kindred frigate no, it's optional. You can create and use one if you'd like to save payment details for the user to use for future payments for example but you can also do entirely standalone payments if you prefer
Just another thing: how can we customize the plan features that appear under the plan name in the portal? My plans have multiple lines. When I edit a plan, in the Description field I cannot add line breaks.
@slender relic I don't really follow what a "non-portal-existing plan is" but if there's something wrong with your configuration you should get a failure earlier in the process like an API error when creating the configuration object or the Session object.
You can't edit the description beyond what you've seen there, I don't think there's any way to use line breaks or any special formatting.
@meager hawk We have added that registration code into intent. And later we will remove it from payment intent and put to one-time registration...
Anyway, it's not fixed the previous issue.
@river star what's the ID acct_xxx of the connected account?
@river star also if you can give me a link directly to that page you're testing on that's the fastest way for me to help you
I have 3 plans (A, B and C) with 3 prices each. But this is not compatible with the Portal.
So I will create 9 new plans (D, E, F, G, H, I, J, K, L) with 1 price each so then I can use them in Portal.
Users with the current A plan, will only be able to see D, E and F in the portal. Users with the current B plan, will only be able to see G, H and I in the portal. Users with the current C plan, will only be able to see J, K and L in the portal. I will create multiple portal configurations for this.
So now when a user with plan B (can only see the new plans G, H and I) goes to their portal page, will that work? They will be able to change their plan to G, H or I, right? No B plan will be present, even if it's their current plan?
sorry, I think when you say "plan" you mean "Product". Plan has a specific meaning in Stripe as well so it's confusing me
Yes, Product, sorry.
@meager hawk acct_1HfkfYKKtQ07fcfF
I don't think I can give you a better answer than just testing it yourself as I'm having trouble following you. Like I don't actually know what "I have 3 products (A, B and C) with 3 prices each. But this is not compatible with the Portal." means
@meager hawk Is there anyway to share a private message?
Is there any impact on recurring payments if we implement 3D Secure
@river star there's no domains registered on that account
if we update the stripe npm package version, does that automatically upgrade the default API version that the code uses too?
so you either didn't make that API call or made it wrong(my guess is you didn't include StripeAccount in the RequestOptions)
@novel heath no, for stripe-node the version of the library and your Stripe API version are completely separate
(that's not the case for our Java/.NET/Golang libraries but that's different as they're typed languages)
@kindred frigate the short answer is yes but that's such a vague question I'm not sure what else I can say.
ok great thank you @meager hawk
@meager hawk hello there everyone, I'm new so I have no idea how this works. I am looking for a list of failure_messages sent within the payment intent, so that I may translate them. The pages available in the Stripe Docs don't look up to date (some messages are missing, others are different, etc etc)... anyone have any idea where I may find this info?
Like I said before, the way I have the Products/Prices set is incompatible with Stripe Portal. "For each product, its price must have unique billing intervals."
I get this error when creating a Portal Configuration using my current product/price.
I have 1 product called Agent Plan with 3 prices: Lite, Starter and Pro (each with their features and price)
Using this throws the error. So I need to change what I have.
I will need to have 3 Products: Agent Lite, Agent Starter and Agent Pro. Each of those Products will have only 1 price.
My question is: what happens when a user ends their subscription of their old Lite price in the old Agent plan? Will they be able to go to the Portal and upgrade to the new Produt Agent Lite?
@meager hawk Oh, is there way to check it from my end?
@vocal wagon the docs should be up to date so I don't quite follow. In general you'd usually use our client libraries like stripe.js and they return localised errors by default. If you're handling things manually then you'd look at the code field of the error. The easiest way to understand it is to test your code with the cards from https://stripe.com/docs/testing#cards-responses and expeirment with catching the errors and inspecting the data.
hi @meager hawk i will keep trying then... i am located in italy and my browser is in italian, but I am getting error messages in english. we are using stripe.js and sepcifically the stripe magento integration
@river star not really unfortunately with Connect, it's not easy to debug unfortunately. I know I said you don't need the domain object but maybe try registering again and this time Console.WriteLine(domain.Id) and share that so we can have a look. To answer your other question I'd rather not get into a DM, if you're not comfortable sharing a link to your site then https://support.stripe.com/email can help directly
There isn't a way to list and translate the error messages themselves. Closest you can get it the error codes on https://stripe.com/docs/error-codes
Learn more about common error codes and how to resolve them.
@sick talon ok thank you!
@slender relic Not sure what you mean by "end" but I think the answer is yes
sorry, I can really only suggest simply testing this out in test mode with your specific set up as it's the fastest way to see what's possible
@meager hawk You were correct. The connected account isn't registered correctly before. Now it's working fine. Thank you so much. 🙂
@river star great!
What is mean checkout and element ?
Stripe Checkout is https://stripe.com/payments/checkout (we host the payment flow) and Stripe Elements is https://stripe.com/payments/elements (you create your own payment flow/forms)
I will, thanks.
as i could not understand @hollow prairie properly
i was saying that what charges does a user have to pay when he transfers money from google pay or apple pay into our stripe account
as per stripe documentation they charge 2.9% of amount transferred + 0.30 $ on each successful transaction.
is this applicable on all cases or varies for different cases
The support team would be answer any fee calculations specific to your account via https://support.stripe.com/contact (if the explanations on https://support.stripe.com/questions/pricing-for-apple-pay-with-stripe aren't sufficient)
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.
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.
Is storing the Terminal "ConnectionToken" ok? The docs say short lived but it's not clear what that means.
What would be your reason to store it? Connection tokens are meant to be used immediately.
So let me preface that I'm not doing the actual dev work so it's possible I don't understand but our current flow has a "connect to reader" that has a pause (where it's grabbing the token). I'm trying to determine if "connecting to reader" step needs to happen for every single transaction.
You'd use a ConnectionToken each time you connect a reader to a device/computer. How often you need to do that would depend on your integration. See https://stripe.com/docs/terminal/readers/connecting
Learn what it means to connect your app to a reader.
Regardless, you'd generate one immediately before using it (you'd never store one for later or reuse the same one again)
Thanks @sick talon I'm going to have to do some more research as I may not be using the correct terminology. What we have seems like a poor UX but I don't know enough to understand how to ask the question or what's possible. The link you gave is helpful so thank you.
I am using Private routes with Gatsby (Authenticated) but I can't seem to get my stripe webhooks work from it
app.post('/app/profile', express.json({type: 'application/json'}), (request, response) => {
const event = request.body;
// Handle the event
switch (event.type) {
case 'checkout.session.async_payment_succeeded':
const paymentIntent = event.data.object;
console.log(paymentIntent)
//console.log(`PaymentIntent for ${paymentIntent.amount} was successful!`);
// Then define and call a method to handle the successful payment intent.
// handlePaymentIntentSucceeded(paymentIntent);
break;
case 'checkout.session.async_payment_failed':
const paymentMethod = event.data.object;
console.log(paymentIntent)
// Then define and call a method to handle the successful attachment of a PaymentMethod.
// handlePaymentMethodAttached(paymentMethod);
break;
---
2021-07-16 09:16:50 --> customer.created [evt_1JDrqQDtAqr0NEuGqx2zpzJS]
2021-07-16 09:16:50 <-- [404] POST http://localhost:8000/app/profile [evt_1JDrqQDtAqr0NEuGqx2zpzJS]
2021-07-16 09:16:51 --> customer.updated [evt_1JDrqQDtAqr0NEuGShVhAnue]
2021-07-16 09:16:51 --> checkout.session.completed [evt_1JDrqQDtAqr0NEuG0i2KKQ9r]
2021-07-16 09:16:51 <-- [404] POST http://localhost:8000/app/profile [evt_1JDrqQDtAqr0NEuG0i2KKQ9r]
2021-07-16 09:16:51 <-- [404] POST http://localhost:8000/app/profile [evt_1JDrqQDtAqr0NEuGShVhAnue]
2021-07-16 09:16:51 --> payment_intent.succeeded [evt_1JDrqQDtAqr0NEuGO4u84XSg]
2021-07-16 09:16:51 <-- [404] POST http://localhost:8000/app/profile [evt_1JDrqQDtAqr0NEuGO4u84XSg]
2021-07-16 09:16:52 --> charge.succeeded [evt_1JDrqQDtAqr0NEuGSawdgW9T]
2021-07-16 09:16:52 <-- [404] POST http://localhost:8000/app/profile [evt_1JDrqQDtAqr0NEuGSawdgW9T]
2021-07-16 09:17:16 --> payment_intent.created [evt_1JDrqqDtAqr0NEuGoAkD9PvD]
2021-07-16 09:17:16 <-- [404] POST http://localhost:8000/app/profile [evt_1JDrqqDtAqr0NEuGoAkD9PvD]
Webhooks won't be able to pass and authentication headers and the like.
When creating a Portal Configuration via API, how can we say what Products we want users to be able to pick from?
I'm using PHP and I am doing what the docs state:
https://stripe.com/docs/api/customer_portal/configurations/create?lang=php
The data I'm using is:
'features' => [
//
'subscription_update' => [
'default_allowed_updates' => [
'price',
'promotion_code',
],
'enabled' => true,
'products' => [
[
'prices' => [
'price_XXX',
],
'product' => 'prod_XXX',
],
[
'prices' => [
'price_XXX',
],
'product' => 'prod_XXX',
],
],
'proration_behavior' => 'create_prorations',
],
],
This creates the config but when I visit the page with this config, no plans appear to pick from.
Am I doing anything wrong?
@sick talonalso I love your name, that movie is so good
One of the things you can do on a webhook endpoint is only accept connections from Stripe's IP addresses and verify the signatures when you do get an event. See https://stripe.com/docs/webhooks/best-practices#security for a bunch of security best practices.
What's the request id of that request that you pasted the partial params from? req_xxxxx
I have multiple locations with one reader/terminal per location. Would discoverReaders detect that specific terminal if they're on the same internet connection? Or do I need to specify which location it is at?
For example:
Location A at Terminal A <- works fine
Location B not picking up Terminal B. Is it due to the discoverReader() trying to find terminal A or should it discover B if connection between app+terminal are the same?
I'm simply just using:
const config = { simulated: false};
discoverResult = await terminal.discoverReaders(config);
I don't see any req_xxx. I've used the API to create this config.
Does the bpc_XXX help?
We're using Stripe Terminal in a box office (event ticketing) scenario where personnel on a single device will continually re-use the same reader. Right now we have add to cart, checkout, existing reader is pre-selected from a drop down, click "connect to reader" (terminal.connectReader), "collect payment" (terminal.collectPaymentMethod & terminal.processPayment). With automatic reconnection we can skip the "connect to reader" if the stored serial number matches a discovered reader. Outside of making automatic reconnection happen does that flow make sense? TIA
If the device discovering readers finds an internet-connected reader (assuming you're not specifying a location), it'll list it per https://stripe.com/docs/terminal/readers/fleet-management#discover
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.
Would really be up to you if you want to reconnect to the reader every single time or leave the connection open and only reconnect if it's lost, but makes sense to me.
@sick talon is this up to date?
I don't want to reconnect every time that's the part that stood out to me as poor UX which made me ask about storing the Connection Token. What is the right way to "leave the connection open"?
Almost been a year since last edit. Moreover, I was trying to test webhooks from checkout but it seems to only work for UK? checkout.session.async_payment_failed (NOTE: needs to be run with a UK Stripe account) checkout.session.async_payment_succeeded (NOTE: needs to be run with a UK Stripe account)
Just leave the device connected and if you get an error that it's not connected when you go to use it, reconnect then.
I'd assume it is, are you seeing something inaccurate in your testing?
I am not sure. I am using stripe.redirectToCheckout(...) and I want to get if a payment was successful after the checkout is finished and I am using the webhook endpoints for checkout from the site
Those two would only be for async payment types. Which payment methods are you testing for?
I have my webhooks looking at /app/profile which is a private route, is this bad practice? Should I have my webhooks in the root folder?
Ill describe what Im trying to do
The endpoint uri doesn't really matter as long as it's reachable from our side.
Really if you need to test those two UK-only event types, it's because you're using payment methods that have asyncronous flows from the UK.
It should be using the CLI
If you're using the CLI, the CLI opens a websockets connection and forwards the events locally to wherever you want. In a live mode integration you would stop using the CLI and use a webserver somewhere.
I am not sure how to check if a payment is successful using redirectToCheckout()
That's my main issue, and I thought using the checkout endpoints was how I would test that but it seems not the case.
Basically you set up a webhook endpoint (in test mode you can use the CLI for redirecting to a local endpoint) and watch for the events mentioned in that doc.
I'm attempting to change my account for payment but it's not allowing me to what can I do
:question: @marble bolt 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
Thank you in getting no where with that but I appreciate the response
Hello, can Venmo Mastercards (The Venmo Credit Card) be used with Stripe?
No idea on the Venmo part, but Mastercards is general are fine. The support team can likely answer definitively via 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.
Thanks.
Sorry the late reply. req_uIk0pS48oqxawe
How to connect stripe to my WordPress Website without Woo-Commerce???
@karmic coral hello, you'd have to use some plugin, or use PaymentLinks for a 'no code' integration
@slender relic hello, looking
@slender relic you can specify the Prices / Products that can be switched to here: https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products
Your request isn't passing that parameter
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hey guys, I'm trying to set up a subscription with a 30 day trial at the beginning and a billing cycle starting at the following first day of the month after the trial ends. In the Licensed model it is possible to prorate the time after trial_end to the start of the billing_cycle_anchor, but the model I need to implement is the Metered billing. Here I have the problem that the end of the trial period resets my preset billing cycle. Do you guys have experience with this problem or know about a workaround for it?
How can I use 'no code' Integration?
@karmic coral https://stripe.com/docs/payments/payment-links
Learn how to create a payment page and embed or share a link to it.
Hi there, is there any possibility to set tax reverse charge for a customer when using stripe.checkout.sessions.create to create the customer? So what I want to achieve is that for the customer that is created during the checkout by stripe, tax reverse charge is enabled. How is that possible without first creating the customer using a second API call?
Am I not doing it in this example:
'features' => [
// ...
'subscription_update' => [
'default_allowed_updates' => [
'price',
'promotion_code',
],
'enabled' => true,
'products' => [
[
'prices' => [
'price_XXX',
],
'product' => 'prod_XXX',
],
[
'prices' => [
'price_XXX',
],
'product' => 'prod_XXX',
],
],
'proration_behavior' => 'create_prorations',
],
],
I have there two prices and two products in the features.subscription_update.products
@slender relic you are in this one, the request you linked me wasn't passing this
Thing is, that was taken directly from the code that creates the request (in this case is an update to the config)
Hi, My web server use Classic ASP. It's is possible to use Stripe payments ? And have you help in french language ?
@slender relic gotcha, but the request you sent me wasn't passing a products: hash at all, is what I'm saying. You can look up the request in your dashboard to see what parameters are being passed in the request body
@rotund briar hello, yes I think it should be doable though I'm not experienced with ASP. This channel can help with English
tx, so I will learn english first. Tx
@naive phoenix ah you mean a tax_exempt enum?
Yeah I'm seeing that. But it's weird because the php array has that data in it.
@quaint edge hello, not sure that is supported without resetting the billing cycle anchor, with metered bililng
yeah exactly.
@naive phoenix gotcha, yeah Checkout doesn't support passing through a param like that, you'd have to update the Customer after creation
We are testing our fixed price subscription by changing it's trialEnd date and billingcycleanchor. However, we just realized that once it renews it opens an invoice then waits an hour to pay. https://stripe.com/docs/billing/invoices/subscription Is there anyway to get it to pay faster (at least in the test environment) so we can test renewals faster?
Learn how to manipulate subscription invoices, the basis for recurring charges.
hm, thanks. But if I'm updating the customer after the checkout, he's already charged with the wrong tax. So it seems the only option is to create a customer first which then involves building the whole UI for his details by myself...including the VAT no checks. Is that correct?
@naive phoenix you can create a Customer first yes, then pass that to Checkout
@abstract compass hello, you can manually finalize and pay the Invoice via the API to get it to create a payment
yeah, thanks. That then requires me to build the customer details form by myself which I thought I can avoid. Anyway, thank you!
yeah couldn't find anything in the docs either.. well, then its got to be that way. thanks!
hello - is there a way to show individual line items for a one-time charge? or is the description the only option?
@carmine lintel hello, Charges don't support line items right now
@bold basalt is creating an invoice the only way to use line items?
@carmine lintel yes. Checkout also supports line items and the receipt email shows line items.
Good morning!
@frail wigeon hello
is there an additional fee to use Checkout?
@carmine lintel don't think there is an additional fee
I like the line item/receipt capabilities of Invoices but I see that there will be an additional charge added
I am a walking talking weird tech glitch magnet, I have caused more support people across very big tech to say you did what? wait how did you do that? or just silence! But I am a pastry chef who out of necessity has to learn to do it herself, so please if my questions sound very simple or if you think I should already know, trust this I lost all ego in asking for insight, experience, or any opportunity to learn when I took out my ENTIRE website putting in Bing bot and integrating payments.
Hello Everyone
🙂
I have a question regarding connected accounts
The question is
if I want to know via a web hook or the stripe CLI, if an connected account has the ability to receive pay-outs
which webhook event or API request should i use to find out this information?
my server side code is writen in Python by the way
Hello,
I'm looking to use Stripe Checkout for one time purchases. The issue I'm encountering is automation. What is the best way to pass data over the checkout process and back to my server (PHP) once the purchase is paid?
I'm guessing something involving webhooks
@heady pagoda the account.updated webhook event is what you want to listen to
@compact field you'd implement webhook events and listen to checkout.session.completed event
Awesome thank you! How could I pass custom data over from checkout to be returned in that webhook?
@compact field that webhook event would be sent from Stripe to you, it will contain the whole CheckoutSession object in it. So you don't really "pass" anything from the Checkout page to your webhook endpoint, rather Stripe informs you "here is the Checkout Session that was just paid"
Thank you 🙂
😄
Alrighty, thank you! I definitely love the support here! I've gotten tired of PayPal limiting my account for the 5th time this month. Every time they lift it but its still a pain to deal with.
If I do: stripe.exe listen --forward-to http://localhost/project/stripe/hook , then will I have to test webhook with stripe cli every time?
If I do stripe listen from command line then will I have to do: striple trigger <some-event> from command line too?
Can't I check triggering event from PHP code?
Suppose I have done: stripe.exe listen --forward-to http://localhost/project/stripe/hook , now how can I check the event triggering with code?
@peak flame you can trigger webhook events from your PHP code, you just have to make the requests manually. The trigger command makes those requests for you.
Is the arrival_date for a Payout intended to just be a YYYY-MM-DD date?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@valid hound it is a UTC timestamp
I have been trying for so long but I can't seem to get basic webhooks to work with Gatsby
I am using stripe CLI to trigger the events, is there something wrong with my server code?
Right but looking at the Stripe frontend that date isn't being converted to local time and is just displayed in UTC but just with the date part. It's causing a bit of confusion on our end since we do the time zone conversion by default for these timestamps in our app.
How can I know which event is triggered for a request? For example, which event is triggered for Subsription::create()?
How to know related events for a request?
@bold basalt ?
@valid hound you mean on Dashboard?
@peak flame the docs cover this, but also a subscription creation API request would fire the customer.subscription.created and invoice.created and other events as Subscription and Invoices are created in your account, hence those webhooks would fire
Which docs cover this?
@vocal wagon haven't set up webhooks on Gatsby before but what isn't working? you would have to explain more. Like are webhooks being received but not parsed out? signatures not verified? not hitting your endpoint at all? etc
Can you please give the link of that doc?
@peak flame there's no one "list of all webhooks that happen with X API request" but this doc helps you extrapolate what events are sent depending on how you create Subscriptions: https://stripe.com/docs/billing/subscriptions/overview
Learn how subscriptions work within Stripe.
We are creating a fixe price monthly subscription with free trial. Our goal is to have the user give us payment information before the trial is started, and for subsequent renewal to be charged automatically. However, we are having issues. Per Stripe document, we set the TrialPeriodDays when creating the subscription. Then create a SetupIntent and send the ClientSecret to the frontend JS. Looking at the call backs, it looks like the system automatically creates a subscription with an initial invoice of $0 for the trial, pays it automatically, and activates the subscription - this is all before I have a chance to colllect payment information from the user. How do we prevent that, instead only activate the trial once we have payment from the user?
The above code is what I have for my server.js located in /src/server.js for my gatsby project. Then I am starting gatsby with gatsby develop on the terminal, listening with stripe using the command stripe listen --forward-to localhost:8000 for the local host in another terminal, then triggering events stripe trigger checkout.session.completed in a 3rd terminal
So my hooks aren't even being hit
const express = require('express');
const app = express();
const stripe = require('stripe')(process.env.GATSBY_STRIPE_SECRET_KEY);
app.post('/app/profile', express.json({type: 'application/json'}), (request, response) => {
const event = request.body;
// Handle the event
switch (event.type) {
case 'checkout.session.completed':
const sess = event.data.object;
console.log(sess)
//console.log(`PaymentIntent for ${paymentIntent.amount} was successful!`);
// Then define and call a method to handle the successful payment intent.
// handlePaymentIntentSucceeded(paymentIntent);
break;
default:
// Unexpected event type
console.log(`Unhandled event type ${event.type}.`);
}
// Return a 200 response to acknowledge receipt of the event
response.send();
});
app.listen(8000, () => console.log('Running on port 8000'));
WebSocket network error: The operation couldn’t be completed. Connection refused
Failed to load resource: Could not connect to the server.
@bold basalt
@abstract compass you create a Subscription with a trial, it'll have a pending_setup_intent . You then use the pending_setup_intent to collect a customer's card. If you don't the Subscription will never actually start cause there's no card to charge after the payment is over.
The alternative is you collect a Customer's card via a SetupIntent first, then create the Subscription.
hey man, I was looking at it... but it is not available on "invoice.payment_succeeded" event... why did you referred it to me? am I missing something?
@thorn bone can you link me the event ID
@vocal wagon where is the websocket error coming from? is that your gatsby page/endpoint not starting up?
man, please ignore.. I was loooking into the wrong event.. Im sorry 😉
@thorn bone yep it is there, you manually paid the Invoice so billing_reason: manual
@vocal wagon yeah so theres some issue there, doesn't look like your server is even starting, so it isn't related to webhook events for now, from the looks of it. I don't know enough about Gatsby so can't help you troubleshoot that but you'd have to look online to StackOverflow etc on how you'd get your Gatsby project up and running
Sounds good, thanks
Right, on the dashboard.
In your dashboard settings, what timezone do you have set? (https://dashboard.stripe.com/settings/account)
US-Mountain (-6), this is for connected accounts also. Not sure if the displayed dates when you're viewing a connected account changes depending on that setting.
But, for example, there's a payout with an arrival_date of 1626307200. Stripe displays that as Jul 15 on the dashboard. We have a simple dashboard for our connected account users except we're doing time zone conversion to local (since that's just what JavaScript does by default). So we end up displaying that as Jul 14 which actually is incorrect according to Stripe. Just seems weird that Stripe has that as a unix timestamp but doesn't do the time zone conversion just for this one field.
You mind sending over that payout ID? I think I have a vague sense of going on, but what want to take a look to confirm
po_1JD7XoQnusORJZPIpEuQbzKX
Ah, I think I understand the confusion here (and I'm sorry this isn't well documented). They key thing is that arrival_date is just a date, and shouldn't be considered as an accurate timestamp for the time a payout should arrive (because we have no idea what that could be on our end). So in your example, the arrival_date is 1626307200 which is midnight Jul 15 (in UTC time) which means the payouts is expected to arrive sometime on that day. There isn't any need for you to translate this timestamp back into your own timezone.
Does that make sense? (I know it's a bit weird)
I posted this in the wrong channel:
hey! I am a college undergrad who is creating an app startup with a couple of friends. Learn more about it a @ https://pik.farm/. I was wondering if we could talk to anyone who has some experience with stripe and take them through our custom stripe integration. It would help us a lot to get some feedback as to how it can improve and be more scalable. We need help specifically with how to best implement webhooks into our current infrastructure.
Yeah makes sense, docs are definitely confusing on it. But we can handle this case pretty easily. Just wanted confirmation that it is supposed to be just a date.
If you have specific technical/developer questions about Stripe you're welcome to ask here, but if you're looking for someone to take a deeper look at your integration it may be more helpful for you to go through support https://support.stripe.com/contact
I am working to provide a predicted stripe-conect payment for the coming month to help manage expectations of our executives.
I can see "Gross Volume" under the Connect Reports in the portal. I can even navigate through to see the payments that make up that gross volume in the connected accounts in the portal. I know I can multiply our gross volume by our revshare terms to get a predicted payment for the upcoming month.
What I can't seem to do is access those charges on connected accounts via the API.
To restate - I am trying to access transaction details that are not on the account I have credentials for, but on all of the connected accounts to that account. Specifically I am trying to recreate the number (and hopefully the detail behind) the "Gross Volume" report on https://dashboard.stripe.com/connect/overview.
Can anyone point me in the right direction?
What have you tried so far? Have you tried listing all charges (https://stripe.com/docs/api/charges/list) and specifying Stripe-Account in order to retrieve the charges on a specific connect account?
I started just trying to get to a specific charge through this method https://stripe.com/docs/api/charges/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.
but the response says that charge does not exist
Gotcha - and when you were retrieving the charge, did you specify the connected account in the Stripe-Account header (see https://stripe.com/docs/connect/authentication#stripe-account-header)
How do I disable this "Invoice was finalized and automatically marked as paid because the amount due was $0.00"
Im trying to collect payment method on a 30-day free trial
That's not something you can disable. Is this in the context of a subscription? Are you integrating with Checkout or with a custom payment form?
It is a subscription and I am doing it manually through stripe
I am trying to collect payment via the stripe invoice
They will have to add payment after the 30 day trial via reminder email?
Gotcha - unfortunately, that's just not something that's supported. If the invoice is $0, then we mark it automatically as paid and the customer can't provide a payment method through the hosted invoice page. If you want to be sure to collect a payment for a trialing subscription upon creation you would need to do so through Stripe Checkout or through Elements. Otherwise you would need to wait until the first non-zero invoice for a user to be able to give their payment info
Great thanks. I will look into the check out feature
the payment links is the way to go
totally forgot to mention payment links! Yes, that would be a great option for you given what you've described 👍
Hello, and thanks once again for the Q&A yesterday! I'm wondering since Stripe RN doesn't support web deployment, what are the thoughts on using React Native Webview as a workaround so the app can be deployed on web/ios/android? I found this article talking talking about it, not sure if it breaks any rules or what not...
https://dev.to/impdp/stripe-card-payment-in-react-native-without-3p-library-3l49
UPDATE Stripe released an official library for react-native. check this out - https://github.com/str...
@kind python I deleted your most recent message because your code includes your test secret key - I'd suggest rolling it when you get the chance.
Can you provide more details on what specifically isn't working? Are you seeing an error? At what point is the flow broken?
When I click the Submit Payment button I get this error: client.js:35 Uncaught ReferenceError: clientSecret is not defined at HTMLFormElement.<anonymous> (client.js:35) at e._formSubmit ((index):1) at (index):1 at (index):1 at Array.forEach (<anonymous>) at n._emit ((index):1) at e._handleMessage ((index):1) at e._handleMessage ((index):1) at (index):1
I was getting help from alex-stripe, orakaro, and Paul but they all had to go
It sounds like your request to your backend is not successful - are you seeing the request come through to your backend correctly?
Hello! I'm not great at react native, but let me see what i can find
Ya I believe so also the clientSecret won't pass
So you need to look into your backend/server and see why the request isn't successful.
Ok
I can't figure out what's wrong I think it's with the routing could you take a look and tell me how to fix it as I can't find how to do it?
@dim hearth Are you still here?
You really need to be looking at your own code and adding breakpoints or log lines to understand what's going wrong - I have no access to your logs. If you give me specifics on what errors you're seeing I can help
app.get('/secret', async (req, res) => { const paymentIntent = await stripe.paymentIntents.create({ amount: 1099, currency: 'usd', // Verify your integration in this guide by including this parameter metadata: {integration_check: 'accept_a_payment'}, }); res.json({client_secret: paymentIntent.client_secret}); }); this code is creating a paymentIntent correct?'
Yes that code looks fine to me from a quick glance, but have you checked your server logs to see if there are any errors you're seeing?
Yes I am receiving clientSecret not defined
var response = fetch('/secret').then(function(response) { return response.json(); }).then(function(responseJson) { var clientSecret = responseJson.client_secret; // Render the form to collect payment details, then // call stripe.confirmCardPayment() with the client secret. }); isn't this code getting the secret this is in my clent.js
That's the error coming from your front-end, not your backend.
ok how would I fix that?>
<form id="payment-form" data-secret="{{ client_secret }}"> in the {{ cleint_secret }} is something wrong?
Again, instead of looking at your front-end logs you should check your server logs. This can be any number of things - it may be that the request is never even reaching your server (maybe wrong endpoint), or your server is not correctly set up, or maybe it's your actual request to Stripe that isn't successful. You'll be able to know more from your server logs. Just pasting code isn't enough to know what's wrong without getting more details
You should check repl's documentation for more information on where to get your server logs
Are server logs my errors?
A good first step would be to look at the AJAX request from your server in your browser's network developer tools
In Chrome that's under the Network tab in the developer tools
You'll be able to see whether the request to your server failed, and if not, what the response was
This is what I see in the network tab
And clicking on it shows this:
How to fix this
@kind python The URL that you're using for your fetch() call is wrong. You'll need to consult the replit documentation for how to make that access a correct URL
I just checked the documentation it is correct https://replit.com/talk/learn/JS-Fetch-API-Tutorial/48837
, the modern way to make HTTP requests in Javascript . There are many ways to make your HTTP requests like using XHR however, some of them aren't as simple as . Today, we'll be discussing how to use for AJAX/HTTP requests. Overview: fetch( reqLink , options* :optional*) The options argument should be an object/JSON data-type. The reqLi...
I don't think it's creationg the '/secret' properly
So, I decided to try to collect a customer's card via a SetupIntent before creating the subscirption. It seems to work ok for trial subscription. But we also have some subscriptions without trial. For those, it seems that the subscription that's created has an open-invoice that isn't paid automatically (we are trying to use the same flow/process for both types of subscription). What can I do to auto pay that invoice?
How are you creating your subscriptions? Can you go into a bit more detail about your flow?
Do webhooks trigger if in test mode for checkout?
Yes, they should still trigger in test mode
huh interesting. I haven't seen anything
What specific event are you expecting? I can take a look if you send over the checkout session ID
I think I've figured it out
I didn't have the "viewing test data" slider on that page enabled
So I didn't create a test webhook
only a live one
We are doing fix-price subscriptions. Most of our subscriptions have trial period, a few don't. We also don't want to let a user start a trial subscription unless we have payment in place (to make sure we can auto-charge when the user transitions from trial->pay). You can see the various challenges we faced along the way in our discord threads. To make it work, we tweaked the stock Stripe example to: Create Customer -> When user selects price a price, system creates a SetupIntent and redirect user to subscribe page -> User enters credit card info for SetupIntent-> Server then 1) attach the payment as default on the customer, 2) create the new subscription using the price selected earlier. We are hoping this would then allow the subscription to auto charge regardless of trial/no-trial.
We are doing fix-price subscriptions. Most of our subscriptions have trial period, a few don't. We also don't want to let a user start a trial subscription unless we have payment in place (to make sure we can auto-charge when the user transitions from trial->pay). You can see the various challenges we faced along the way in our discord threads. To make it work, we tweaked the stock Stripe example to: Create Customer -> When user selects price a price, system creates a SetupIntent and redirect user to subscribe page -> User enters credit card info for SetupIntent-> Server then 1) attach the payment as default on the customer, 2) create the new subscription using the price selected earlier. We are hoping this would then allow the subscription to auto charge regardless of trial/no-trial.
When creating your subscription, what are you setting as payment_behavior
We kept PaymentBehavior = "default_incomplete" from the Stripe example.
Gotcha, so default_incomplete works under the assumption that you will be explicitly confirming the first payment if the first invoice requires payment. If you don't want this behavior and want payment to be attempted on the subscription automatically (without the explicit call to confirm) then you should use payment_behavior: allow_incomplete.
Got it. I'll give that a try. I was also trying to see if I can pay the open invoice programmatically. But I think this should be safer?
Yeah, you could choose to leave your payment_behavior the same and then confirm the underlying payment intent on the invoice (https://stripe.com/docs/api/payment_intents/confirm) if you wanted to. Either one will work!
I have a setup where a customer with a Connected Account can pay for a transaction partially via their Connected Account balance (using a Charge) and partially via a processed card / PaymentIntent; is there any way for this setup to also take advantage of the source_transaction feature of separate charges and transfers to make sure this payment is then forwarded on to a different Connected Account as a single transaction? (I.E. if the Charge succeeds immediately but the card PaymentIntent becomes available a few days later, to make a single Transfer at the later point in time?)
This might be something that just requires an external scheduler / webhook to do, but I was curious if there's any kind of native functionality to tie multiple charges to one transfer via source_transaction.
a customer with a Connected Account can pay for a transaction partially via their Connected Account balance
Which API are you using to do this? Connect account debits, something else? Do you have an example charge object id?
What does the webhook return? JSON data?
I'm attempting to read it in PHP with $_POST but its returning nothing
Sample:
66 charge = await stripe.charges.create({
67 amount: amountToChargeStripe,
68 source: stripeAccountId,
69 currency: 'usd'
70 });
stripe.charges.create to debit the connected account.
The PHP example on https://stripe.com/docs/webhooks/build shows how to parse the payload
Write the code that properly handles webhook notifications.
thanks!
OK, yep that's account debits (https://stripe.com/docs/connect/account-debits). There isn't any way I'm aware of to use source_transaction to combine a normal Charge with an AccountDebit Charge and transfer them together. You'd have to do that manually (wait for the normal Charge's balance to become available and then transfer both amounts together.
I thought as much; thanks.
I just tried changing to payment_behavior: allow_incomplete and it seems to be working with the standard test card! However, when I use the SCA testing, then it seems to leave the invoice open. Is there something I should do there?
Which SCA test card are you using?
The default 4000002500003155 and I selected authorize in the popup.
Hi, I have a quick question please. Can anyone recommend me the quickest possible way to integrate a bookings and payment system please?
ok, and are you setting that card up with a SetupIntent before you try to charge it?
Would it be recommended to use one of stripes 3rd party partners?
The support team can advise on the best way to model your business via https://support.stripe.com/contact and if you have specific technical questions when implementing, we can help here with those.
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.
Thank you
Thank you very much for your help
Yes, our process is we capture the card information against a setupIntent. Only after our server receives the paymentMethodID from the client does it 1) set that payment method as default on the customer, 2) create the subscription. Looking at the invoice, I see that it thinks that it needs additional authentication. But I have already clicked on "authorize" on the popup that shows up.
Are you passing off_session: true when paying the invoice programatically (or when creating the Subscription)?
That's required to use the setup details on a payment that requires 3DS
No, I am not setting it. But I was looking at the setup intent, and I think that's the default? https://stripe.com/docs/payments/setup-intents#increasing-success-rate-by-specifying-usage
Learn more about the Setup Intents API for saving payment methods.
You have to specify that you want to pay off_session though when creating the Subscription, as well: https://stripe.com/docs/api/subscriptions/create#create_subscription-off_session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I am assuming that if I set it to off_session, I can still charge whether the user is on or off session? Let me try.
I just tried setting off_session on the Subscription. It was able to pay the first month's charge automatically. But upon renewal, I get a invoice.payment_failed in the wobHook. Here is the eventID evt_1JDy5GHHxiXor07s1pKlTq3W This is puzzling.
You need to pass off_session: true when updating the Subscription, too. Literally every time you make a change that generates a new payment/invoice, you need to specify if it's off session, or we'll assume it's on session.
Trying to add the Payment Request Button to show for users instead of the Elements Form but we cant get any of the Wallet buttons to show up in our testing environments. Are we missing something other than whats documented here? https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=react
Collect payment and address information from customers who use Apple Pay, Google Pay, and browser-saved cards with Payment Request APIs such as Microsoft Pay on Edge.
@wispy zinc lets start here, can you send me your account ID?
And do you see the PaymentReqeuestButton on that page you linked above?
I'll give that a try. But I want to confirm, once we go into production, our server won't be updating the subscription at all once it's initially setup. Would it charge correctly in that case?
@abstract compass one sec looking
Also I think it's going to be tricky for us to always remember to set that off_session flag. For robustness, is there a way we can still force it to process when we see the failed payment?
Hopefully quick question: is there any way to top up a platform balance such that the funds are available more quickly than the ~week turnaround? I've noticed in testing that debiting connected accounts pushes funds to 'available' almost immediately, but both standard payment processing and top-ups have a significant waiting period.
Well this is a bummer lol. What's the best approach around this? Context:
i'm using connect and using direct charges for connected accounts using the Stripe-Account header set to the connect account ID
This is a test card that was turned into a payment method id using the stripe iOS SDK using my API keys.
I read up on cloning customers etc. but why do test cards require customers created? it's supposed to be a one off payment method not being saved for future use.
Is this simply because I used my platforms API keys to create the payment method and not the connected account header to create the payment method? If so then im unsure of how to pass the connect header to the iOS SDK.
Any help would be appreciated 🙂
@rapid imp one sec
@cloud river hello, not sure there is, maybe Support knows more about that
@rapid imp ok so there's a lot here but ultimately, this is a misconfiguration of API keys <> Stripe Account IDs
to answer:
but why do test cards require customers created?
they don't for cloning, you don't need to attach to Customer, you can clone a PaymentMethod to a PaymetnMethod directly too
If so then im unsure of how to pass the connect header to the iOS SDK.
are you using STPPaymentHandler? I assume this is the issue, that your STPAPIClient doesn't have the stripeAccount ID set to it when confirming a PaymentIntent
Hey guys, I'm just posting this again in case it got burried... hoping the team can provide some guidance: I'm wondering since Stripe RN doesn't support web deployment, what are the thoughts on using React Native Webview as a workaround so the app can be deployed on web/ios/android? I found this article talking talking about it, not sure if it breaks any rules or what not...
https://dev.to/impdp/stripe-card-payment-in-react-native-without-3p-library-3l49
UPDATE Stripe released an official library for react-native. check this out - https://github.com/str...
hello and happy Friday! Does Stripe offer ACH Debit in Canada?
@worldly python hello, yes you could do that
@somber sundial hello, I don't think so but Support would be the best team for that question
@bold basalt
Let me be more clear with the flow
- Payment method is being created in IOS without a
StripeCustomer(one off) from card details - After the payment method has been created locally using the iOS SDK, i then send that
pm_1234to my server to create a payment intent directly
let stripe = req.stripe
// Specify the business owners stripe account to create a direct charge.
stripe.paymentIntents.headers.add(name: "Stripe-Account", value: businessOwnerConnectAccount)
return stripe.paymentIntents.create(amount: total,
currency: .usd,
confirm: true,
confirmationMethod: .automatic,
errorOnRequiresAction: true,
paymentMethod: "pm_1234",
expand: ["payment_method"])
And i'm using STPAPIClient.shared.createPaymentMethod(with: STPPaymentMethodParams(...) then passing that response to the server in step 2.
@rapid imp sure, yeah laying out the steps clearly will help
Never saw a place to pass the businessOwnerConnectAccountID. when creating a PaymentMethod with the iOS SDK
@rapid imp how are you confirming your PaymentIntent? using STPPaymentHandler I presume?
@rapid imp ok one sec. At which API call are you getting that iOS error? The server-side stuff is irrelevant there right, the error is on your iOS client
@rapid imp I get the first parts of
1/ create a PaymentMethod
2/ send it to server, create and confirm a PaymentIntent
I'm assuming there are steps after that
Nope that's all that's happening. Some DB operations server side but no more stripe API calls at all
@rapid imp where is this error happening then? the screenshot you shared, that looks like it is from your iOS app...
Yea its from a custom alert but im pretty confident it's happening server side.
That string is passed back from server
the paymentintent.create call
@rapid imp ah that makes it simple
@rapid imp you aren't cloning the PaymentMethod then
But since this is Direct Charges, why don't you create the PaymentMethod directly on the Connect account?
You can do that directly from your iOS app
@rapid imp haha no you're not blind, easy to miss
Set stripeAccount on your STPAPIClient singleton: https://stripe.dev/stripe-ios/docs/Classes/STPAPIClient.html#/c:@M@Stripe@objc(cs)STPAPIClient(py)stripeAccount
can we do a private chat with @fresh burrow? I am the dev and he is the PM on the project
👋
@wispy zinc do you mean a private chat with me and dev/PM?
@split sparrow account related questions are answered by Stripe Support at https://support.stripe.com/contact. For context, this channel can help if you have a coding/technical integration related question with Stripe's API.
It works! Thanks so much, Stripe Discord is the best thing to happen all year. This woulda taken like 4 days via twitter DMs 😅
@rapid imp glad to help! yeah it is great to just bounce ideas/suggestions back/forth like that
@rapid imp also I think you meant me? or did you mean the other user lol
Ooof yea
@bold basalt yes
@wispy zinc lets continue here, I'll be able to unblock you here just fine, we won't be discussing any private info anyways.
@bold basalt ok sounds good, let us get the account ID real quick. And I cant see the PaymentRequestButton on the Stripe page I linked. I only see the image of them at the top
@wispy zinc let's start with this:
1/ https://stripe.com/docs/stripe-js/elements/payment-request-button on this page, are you able to see Google or Apple Pay in Chrome and Safari respectively?
2/ what is your account ID? (that way I can look up Apple Pay domain registration)
Collect payment and address information from customers who use Apple Pay, Google Pay, and browser-saved cards with Payment Request APIs such as Microsoft Pay on Edge.
we know the Apple Pay domain registration isn't working yet - we are working with Stripe support for that too via email
@fresh burrow ok so are we only referring to the Google Pay button then for now? (not showing up)?
@bold basalt yes Gpay and Microsoft Pay
@wispy zinc ok so I am not entirely sure about Microsoft Pay as I haven't tried it out on PaymentRequest Button but can help with GPay
do you know the answer to 1/ above? do you see GPay button on our docs there?
@wispy zinc that alone will tell us if your Chrome browser is set up correctly or not
@bold basalt nope, I do not
where on the page would the buttons show up?
@wispy zinc right between the title and the "HTML+JS / React" tabs
@fresh burrow ^ , so almost at the top of the page
@fresh burrow @wispy zinc there^
ya i see it on my personal device
@bold basalt Same here, I see it on my personal device but not on my work machine
@fresh burrow so that means your Chrome browser that doesn't see it, isn't set up for GPay correctly, it can be a bit complex for "why" it isn't (as I've discovered over the years)
1/ check pay.google.com and verify you have > 1 card added there
@bold basalt yea i think there's some complexity there - we're not allowed to set up payments accounts on work computer at the moment.. so the experience won't even load if it doesn't sense a wallet is available / set up?
@fresh burrow ahh yes that is expected then, PaymentRequest Button only shows Google Pay as an option if you're set up for it, i.e. you have a card in your wallet and are logged into the browser
@fresh burrow so I would just test your PaymentRequest Button integration with your personal devices, as long as you're using test mode API keys, there will never be a charge
@bold basalt ok follow up question - Damir is able to see the Google Pay button on the (Stripe docs) page with his personal device, but when we use his personal device in lower environment with our integration, the google pay experience isn't loading in Chrome. We were able to set up domain registration for Apple Pay in lower environment, and that experience did load for Damir. So, it seems like something wonky is happening specifically with Google Pay now.
@fresh burrow couple of qs:
1/ what do you mean by lower environment?
2/ "the google pay experience isn't loading in Chrome" -> the button shows up and the payment sheet doesn't work? something else? do you have the page up where I can try it out?
@bold basalt we have 3 environments, SIT (For developers), UAT (For testing/staging), prod (for customers). we now see Apple Pay in UAT but not Google Pay
@fresh burrow lower then means UAT? sorry wasn't clear
@bold basalt ah yes, lower means UAT
@fresh burrow ok, could you answer my other questions above too? I need as much detail as you can provide
referring to
2/ "the google pay experience isn't loading in Chrome" -> the button shows up and the payment sheet doesn't work? something else? do you have the page up where I can try it out?
@bold basalt sorry - we don't see anything for Google Pay. just loads the standard form for manual entry
@bold basalt Damir can share credentials with you in a DM
ok yeah DM is fine for that
Awesome, incoming
@wispy zinc give me a sec, looking
is there anyone to help me out on laravel stripe integrations
i have done this
but i cant see the payment in my stripe dashboard
Are you getting back any errors when you create the charge? Do you have a source or charge object ID I can take a look at?
@wispy zinc and @fresh burrow responded in DM with screenshot but works for me and shows the GPay payment sheet (and obv button too) as expected
Hey 👋 hope you are doing well.
Got a question regarding invoice items: Do invoice items that are created with a subscription id get automatically deleted if the subscription is canceled at the end of the billing period? I noticed that it removes it when canceling it immediately but I'm not sure about what it does if canceled at the end of the period. Thanks for your time
Where are you looking for it? And do you mind just putting that charge ID in a message here (not as a screenshot)
Are you asking whether an invoice is generated for a subscription that is cancelled at the end of a period?
its basically return json