#dev-help

1 messages ยท Page 126 of 1

languid tulip
#

Can you send me an example invoice ID?

vocal wagon
exotic rain
#

while setting proration behaviour to NONE, getting this error:
The method setProrationBehavior(SubscriptionScheduleUpdateParams.Phase.ProrationBehavior) in the type SubscriptionScheduleUpdateParams.Phase.Builder is not applicable for the arguments (SubscriptionScheduleUpdateParams.ProrationBehavior)

dry hatch
#

You want SubscriptionUpdateParams, not SubscriptionScheduleUpdateParams

#
.setProrationBehavior(SubscriptionUpdateParams.ProrationBehavior.NONE)
languid tulip
exotic rain
dry hatch
#

is that a new error or the same one?

#

Ah I see you are updating SubscriptionSchedule hence the code looks a bit different. How about jumping in that function .setProrationBehavior()and check its signature for parameter?

exotic rain
dry hatch
#

yes, sorry!

exotic rain
dry hatch
#

The error says

dry hatch
#

setProrationBehavior(SubscriptionScheduleUpdateParams.Phase.ProrationBehavior)

#

Guess you figured it out

exotic rain
#

yes i didn't add phase

dry hatch
#

glad it is resolved!

exotic rain
boreal otter
#

i am having some issues with stripe

#

and integrating it into whmcs

#

i keep getting this error

#

and logs dont seem the help much

#

i am new to stripe so if anyone could tell me what is wrong that would we excellent

summer prairie
#

Hello team! In stripe-react-native is it possible to separate the number, expiry date and cvc fields in different inputs, just like you can do in stripe.js. Thanks!!!

dry hatch
# boreal otter i keep getting this error

Are you using test mode and using test card information? You can file a support ticket at https://support.stripe.com/ and we can look into it further

boreal otter
#

i am using live mode and a read card

dry hatch
#

Did the integration go well in test mode?

boreal otter
#

yeah

#

100% worked in test mode

dry hatch
#

okie, and it doesn't show any failed request in your logs? Hmm

boreal otter
#

i mean there were some failed requests in the logs but i contacted NameHero (my host im using) about it

#

this what the error looked like

dry hatch
#

That error states that a webhook needs a HTTPS domain, not HTTP. You will need to have one to set for Stripe webhook.

#

I am not sure it caused the error in whmcs's UI, you can contact them asking for more detail

boreal otter
#

apparently it is a "payment gateway misconfiguration error"

#

but i will contact whmcs

dry hatch
#

Yes, the hosting site won't know much as whmcs. But in the end, you will still need an HTTPS endpoint for setting up webhook anyway, so make sure you prepare one.

boreal otter
#

Yeah i have done that

#

i contacted whmcs thanks for the help

dire dagger
#

hi

hollow prairie
#

@dire dagger Hey!

vocal wagon
summer prairie
hollow prairie
#

@vocal wagon Seems like they already have support for Stripe payments. What are you asking specifically?

vocal wagon
hollow prairie
pine sky
#

Hi Everyone!

#

newbie here.

#

question: Where should I post my question? ๐Ÿ˜„

hollow prairie
#

@vocal wagon Ah, gotcha! There's no specific plan to per se, you'd just provide the required Stripe keys to the plugin and you'd begin accepting payments. Stripe pricing can be found here: http://stripe.com/pricing

#

@pine sky Hello! Happy to help, ask away

vocal wagon
#

ok thanks

pine sky
#

I tried to add discounts to Stripe Checkout but when I add it, it seems its not working.

north ether
#

Hi there @hollow prairie, I'm having issues with confirming payments when using the android stripe SDK with google pay.
In particular, the call to client.confirmPayment(fragment, confirmPaymentInentParams) is logging a 200 response but
the payments are not being marked as approved in the console (test environment).

pine sky
#

I tried to follow this from the documentation but the response from the create session is this:

hollow prairie
#

@north ether Hello! Do you have a PaymentIntent ID I can look at?

pine sky
proven wharf
#

Hello, I am using setup intents to add cards/sepa accounts to my customers to charge them once a month. If the user didn't use a setup intent, are we supposed to create new ones or should I store existing setup intents that were not used yet? I am just wondering, because currently when a user reloads the page a new setup intent gets created and the old one was not used. I could store the old one to return the same intent id and not create a new one, but I am not sure if this would be the correct way. Any help is appreciated, thanks ๐Ÿ™‚

north ether
hollow prairie
#

@north ether Thanks, taking a look

pine sky
#

@hollow prairie here is the ID: cs_test_b1BAlUAHchPkeORc8PL2tbxmYYG16KbHbhdTqL9B9ecL55rXVPXXzA5Qoz

north ether
hollow prairie
#

@north ether There's no payment method attached to the PI, which is why you'll see status: "requires_payment_method" on the PI object

north ether
#

right. and that's something we should be setting in the ConfirmPaymentIntentParams when we call stripeClient.confirm?

hollow prairie
north ether
pine sky
#

let me double check @hollow prairie .

hollow prairie
#

@pine sky What is Stripe.createSession? Looks like your own custom function that wraps our Node client?

north ether
pine sky
#

Thanks @hollow prairie for the quick help!

hollow prairie
#

@proven wharf Hmm, you don't really re-use a SetupIntent. They're used to setup card usage for future payments by saving payment data to a customer

#

@north ether In that case, I'm not sure why you're calling confirmPayment. Sorry not overly familiar with our Android SDK!

north ether
hollow prairie
#

@north ether Potentially! The PaymentIntent you shared earlier only had a single HTTP request associated with it (creation)

proven wharf
# hollow prairie <@!118746147434135552> Hmm, you don't really re-use a SetupIntent. They're used ...

Yes, currently my customer visits a site, for example /onboarding/payment and it creates the setup intent as soon as visiting. Now it might happen that the customer does not fill out the forms or reloads the site. In which case currently he would trigger the setup intent creation again and the forms use the new setup intent, while the old one was never used. My question is just if it's okay that way or if I should store the id of the first setup intent and the form should us the existing one on reload

north ether
hollow prairie
#

@proven wharf Ah, gotcha! Yeah we advised against storing them for use later on as they may have expired when you come to confirm them. This is mentioned here:

Also, donโ€™t maintain long-lived, unhandled SetupIntents as they may no longer be valid

https://stripe.com/docs/payments/save-and-reuse

hollow prairie
#

@proven wharf So if creation happens on page load as opposed to form submission, then they're safe to just discard I guess

#

@north ether Yep, that's the recommended workflow. But as I said, I'm not sure confirmPayment is applicable in the case of Google Pay

north ether
# hollow prairie <@!691373164952944762> Yep, that's the recommended workflow. But as I said, I'm ...

Hi - it looks like the instructions on this page(https://stripe.com/docs/google-pay) have changed - potentially in the last 24hrs or something? the steps I followed look like this(https://web.archive.org/web/20210508031140/https://stripe.com/docs/google-pay) - that's an archive link from may this year, but it looks exactly like the steps I was looking at even yesterday

north ether
hollow prairie
analog mantle
#

Hi. I'd appreciate a steer regarding the approach to use to charge a customer and capture the charge later - car hire use case. Seems there are two approaches - using payment intents as per this example https://stripe.com/docs/payments/capture-later or to use the Charge object https://stripe.com/docs/api/charges/object It seems that the charges API is older than the payment intents API, is that the case?

hollow prairie
#

@analog mantle Hey there. Yes, we'd advised against using the Charges API in any integrations now with the enforcement of SCA rolling out across Europe. The first doc you linked is an up-to-date workflow for the auth and capture integration ๐Ÿ‘

warm dust
#

Hi, Im currently working with Stripe API with Unity. When I try to make a connection I get this error. Does anyone know the way to solve it?

Thanks!

hollow prairie
#

@warm dust Hello! Looks like one of your Stripe key is hardcoded directly into the source code of your integration. Are you familiar with environment variables?

proven wharf
#

When adding a payment method via the setup intent and visiting the stripe control panel --> customer it shows the payment method but when clicking on Actions --> Create payment it's greyed out and says "To create a payment, please add a payment method to this customer that can be charged." โ€“โ€“ what exactly is missing?

hollow prairie
north ether
hollow prairie
#

@proven wharf Can you share the ID of the SetupIntent or the Customer object?

proven wharf
hollow prairie
#

@north ether These new APIs are new to me too I'm afraid, that doc has the most context for a full Google Pay payment flow on Android

#

@proven wharf Thanks, looking!

#

@proven wharf

Actions --> Create payment
Is this in our Dashboard?

vocal wagon
#

Hi everyone.

hollow prairie
#

@proven wharf Oh, cool! That's a pretty new feature. First time I've seen it ๐Ÿ™‚

#

@vocal wagon Hey!

vocal wagon
#

session with paymentIntent options all set.

#

Any clue where this error is coming from?

slender wharf
#

Nice to meet you. My name is daichi.
I am building to send a request to aws lambda with webhook with api gateway.

I am sending money to my connect account by transfer when the payment is made, but the money is not sent.

No error is displayed in the cloud watch log.

If you know the cause, please help.

vocal wagon
#

Hello

slender wharf
#

this is webhook code

hollow prairie
#

@vocal wagon Can you share the Checkout Session ID or a request ID to create the Session?

proven wharf
vocal wagon
hollow prairie
proven wharf
dry hatch
vocal wagon
#

Can I clone an existing payment method from a stripe account to another one ? I don't have a connected account yet.

hollow prairie
slender wharf
hollow prairie
vocal wagon
#

@hollow prairie I have to create them for the connected account, or can I create the payment method from a stripe account, then send it to the connected account to be available for the other stripe account ?

hollow prairie
#

@vocal wagon Is there a specific error you can share? Can you narrowed it down to a specific part of your integration code that I can see? Nothing jumps out from that Checkout Session you shared

#

@vocal wagon You would create the Payment Method on a platform account and clone it to connected accounts(s) as per the document. But there must be an existing connection between those 2 accounts

vocal wagon
#

@hollow prairie How to create the connection between the 2 accounts ?

hollow prairie
#

@vocal wagon This is not really valid if you're not wanting to use Connect though. Why exactly do you need to clone Payment Method data?

dry hatch
slender wharf
vocal wagon
#

@hollow prairie The ownership of the 2 accounts is different (not same linked bank account). After a certain delay, a customer (and its payment methods) have to move from a stripe account to another one.

slender wharf
vocal wagon
#

@hollow prairie the second stripe account is actually a debt collection account.

analog mantle
vocal wagon
#

I tried to handle Giropay redirect manually,after submitted the payment intent and got the url from the next_action ,opened the url in browser, and then closed the browser tap before finishing the payment. Next, I tried to open the same url again, then I got an timeout message in German: DIE WARTEZEIT IST ABGELAUFEN . So, is the giropay redirect url a one-time thing. Anyone know about it.

hollow prairie
dry hatch
hollow prairie
#

@vocal wagon Can your share your code from that file (dmxStripe.js)?

#

@vocal wagon Do you have a PaymentIntent ID I can look at? pi_xxx

slender wharf
vocal wagon
slender wharf
#

@dry hatch
I have tried many times and have output a query for stripe.transfers.create.

hollow prairie
vocal wagon
hollow prairie
#

@vocal wagon Thanks checking now

dry hatch
vocal wagon
#

@hollow prairie I have to do it one time ? It's not really a M2M API

dry hatch
#

I also noticed there are some successful transfer requests, ex: req_sWn5ExS7EAALST

slender wharf
slender wharf
#

@dry hatch

#

I'm leaving my seat a little, so my reply will be delayed.
sorry

dry hatch
#

np, I will also come back a bit later

vocal wagon
#

@hollow prairie there is not a simpler API to connect 2 stripe accounts ? I don't want to integrate another PSP, just copy payment method between stripe accounts.

hollow prairie
#

@vocal wagon Yep, because payment authentication failed (I guess because the auth flow was existed), the payment method has been detached from the PaymentIntent (hence status: "requires_payment_method"). You need to provide the payment method again with confirmGiroPayment: https://stripe.com/docs/js/payment_intents/confirm_giropay_payment

#

@vocal wagon I'm afraid not, no

vocal wagon
#

I don't really understand the process.

hollow prairie
#

@vocal wagon What part don't you understand?

vocal wagon
#

STEP 1. Create a connected account on both stripe account ? stripe.Account.create(...)

vocal wagon
hollow prairie
#

@vocal wagon You don't need to create an account as you already have the accounts.

  1. You'd create an OAuth link as the platform account (where your customers/payment methods currently exist). Using the doc I linked.
  2. The account where you want to clone the customer to (the connected account) then clicks the link and completes the steps.
  3. The connected account is then redirected back to the site where they clicked the button.
  4. The platform account confirms the connection using the returned token.
#

@vocal wagon Yep, it is a one-time thing which is why its expired. You've used it, the auth wasn't complete so now its no longer valid. You need to call confirmGiroPayment again (passing a payment method), and the response will contain a new redirect URL to handle auth

vocal wagon
#

Hi, we have a client that is using WordPress/WooCommerce/Stripe but recently over the last few weeks most purchases are failing, we need advice

vocal wagon
# hollow prairie <@456226577798135808> Can your share your code from that file (`dmxStripe.js`)?

Large file... Selecting what seems relevant:
methods:{
checkout:function(e){
var t=this;if(this.props[
"session-url"
]){
var n=this.props[
"session-url"
];window.WebviewProxy&&(n=window.WebviewProxy.convertProxyUrl(n));var r=new XMLHttpRequest;r.onload=function(){
if(200==r.status){
var e;try{
e=JSON.parse(r.responseText)
}catch(e){
return void t.error(e.message)
}if(!e.id)return void(e.error?t.error(e.error):t.error("Id is missing in session response."));dmx.stripe.instance.redirectToCheckout({
sessionId:e.id
}).then(function(e){
e.error&&t.error(e.error)
}).catch(function(e){
t.error(e.message)
})
}else t.error("An error occurred during the transaction.")
},
r.onerror=function(){
t.error("An error occurred during the transaction.")
},
r.withCredentials=!0,
r.open("POST",
n);try{
r.setRequestHeader("Content-Type",
"application/json"),
r.send(JSON.stringify(Object.assign({

    },
    {
      lineItems:this.props[
        "line-items"
      ]||[
        
      ]
    },
    e)))
  }catch(e){
    t.error(e.message)
  }
}
hollow prairie
#

@vocal wagon This looks like the compiled/minified output. What's the actual source (that you've written) look like? Is it React?

#

@vocal wagon Hello, can you share the ID of a particular PaymentIntent that has failed? I can take a look and point you in the right direction

vocal wagon
#

is this available in the WooCommerce interface or only in the stripe account?

obsidian cloud
#

Hello. Can anyone help me. I am trying to get my Stripe account linked to another website, but it's not accepting the API Publishable key or Secret Key. What am I doing wrong? Thank you

warm dust
hollow prairie
vocal wagon
#

ok thanks

hollow prairie
#

@obsidian cloud Hello. What are trying to use with Stripe? Is there a specific error?

vocal wagon
#

I dont see any of the failed payment data within the stripe dashboard

hollow prairie
naive kettle
#

Hello, I am using 2 Stripe accounts. In the older one, when I create a product I can specify an API ID. In the new one I can't. Is there some setting to change? Rr the possibility to specify an API ID when creating a product (via the Dashboard) has been removed?

obsidian cloud
#

@vocal wagon Hi. I'm trying to link it to my pic-time account. It's not allowing me to. The message is showing "Could not connect with Stripe. Please check your information"

hollow prairie
#

@naive kettle Hey! You mean via the Dashboard, or the API?

vocal wagon
#

@obsidian cloud I'm not part of the stripe team, sorry

#

can I post the ID in here?

hollow prairie
#

@obsidian cloud I guess you're talking to me! I would contact the other vendor about that, as they would own that integration

#

@vocal wagon Yep, totally fine

vocal wagon
#

acct_17uSq7FbDH7JKUx3

#

I can see the failed "incomplete" payment now

#

@hollow prairie Cloning customer will only clone the customer, not the Payment Method attached ?

hollow prairie
#

@vocal wagon Thanks, let me check

naive kettle
#

@hollow prairie via the dashboard

vocal wagon
#

Failed 3D secure?

obsidian cloud
#

@hollow prairie Sorry for the confusion. Thank you, I'm trying now to get in touch with them

hollow prairie
#

@vocal wagon Which specific payment are you looking at? Can you share the ID? pi_xxx

#

@obsidian cloud No problem! Hope you get it resolved

vocal wagon
#

pi_1JFFDlFbDH7JKUx3ENVwyHAR

hollow prairie
#

@vocal wagon They're 2 separate processes. One for the Customer, one for the Payment Method

#

@vocal wagon Yep, so the payment method failed 3DS/auth checks. This is an expected error, and isn't indicative of an issue with your site. Your customer simply didn't authenticate the payment correctly. You should ask them to try again

vocal wagon
#

@hollow prairie Thanks !

#

ok the reason I am concerned is because this only started happening about 3/4 weeks ago

#

so what we see is a customer trying multiple times and failing then having to call the company and complete over the phone....with the same CC?

hollow prairie
vocal wagon
#

also one customer said their Post Code would not be accepted

queen stratus
#

Hi i need to know for React native how to disable the Card Field when i need to update existing card

vocal wagon
#

ok thats interesting and makes sense. What are we expected to do?

#

is there anything apart from putting up a notice on the site?

#

advice please thanks

hollow prairie
#

@vocal wagon Your integration already supports these SCA flows, but for whatever reason your customers are failing the required checks from the bank. It's a catch 22 as in some cases these measure can prevent fraudulent transactions

vocal wagon
#

Thanks for the info ynnoj

green notch
#

Yooo, is there any way to retrieve the Publishable test key from a transaction ID?

#

I need to implement SCA, and my colleagues are asleep, and I don't have access to the backend

hollow prairie
#

@queen stratus Hello! Can you elaborate on your use case a little more?

green notch
hollow prairie
#

@green notch Hey. There is not, no. We don't return the publishable or secret keys from the API in any object. You'd retrieve these from your Dashboard: https://stripe.com/docs/keys

green notch
#
return (
  <>
  {isEditingCard ?
    <CardForm /> :
    <CardInfo />
  }
  </>
)
green notch
hollow prairie
#

@green notch I guess so!

green notch
#

thanks anyways!

queen stratus
#

@hollow prairie Yeah got it bro

#

@hollow prairie If i have card number Expires month/year are i able to give it as default value to the Field?

#

I am asking Like TextInput prop like value={name} @hollow prairie

hollow prairie
#

@queen stratus There's no way to pre-populate the fields, no

queen stratus
#

Okay thank you @hollow prairie

vocal wagon
# hollow prairie <@456226577798135808> This looks like the compiled/minified output. What's the a...

I'm using a no code framework tool (wappler) than generates PHP, JSON files. Does this piece of code help to pin point to the reason for the error?
methods: {
checkout: function(e) {
var t = this;
if (this.props["session-url"]) {
var n = this.props["session-url"];
window.WebviewProxy && (n = window.WebviewProxy.convertProxyUrl(n));
var r = new XMLHttpRequest;
r.onload = function() {
if (200 == r.status) {
var e;
try {
e = JSON.parse(r.responseText)
} catch (e) {
return void t.error(e.message)
}
if (!e.id)
return void (e.error ? t.error(e.error) : t.error("Id is missing in session response."));
dmx.stripe.instance.redirectToCheckout({
sessionId: e.id
}).then(function(e) {
e.error && t.error(e.error)
}).catch(function(e) {
t.error(e.message)
})

green notch
#

Can you have methods in json? ๐Ÿ˜ฎ

hollow prairie
#

@vocal wagon Seems like e is not what you're expecting it to be. Can you log e out before you call redirectToCheckout?

dry hatch
vocal wagon
#

maybe i'm not using the right ID?

hollow prairie
#

@vocal wagon Well, the Checkout Session is returned by the XMLHttpRequest request, but e is seemingly not the Session object (as e.id is falsy)

#

@vocal wagon Where is that screenshot from? That's not a standard Stripe object

vocal wagon
vocal wagon
hollow prairie
#

@vocal wagon Yes, the error you're seeing:

Id is missing in session response
Is thrown because of your if statement

#

@vocal wagon Try this:

dmx.stripe.instance.redirectToCheckout({
  sessionId: e.sessionId
})
vocal wagon
vocal wagon
hollow prairie
#

@proven wharf Hey! Sorry it's taken a while to circle back, was just checking up on that Action Button as it's pretty new! Turns out the Payment option only works with certain payment methods types currently, and SEPA Debit is not one of them

#

@proven wharf I can see it's working now as you've added some cards to that Customer

visual canopy
#

Hi

#

I wana help. how conet strip to may bank,account????

cerulean pineBOT
#

:question: @visual canopy Have a non-technical question, account issue, or need one-on-one support?
We wish we could help, but this community is focused on developers and technical discussions. Our support team will be able to assist you better than we can: https://support.stripe.com/contact

naive kettle
#

In one of my accounts I see this option for creating a price, in the other I don't. Is this intended?

meager hawk
#

@naive kettle yes, the ability to define a custom ID for a Price/Plan is an old behaviour we only let existing accounts who were using it in the past have access to by default so it would make sense to see it one account and not another

#

we highly recommend using lookup keys (https://stripe.com/docs/api/prices/list#list_prices-lookup_keys) instead of setting the actual object ID (the opaque IDs like price_xxx lets us encode some information in the "xxx" part that helps to speed up your API requests' performance which can't be done if the ID is a custom string)

naive kettle
#

@meager hawk do you have an example of setting the lookup key of a price/ product? I only can find examples of fetching/listing ๐Ÿ˜ฆ

meager hawk
#

the dashboard doesn't support setting it right now unfortunately

maiden meadow
#

Hi

meager hawk
#

hello there

maiden meadow
#

Can any one help me for payment related issue

#

Hey

#

I need some help in my code

meager hawk
#

I can try, what's the issue you're facing?

maiden meadow
#

I want to pass the dynamic amount in my payment request button

#

and my value store in php varibale

#

i want to pass that

#

I have tried but its not working

#

var paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Total',
amount: 2999,
},
requestShipping: false,
requestBilling: false,
requestPayerName: true,
requestPayerEmail: true,
});

#

Here in place of 2999

#

I want to pass my custom varible

#

I have tried to store php variable value in jquery variable and then that jquery variable I have passed in to this array but its not working

limpid scaffold
#

Hey

Is there any way to test paymentRequestButton (Google / Apple pay) for the insufficient costs error or any other error codes?
I already configured Google Pay test mode, which gave me the list of pre-installed test cards, but don't see any way to emulate any payment failure with them

maiden meadow
#

Can I share my url with u

#

in which I have implemented the payment request button

meager hawk
#

@maiden meadow can you say more about it "not working", what do you see instead, is there an error in your browser console or something else?

maiden meadow
#

You can test with 4242424242424242 card

#

okay

meager hawk
#

if you have a public page I can look at that if you think it helps demonstrate the issue you're facing.

maiden meadow
#

Yes let me share the url

#

if possitble can we have call? i can explain you

maiden meadow
#

This is the restaurant application in which i have added the payment request button

meager hawk
#

@maiden meadow that's not possible, no. I can try to help you with Stripe-specific questions but adding a variable to your Javascript code from your PHP application is really business logic you'd build as the developer of this system. Can you describe in more detail what is "not working" exactly, what code you're using and the errors you see? That link you shared seems to need some logins, are there specific instructions for what you'd like me to do/check?

maiden meadow
#

okay sure

#

Actually my value store in $total
and I have created var total = <?php echo $total ;?>
and then pass that total jquery variable in the
var paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Total',
amount: total,
},
requestShipping: false,
requestBilling: false,
requestPayerName: true,
requestPayerEmail: true,
});

#

it should work

#

but that is not working infact button is not displaying

#

that's my issue

#

That how can i pass dynamic amount

meager hawk
maiden meadow
#

ok

#

let send you that also

#

just give me few mins

#

Uncaught (in promise) IntegrationError: Invalid value for paymentRequest(): total.amount should be a positive amount in the currency's subunit. You specified: 26.64.
at Z ((index):1)
at X ((index):1)
at new n ((index):1)
at Ja ((index):1)
at e.<anonymous> ((index):1)
at e.paymentRequest ((index):1)

#

this is the errror coming when I am passing the dynamic value

green notch
#

I think it should just be 2664 instead of 26.64

meager hawk
#

ok! I think the error is clear, right?

maiden meadow
#

in both places when creating the paymentIntent using CURL and a payemnt request button also

#

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.stripe.com/v1/payment_intents');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "amount=$total&currency=usd&payment_method_types[]=card");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, 'sk_test_51IdirPJL5kmflh3PxmozB5B32RqOsEfvxqXQoL3ZGpnD7Eoq2PzFrOtruditjOBfVShtFXqclWoRhrVmAM9hnuKm00FixYuHZY' . ':' . '');

green notch
#

You should specidify in subunits

#

like how many US cents (or eur cents or dkk รธre or etc...)

maiden meadow
#

you mean format

#

?

green notch
#

I guess you could put it like that

meager hawk
#

yep, in all parts of Stripe's APIs and products(creating the PaymentIntent, and creating a PaymentRequest) you specify amounts using the smallest currency unit, so $26.64 is 2664 (cents) , so you need to write your code to format the values that way.

maiden meadow
#

So total amount should break in cents and then pass it

green notch
#

so if you want the customer to pay 26 USD and 64 cents, you have to format it as 2664

maiden meadow
#

okay

fluid parrot
#

'Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ยฅ100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. '

maiden meadow
vocal wagon
#

Hello

meager hawk
#

@vocal wagon hello there

vocal wagon
#

I have a question about "setup_future_usage" = "off_session"

meager hawk
#

@maiden meadow if there are docs that show passing a number like 26.64 instead of 2664 please link them so I can get them changed as that's a mistake

maiden meadow
#

So my current total amout is $26.64

vocal wagon
#

The payment method is attached with the customer only if the payment intent succeeded ?

maiden meadow
#

but still its not working

meager hawk
#

@vocal wagon yes, we only attach the PaymentMethod used with the PaymentIntent that succeeded. So if the customer tries a few different cards to confirm the PaymentIntent with, it's only the successful one that gets attached

vocal wagon
#

can I by pass it ?

meager hawk
#

@vocal wagon what do you mean exactly?

maiden meadow
#

okay so finally I have to break this total amount in that specfic format and then it will work fine

vocal wagon
#

Some times the pi failed because insufficient founds

maiden meadow
#

fine*

#

Right?

meager hawk
#

@maiden meadow it would be a start! the error message is quite clear, so you'd fix that and then see if things work, if not, then you'll get other error messages that might hint towards the problem.

maiden meadow
#

okay thanks

meager hawk
#

@vocal wagon yes, that can happen. So we don't save the customer's card since if you weren't able to charge it, why would you want to save it? That's the logic.

green notch
#

Also consider using the official Stripe lib for PHP

maiden meadow
#

Sure

green notch
#

#StopCurlAbuse

maiden meadow
#

Thank for the help

maiden topaz
#

Hello, can I as a question?

#

ask*

meager hawk
#

@maiden topaz of course! how can I help?

maiden topaz
#

Is there a way for me to know if the user has successfully connect their stripe account using connect onboarding for express?

hollow prairie
#

@maiden topaz You as the platform account?

peak sage
#

Hi I'm not sure if I'm in the right place, I'm not a developer but us stripe. The payouts keep getting delayed until the next day, there is nothing on dashboard saying why either.

cerulean pineBOT
#

:question: @peak sage Have a non-technical question, account issue, or need one-on-one support?
We wish we could help, but this community is focused on developers and technical discussions. Our support team will be able to assist you better than we can: https://support.stripe.com/contact

maiden topaz
#

@hollow prairie I want to know if there is a return object or token if the seller successfully connects to stripe with connect onboarding for express in my website

hollow prairie
#

@maiden topaz As per https://stripe.com/docs/connect/express-accounts#handle-users-not-completed-onboarding, you can check the charges_enabled field on the account object for a general indication as to whether they're onboarded

https://stripe.com/docs/api/accounts/object#account_object-charges_enabled

maiden topaz
#

Yes, I see that in my dashboard.

hollow prairie
#

@maiden topaz Does that help answer your question?

maiden topaz
#

I have one more question sir

#

How to get this response?

#

When doing this?

hollow prairie
#

@maiden topaz What exactly does that button do?

maiden topaz
#

@hollow prairie It is a button that lets you create an express account on stripe.

hollow prairie
#

@maiden topaz Yep, but can you share the exact code/function the button invokes

maiden topaz
hollow prairie
maiden topaz
#

@hollow prairie Is there a way for me to get the Account Object after they completed the flow when clicking the button?

hollow prairie
#

@vocal wagon Are your secret (sk_) and publishable (pk_) keys from the same Stripe account?

#

@vocal wagon In some cases now you don't need to use redirectToCheckout anymore as you can redirect directly using that field

vocal wagon
nocturne cipher
#

Hi devs i need help with an error code that i am getting when i try to charge by ach. I have a plaid implementation, and everything goes fine (I get the bank token from plaid, create the client and affix the token) until I try to create the charge. The error says: "this account cannot create payments" with the code "invalid_request_error". The strange thing is that if I try to charge by credit or debit card it lets me.

maiden topaz
vocal wagon
hollow prairie
#

@vocal wagon Seems like you're passing an account ID to stripeAccount that's the same as the account keys. That's not necessary

#

@nocturne cipher Hey there. Sounds like your account is not yet ready to process payments. I'd recommend reaching out to support directly: https://support.stripe.com/contact

vocal wagon
#

Im passing a Connected Account to that session, so that this session by this user is attached to that Account. So I remove it and add the (sk) in the header instead?

hollow prairie
#

@vocal wagon You've passed acct_1If9KxEurdXBLYRR which is the same account as the API keys you're using. This will have no effect. Is it intentional?

#

@maiden topaz What do you need from the account object? What are you trying to achieve with that data?

nocturne cipher
#

@hollow prairie Yes I was thinking about that since on my dashboard I get this notice: "Your account does not meet the requirements, Unfortunately, your company cannot use Stripe because it does not meet our Terms of Service. If you think this may be an error, please contact us."

But since it was letting me charge by credit card I assumed it was something else.

vocal wagon
hollow prairie
#

@nocturne cipher You will need to speak to support I'm afraid. We can't really help with account questions like this here

nocturne cipher
#

@hollow prairie No problem I just wanted to rule out that it was that and not a coding error, thanks.

maiden topaz
hollow prairie
daring lodge
#

mornin' folks

hollow prairie
#

@maiden topaz You'd subscribe to an event (like account.updated) and in your webhook handler you'd receive the Account object once onboarding is completed. You can then action that as needed

maiden topaz
#

@hollow prairie I'll try that. Thanks very much, will update you later.

hollow prairie
#

@maiden topaz Np! Let us know if you have any follow-ups

#

@vocal wagon You must have initialised Stripe.js (for redirectToCheckout) with the public key (pk_) from a different account

#

@vocal wagon As I said though, redirectToCheckout is redundant now. You can just redirect in the browser using the url field

vocal wagon
hollow prairie
#

@vocal wagon They're not being used in the request you've shared I'm afraid

vocal wagon
hollow prairie
#

@vocal wagon I'd suggest you double check the keys you're using when creating the Checkout Session, as currently they're from acct_1If9KxEurdXBLYRR

daring lodge
#

@vocal wagon The secret key used to create the session and publishable key used to redirect with Stripe.js must be a matched pair for the same account, and as @hollow prairie explained we're seeing keys from two different accounts (connected account vs platform)

vocal wagon
#

WTH, i feel on another planet now ๐Ÿ˜… Im in front of my dashboard and see the Standard keys for the platform account. Both pk and sk start with pk/sk_test_51IXXEiBfY9idGe2u. They are from our platform, not some Connected Account

daring lodge
#

Oh, maybe the create request with secret key is with your platform?

#

Yes, that looks to be the case - sorry about that confusion

#

OK, given that @vocal wagon i need to scroll back and see what the current roadblock is. one min.

vocal wagon
#

FYI, in my session header, i add the Connected Account acct_1If9KxEurdXBLYRR and the platform api key sk_test_51IXXEiBfY9idGe2u...
Stripe.js uses the (pk) pk_test_51IXXEiBfY9idGe2u....
What is the problem, I am not getting it

daring lodge
junior ivy
#

Hi team, I see for every express account, $2 will be charged and for every payouts 0.25% .. This amount will be deducted from connected account or from market place ?

daring lodge
daring lodge
vocal wagon
night knot
#

I want to access historical data (charges, refunds, etc) related to a previously connected account, all created while that account was connected. However, that account is now no longer connected. What are my options? From what I gleaned, I can only iterate over application fees, expand their charge objects, and so on. However, this has left charge refunds' properties unexpandable because reaching that far through an application fee hits the maximum expandable level limit.

blazing geyser
#

Hi team, I'm trying to get payout.failed webhook events published into staging environment, I see the connected account's payout failing but no webhook event was published. I tried to manually send the webhook event and it works properly.

junior ivy
daring lodge
daring lodge
night knot
# daring lodge Can you provide an example request where you're doing this, or an object id you ...

Thank you, I've actually been inspired while trying to reply and now may have a possible workaround. In any case, I'm still interested in knowing if there was an alternative I wasn't aware of that would let me directly access refunds from a now-unconnected Stripe account. If I try to retrieve the refund from such an account, it tells me that there is no such refund.. presumably because it won't let me load it up as the account isn't connected anymore.

kindred frigate
#

i have updated stripe dll version 39.59.0.0 in web API when i try to call stripe checkoout API i am facing below issue,

daring lodge
# night knot Thank you, I've actually been inspired while trying to reply and now may have a ...

With Standard accounts, this is an expected consequence of disconnecting. The connected account has decided to no longer grant you access to their data, even if you were previously involved with their payments.

I was going to suggest you might be able to expand one more layer if you request a single object instead of a list, which i suspect you figured out too. For anything else, i'm afraid you won't be able to access it and you should ensure you collect any such data at the transaction time while you have the connection. Refunds that happen after the connection is severed should be the responsibility of the connected account.

night knot
daring lodge
#

@vocal wagon did that work out for you?

daring lodge
vocal wagon
#

hi! Quick question - is there a setting or something to pass on stripe fees to my customers?

#

but it's honestly not very helpful and leaves me with more questions than it answers

daring lodge
kindred frigate
vocal wagon
#

It's simple really, I want to charge my customer $100, and pass them on the fees, right.
If they paid by bank, there's one fee. If they paid by card, there's another fee, etc.
I want stripe to charge the customer 103, 100.68, or whatever the fee is, and then the webhook to hit the server with $100 so it can top up the account with $100

junior ivy
#

Hi team, so will there be any charge on express connected account ? yearly or per transaction?

vocal wagon
#

If that's not provided, the article should explain how it should be implemented (should the fee be added as a line item, should it just be calculated at the end and deducted from their account balance, etc etc)

#

along with all the different fees for all different payment methods

daring lodge
daring lodge
vocal wagon
#

Then, is there a way to determine, when stripe hit the webhook, with the invoice payment success,

daring lodge
vocal wagon
#

that the customer paid by card, or bank, so that the appropriate amount may be added

#

it doesn't matter if it's not exact, I need to at least determine if they paid by card or bank, when they hit the webhook

daring lodge
vocal wagon
#

case 'checkout.session.completed':
case 'invoice.payment_succeeded':
case 'payment_intent.succeeded':

#

these

#

I checked the stripe event and didn't see anything useful that can help me determine this

daring lodge
vocal wagon
#

Doesn't matter that the payment is completed, I can topup their account with less depending on the source

#

At least this is the second way I can think of doing this, if it's not supported

daring lodge
#
vocal wagon
#

uff.... I suspected I'd have to go down this route, was hoping for something easier

#

thanks @daring lodge

daring lodge
#

np - you can combine this in a single call with nested expansion, so it's not too onerous

#

(it's specifically for this checkout -> payment method case @vocal wagon )

junior ivy
#

Hi @daring lodge .. thanks for ur quick response .. one more question, cld u pls tel me wats the difference between stripe checkout and stripe billing ? that ll help a lot ..

daring lodge
daring lodge
vocal wagon
#

Hello Again

north ether
#

Hi there, would it be possible to get some support with GooglePayLauncher in version 17.0.0 of the android SDK? Specifically, the SDK states that the launcher must be initialised in activity.onCreate, however during the google pay authentication verification the activity is destroyed and recreated so the result callback would never be invoked. I've followed the steps here: https://stripe.com/docs/google-pay

junior ivy
#

Jus planning on what r the stripe features and functions v can leverage for our application.

daring lodge
daring lodge
# junior ivy Jus planning on what r the stripe features and functions v can leverage for our ...

Gotcha, well, there are lots of offerings, and we're happy to help with any technical implementation questions. For broad product support support is another option available to you: https://support.stripe.com/contact

vocal wagon
#

I still have a question about setup_future_usage. This will not attach the Payment Method to the Customer when the Payment Intent doesn't succeed. But some of the failure are recoverable, has insufficient_funds or try_again_later (some times do_not_honor). I looks like a premature optimisation. Is it possible to attach the customer at the reception of charge.failed because of an insufficient_funds or it will fail ?

junior ivy
north ether
# daring lodge Hey there - I'm not an android expert but can try to help or get help. Is this ...

yep, so to follow up on that - at the time we were using 16.10.0, which matched up with the docs here: https://stripe.com/docs/google-pay. Yesterday we confirmed that the intents were being successfully created but the payment confirmation taking place in android was failing. I captured the POST to https://api.stripe.com/v1/payment_methods and it was returning 200.

I raised this this morning and was directed to look at the same page as above. It referred to new api details, and I was pointed to this pr, https://github.com/stripe/stripe-android/pull/3994, showing that the docs changed some point in the middle of last week.

My preference would be to continue to get support for our 16.10.0 implementation, rather than work through the issues I've had setting up 17.0.0 today.

daring lodge
vocal wagon
#

To understand my use case, I am providing a recurring payment product. When a payment fails, I send an SMS to the customer to set up a new card. When the configuration of the new card fails, the next day when I try to use the payment method again, I receive "The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first". This is annoying because most of the time the payment intention failed due to insufficient funds, so the following days the payment method should work when the bank account is replenished.

pearl bridge
#

Got it .. Thanks

daring lodge
green notch
daring lodge
vocal wagon
#

@daring lodge this is how work setup_for_future_usage If I understood correctly

green notch
#

I'm making a website, mainly for Danes, and we expect the tax to be directly on the label

#

Not at checkout

vocal wagon
#

@daring lodge I did a refactoring to remove the attach because of the 3ds

daring lodge
green notch
vocal wagon
#

@daring lodge on online mode, I use setup_future_usage to attach the pm to the customer

fallow carbon
#

hey there! I'm trying to figure out what the data requirements are when using Stripe Connect Custom Accounts for individuals. Stripe CLI stripe country_specs retrieve AE adds some company related fields (i.e. company.{name|structure|tax_id}, individual.business_vat_id_number) which I don't see in Stripe API docs for the Account object. And the docs here (https://stripe.com/docs/connect/required-verification-information#AE-full-company--transfers) won't let me select 'individual', only company. Can someone help me figure out what's required and what is not?

vocal wagon
#

But if the payment intent failed, the payment method is not attached

daring lodge
green notch
#

Where do I file feature requests?

#

๐Ÿ‘€

#

Because that is something I'd absolutely love to have!

vocal wagon
#

On online mode => setup_future_usage=off_session, if Ok => customer automatically attached to the customer, if KO and decline_code=insufficient_funds, when I received the charge by webhook, attach the payment method to the customer. The purpose is to save the payment method to be reuse the next day if the bank account is replenished. 1) Is it a good pattern ? 2) Attach the payment method to the customer when the payment intent failed because of decline_code=insufficient_funds will work ?

daring lodge
fallow carbon
#

@daring lodge on that page I can only select business type 'company' and then a subcategory (i.e. LLC), which doesn't apply to our scenario, as we'd be working with individuals

#

maybe that page is not set up properly yet for UAE as Stripe is still in beta(?) in that country

daring lodge
bold basalt
#

@north ether hello! I'l back on, catching up, could you bring me up to speed on anything new

kindred frigate
#

Hello,
I am getting below error in web api c#

Warning >> The primary reference "Stripe.net" could not be resolved because it was built against the ".NETFramework,Version=v4.6.1" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.2". stripeAPI

daring lodge
north ether
bold basalt
#

@kindred frigate hello, one sec

north ether
north ether
daring lodge
# vocal wagon On online mode => setup_future_usage=off_session, if Ok => customer automaticall...

No, you need to complete the first payment while the customer is on session to handle the auth and you get the successful response, the PM will be attached. If there's a failure you collect new payment details right then.

If you don't want to collect payment up front with the customer, you should use a setup intent to handle the auth instead, which attaches the payment method to the customer without a payment:
https://stripe.com/docs/payments/save-and-reuse

bold basalt
#

@north ether so I don't think implementing GooglePayLauncher will fix the issue for you, we're still referring to the issue we spoke about yesterday, right?

north ether
daring lodge
# fallow carbon <@!837053243242446919> on that page I can only select business type 'company' an...

It looks like only businesses are supported today, but I'd recommend reaching out to support to find out whether your use-case is supported: https://support.stripe.com/contact

daring lodge
kindred frigate
bold basalt
#

@north ether can you share a request ID to where you got a PaymentMethod created? Want to see if it was a Google Pay PaymentMethod being created

#

@north ether and yeah I can help you with 16.0.0, let's not go the GooglePayLauncher yet as I think there might be an integration issue on your end (if not something else)

kindred frigate
bold basalt
#

@north ether yes the pm_123 ID, or the req_123 request ID

north ether
daring lodge
bold basalt
#

@north ether ok great so that is a Google Pay PaymentMethod card.
So really, that helps me the most in that your Google Pay integration is working fine.
Really what is not happening is that your code is not confirming the PaymentIntent, with that PaymentMethod. So looks like your code is missing something and should be fixable
Would be a harder problem to solve if Google Pay was not working, but it is here

north ether
vocal wagon
#

@daring lodge I cannot use Setup Intent, it's very disturbing for customer to have a 3DS at 0โ‚ฌ

bold basalt
#

@north ether you need to pass the PaymentMethod ID from earlier, into the confirmPayment() function. I actually think your code isn't calling confirmPayment()

#

@vocal wagon hello, I'm catching up, could you bring me up to speed?

#

@north ether because the PaymentIntent IDs you shared yesterday, I didn't see any confirmation requests on it, so I don't think confirmPayment() is being called at all. Or something along the lines but that is the code I'd debug on your end, add logs, view the params being passed to confirmPayment()

dire quarry
#

Hi there, when I cam trying to cancel a subscription it is saying that it doesn't exist but when I view the customer on dashboard they have the subscription id ( "sub_sched_1JFKeSKHMXCcrj1e0PLOCi85")?

var service = new SubscriptionService();
var cancelOptions = new SubscriptionCancelOptions
{
InvoiceNow = false,
Prorate = false,
};
Subscription subscription = service.Cancel(subscription_id, cancelOptions);

any help would be great

vocal wagon
#

@north ether To understand my use case, I am providing a recurring payment product. When a payment fails, I send an SMS to the customer to set up a new card. When the configuration of the new card fails, the next day when I try to use the payment method again, I receive "The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first". This is annoying because most of the time the payment intention failed due to insufficient funds, so the following days the payment method should work when the bank account is replenished. On online mode => setup_future_usage=off_session, if Ok => customer automatically attached to the customer, if KO and decline_code=insufficient_funds, when I received the charge by webhook, attach the payment method to the customer. The purpose is to save the payment method to be reuse the next day if the bank account is replenished. 1) Is it a good pattern ? 2) Attach the payment method to the customer when the payment intent failed because of decline_code=insufficient_funds will work ?

north ether
north ether
bold basalt
#

@dire quarry that is not a Subscription ID, it is a SubscriptionSchedule ID, you're calling an API to cancel a Subscription so you need to pass the Subscription ID

#

@vocal wagon I think you meant me haha

eager torrent
#

Hello, any developers in here that can answer my question? I have a customer who has updated his email address (as his old one was compromised). We use Zoho to process subscriptions. Nothing from us is still being sent to his old email, but confirmation of payment from stripe is still getting sent to his old email. How do I go about updating his email with stripe?

vocal wagon
#

Yes @bold basalt sorry

dire quarry
bold basalt
#

@north ether just log out what PaymentIntentConfirmParams are being passed to that function, you need to pass the PaymentMethod ID there. Use the Android Studio debugger and set breakpoints or log out the params being passed to that function (or if it is even being called)

#

@eager torrent hello, not sure how your integration works via Zoho but I imagine the answer is updating the Customer's email in the Stripe Dashboard? I can't really say as it depends on how this is working with respect to Zoho. Are they sending their own emails or emails through Stripe?

#

@vocal wagon reading your q

eager torrent
#

it's sent from a stripe email address to him and says

#

You're receiving this email because you made a purchase at Producertech, which partners with Stripe to provide invoicing and payment processing.

#

at the bottom

bold basalt
#

@vocal wagon why not attach the PaymentMethod to the Customer first, so that you can re-use it later? Like your main use-case hinges around charging a PaymentMethod multiple times. The way to do that is attach it to a Customer first, so it is reusable, otherwise it just becomes consumed when used the first time

north ether
# bold basalt <@!691373164952944762> just log out what PaymentIntentConfirmParams are being pa...

ConfirmPaymentIntentParams(paymentMethodCreateParams=null, paymentMethodId=pm_1JFKp3LZMMa5HMOVzW2rZINs, sourceParams=null, sourceId=null, extraParams=null, clientSecret={{pi_XXX_secret_XXX}}, returnUrl=null, savePaymentMethod=null, useStripeSdk=false, paymentMethodOptions=null, mandateId=null, mandateData=null, setupFutureUsage=null, shipping=null, receiptEmail=null)

(I've redacted the client secret). Should those braces be there?

bold basalt
#

@eager torrent ah gotcha, I'd talk to Support about that at https://support.stripe.com/contact, they're experts at Dashboard so they'll be able to help you out in updating the Customer email, mention that you basically want to send the Invoice to a new email

vocal wagon
#

@bold basalt I have lots of 3ds issue when I attach the customer first

eager torrent
#

Thankyou so much! @bold basalt I had a feeling i was in the wrong place to ask my query

#

๐Ÿ˜‚

bold basalt
#

@north ether ok the params look fine but yeah the clientSecret doesn't look right. Also is your confirmPayment() function being triggered? or is it validating the clientSecret format and throwing an error?

vocal wagon
#

@bold basalt stripe support tell me to do not use the API attach payment method

north ether
bold basalt
#

@eager torrent no worries, for context we help developers who are coding their Stripe integrations with their questions here

#

@north ether the error would trigger in the onSuccess or onError callbacks, no?

#

@north ether do you see any API request going out to /v1/payment_intents/:id/confirm

north ether
bold basalt
#

@vocal wagon based on what you said, I think you should go that route. Like really, based on the error you shared, that is what you would do. You would do that after the first call failed or before but either way you need to if you need to reuse the PaymentMethod

daring lodge
bold basalt
#

@north ether so your function is probably validating and not actually calling the API, most likely due to your clientSecret value, it needs to be just a string, not wrapped in {{ }}

green notch
#

so you add your books to a cart and then checkout

#

no subscription

bold basalt
#

@north ether also not sure if this changed in the version you are on but this is how you handle the callbacks with onSuccess and onFailure after calling confirmPayment

#

@north ether you implement that in onActivityResult() so it isn't right where you call confirmPayment()

north ether
bold basalt
#

@north ether in your onActivityResult() as shown in the code snippet example I shared with you

daring lodge
#

@green notch Gotcha - so for one time payments Tax is only supported via Checkout today, not custom payment intent-based integrations, and there is not currently a way to preview those taxes. Are you planning to use Checkout, or build your own payment flow?

green notch
#

Building my own payment flow

#

I prefer the control

bold basalt
#

@north ether so I think you need to fix 2 things here: 1/ implement the callbacks for confirmPayment() and 2/ make sure the right params format (like clientSecret) are being passed to confirmPayment()
I believe that should make it work right, just 2/ alone will allow you to confirm the PaymentIntents but 1/ is important too

daring lodge
north ether
daring lodge
#

@vocal wagon for example, if the payment intent fails with insufficient funds, your flow could fall back to using a setup intent to collect the details and save the card to try off-session the next day

bold basalt
daring lodge
green notch
#

I gathered as much

#

I just want the price label to have tax up front

#

Wayyy up front

bold basalt
#

@north ether haha thank you for the kind words but we're here to help

daring lodge
north ether
#

bye for now ๐Ÿ‘‹

trim turtle
#

Hi there, the support forwarded me to this discord, thank's for this community support!

We are having issues with some (not all though) GiroPay PaymentIntents (transfer_data.destination is set to a connected account with a platform fee for the payment if that's relevant) authorised with the Stripe.js API 'confirmGiropayPayment' method. The PaymentIntent ends up in the Incomplete status with a "Payment failed" due to failed authentication in the timeline (status is "payment_intent_authentication_failure") - I can provide you with an example id / dashboard link if that's usually done here / would help you.
As the support confirmed this is usually caused by the user aborting the payment authorisation before being redirected back to our website again but we've gotten reports from multiple users that they were indeed redirected back to us and I was able to confirm this once with a test payment (not again afterwards though).

My best guess for the reason of this issue was an accidental redirect on our site to a different URL within our website. My assumption was this might have caused the redirect from not being confirmed but the issue persists after I fixed that redirect and the user stays on the redirect page. I just remembered though that one query parameter still changes after the redirect.
Might the URL change on our side be the cause for the payment failing or how is the redirect after the GiroPay authorisation on the bank website confirmed? My assumption would be the Stripe.js SDK integrated on our website? If that's done on your side before the user is redirected back to us is there any other reason you can think of for this error?

bold basalt
#

@trim turtle hello, reading one sec

#

@trim turtle example ID of a PaymentIntent would be great

trim turtle
bold basalt
#

@trim turtle all good, more detail the better

stray skiff
#

Is there a way of setting a subscription schedule phase to last forever?

bold basalt
#

@trim turtle could you pls share the PaymentIntent ID of one such Giropay payment? I can work backwards from there

trim turtle
bold basalt
#

@trim turtle thanks looking

north ether
bold basalt
#

@north ether oh you're on an older version of the SDK right, you might need a different syntax, one sec

north ether
bold basalt
#

@north ether yeah docs are on the latest version of the SDK so they're using a newer syntax (trying to recall the name for what to call it)

#

@north ether hmm wait you're on v16.10.0 ? not 16.0.0 ??

#

@north ether cause that wouldn't be old, 16.10.0 was this month

#

@trim turtle is stripe.isPaymentResult() evaluating to false in the createPaymentMethod() callback? I think it would be true only for confirmPayment() callback

north ether
bold basalt
#

@north ether no worries, I think I misread earlier and assumed it was 16.0.0

stray skiff
# bold basalt <@!99856235125305344> with `end_behavior: release` you basically get it to conti...

I create a schedule to upgrade the users' subscription at the end of the current billing cycle and I want that phase I make for the new subscription they want to stay forever, the end behavior stuff just keeps the original one running, doesn't it? So if I upgrade from A -> B then after a month the phase is done and then it continues the original A payments? Or does it continue with the B payments?

bold basalt
#

@trim turtle ok so here's what I'm seeing (and caveat that I have limited visibility into what happens during authentication)
You call confirmGiropayPayment from Stripe.js, that shows the authentication page, now I think either the customer isn't authenticating or they are failing authentication. So basically a payment cannot be created and they're brought back to the page you passed in return_url .
With that said, I wasn't sure about the later parts of your questions, what they meant. But that is the state as I see it above^ , so let's start there

#

@stray skiff I would assume it continues B, not A. After you make the change, inspect the underlying Subscription and see what Prices / SubscriptionItems it has on it, whatever that has will be continued

north ether
bold basalt
#

ah yeah sorry wrong @

stray skiff
#

Cool, thank you. I'll create a really quick subscription and see what happens I guess haha

trim turtle
trim turtle
bold basalt
#

@trim turtle don't know the full mechanics of it but yes it would be some page/redirect Stripe.js shows where they log in or SMS verify to authenticate and get redirected back

they see a charge on their bank statement afterwards (that get's reversed a few days later
don't fully know how Giropay works downstream (if that is expected or not) but the reversal ultimately sounds right as the authentication declined (again can't speak to the details on how that works downstream)

#

@trim turtle

if we can mess up the redirect confirmation (e.g. with a redirect within our website) on our side or if that's done before the user get's back to us from their bank website
not sure I understand but basically you're using Stripe.js so once it handles authentication, it just redirects back to your webpage. So it would happen after the customer is done with authenticating.

#

@north ether reaching the limits of my Android debugging skills here but can you make sure the right activity is being passed into stripe.confirmPayment(...) ? cause as I understand, the Intent is passed to that Activity that you're passing into confirmPayment() so it can call your completion callback on it. That is what I could think of

north ether
trim turtle
# bold basalt <@!196737871489662976> don't know the full mechanics of it but yes it would be s...

@bold basalt Yes, it's a page actually provided by their bank if I understand correctly that redirects them to https://hooks.stripe.com/redirect/authenticate/... (see evt_1JFFv7EzBYXlqFmp1hnmEBLn for example). Just my understanding and might be different though. The event I referenced appears very shortly after the request to confirm the PaymentIntent and is what's transferring the PaymentIntent to the requires_action status

trim turtle
north ether
bold basalt
#

@trim turtle yeah so that event is basically the interstitial event from the PaymentIntent being confirmed on your webpage. So it goes into requires_action status and Stripe.js displays the authentication page (the hooks.stripe page).
Once that is authenticated, they're redirected back to your webpage (the return_url )

#

@north ether great!

trim turtle
bold basalt
#

@trim turtle it would be either a "modal popup" or a full page redirect, I thiiink Giropay is a full page redirect .. yeah fairly certain it is a full page redirect

trim turtle
#

@bold basalt Yes, can confirm from testing that it is a full page redirect

#

@bold basalt And the redirect_to_url action to the hooks.stripe page from the event I referenced is the redirect to the customers bank? Or is it the redirect from the bank site back to ours?

bold basalt
#

@trim turtle so in that redirect_to_url hash, url field would correspond to the bank authentication page
return_url is your page that will be sent back to
Since you're using Stripe.js, it handles those for you so you don't have to worry about those, like it redirects to the bank page, then after completing that, returns your customer to your return_url

#

@trim turtle I think your return_url page is assuming payment is successful , I would instead re-fetch the PaymentIntent and look up the status of the PaymentIntent and only call it "successful payment" if the status is succeeded. Not sure if you're already doing that or not, just wanted to call it out

trim turtle
#

@bold basalt Thanks, yes we are refetching the PaymentIntent / updating it's status and handle different states accordingly. This was actually the wrong redirect I referenced in my initial message which we fixed, the status check still returned pending, most likely due to a race condition. This race condition is why I suspect there is some form of confirmation happening after the redirect

#

@bold basalt This would come back to the later part of my original question. Is there some form of confirmation (probably by the Stripe.js SDK) that the redirect to the return_url actually happened / succeeded?

bold basalt
#

@trim turtle

Is there some form of confirmation (probably by the Stripe.js SDK) that the redirect to the return_url actually happened / succeeded?
what do you mean by "confirmation", do you mean in general terms or the API terms (e.g. confirming a PaymentIntent)
But the redirect happened is basically if you end up on your page or not, so basically if your redireect page's code is triggered, then your customer was brought there. It would happen in both successful or failed payments. Customers can authenticate but still not be redirected to your page e.g. if they close the page right after redirecting.

trim turtle
#

@bold basalt The URL contains a few extra query parameters after the redirect in addition to the ones set in confirmGiropayPayment, among them redirect_status=succeeded which would indicate whether or not the authorisation was successful or not, correct?

bold basalt
#

@trim turtle ah I see

#

@trim turtle the PaymentIntent status is the source of truth here, which you're already fetching and looking up the status of

#

@trim turtle the PaymentIntent is what moves funds, so if it were succeeded it would mean it was authorized

edgy gyro
#

hello, i have a question

trim turtle
#

@bold basalt It returned requires_action, at least in my test. But the required action is the redirect to the bank website from which I just came

bold basalt
#

@trim turtle do you have a PaymentIntent ID for that one? and this was after you fetched it on your redirect, right?

trim turtle
#

@bold basalt This one: pi_1JAGLLEzBYXlqFmp6EoCx5ph Yes, the status requires_action was returned when fetching it to render the page set in redirect_to_url

dim hearth
trim turtle
dim hearth
trim turtle
# dim hearth We're still looking into it, but what we do see so far is that particular paymen...

@dim hearth Thank you very much! I'm not 100% sure but if I recall correctly all the test payments afterwards (pi_1JAGzGEzBYXlqFmp0NTeK02C is the only other prod test and a bunch of payments in the test mode) returned succeeded as the status and didn't cause the wrong redirect on our page. That's the reason I am mentioning the redirect or any form of technical conformation after the redirect to the redirect_to_url so often

dim hearth
#

@trim turtle We figured it out! What's happening for that particular payment intent is that there was a request made to update it (req_eH5G5fk8Ax5aYm) after the user had already been redirected to complete payment. This update cancelled the underlying source, and so by the time the user had completed the redirect we immediately refund any funds that had moved and the payment intent does not succeed. Does that make sense?

trim turtle
#

@dim hearth Am I missing this update call on the first example (pi_1JCNAOEzBYXlqFmpNugjWi4J) or did this happen there too? I fixed one of these duplicate call bugs (which resulted in updating the PaymentIntent if there already is one for that particular customer / item)

dim hearth
trim turtle
languid vault
#

Hello, I am trying to integrate Stripe with my website product page. On my website, it shows that Stripe was connected, but I received an email saying that the endpoint was not working, and asked me to add a new endpoint, but I don't know how to add a new endpoint... Also, do I need to create a new API key every time I try to integrate Stripe with a new platform?

#

@dim hearth Hello, I am trying to integrate Stripe with my website product page. On my website, it shows that Stripe was connected, but I received an email saying that the endpoint was not working, and asked me to add a new endpoint, but I don't know how to add a new endpoint... Also, do I need to create a new API key every time I try to integrate Stripe with a new platform?

dim hearth
#

@languid vault And no, you should not need to create a new API key every time you integration with a new platform.

languid vault
#

I see. I copied the "Secret API" from Stripe to my website where it asked for Stripe Secret Key, then it showed "Connected" on my site...

languid tulip
languid vault
#

It is a platform to build online stores...

languid tulip
languid vault
#

It is showing "Connected" on my end...

languid tulip
languid vault
#

This is part of the email I received from Stripe...

languid tulip
# languid vault This is part of the email I received from Stripe...

As karbi mentioned above, you can add a new endpoint via the Dashboard or API, however I would suspect the plugin you are using is handling this for you so you will likely need to work with them to solve the reason your current endpoint is not responding to the events successfully.

languid vault
#

One more question, is there a way to set up a subscription based products on Stripe in advance?

languid tulip
languid vault
#

Thank you. I will talk to their support as well. I just thought I'd talk to you guys first, in case the issue is with Stripe or how I set up my Stripe API

#

Creating the subscription in advance...

#

When I tried that, Stripe was asking me to fill out product name, and client information...

languid tulip
languid tulip
languid vault
#

I see. Currently, "Trial" is disabled in my Stripe account, so do I need to enable "Trial" first?

languid tulip
#

Sorry... had a typo there... trials are not something you enable/disable on your Stripe Account

#

(I edited)

vocal wagon
#

Using callback from a checkout session, how would I get the id of products the customer bought?

#

do I need to use the payment_id and fetch info related to that?

languid vault
#

I believe in my Stripe settings, there was "Enable" toggle next to trial period...

#

I thought I saw it when I was setting up my Stripe settings a couple days ago, now I am really confused...

#

So how do I set up the trial period then? On Stripe side or with my store platform?

languid tulip
languid tulip
languid vault
#

This is the screen when I tried to create a subscription on Stripe...

languid tulip
languid vault
#

The very first box is "Customer"... How can I create a subscription in advance?

wispy star
#

Is there a way to make it so that automatic payouts through Stripe don't occur if the account is below a certain balance?

languid vault
#

It is still the same even after I clicked "Add Trial" and entered "7" days...

languid tulip
vocal wagon
#

@languid tulip can you expand with .redirectoToCheckout() method?

languid vault
#

It is still asking for the customer name first...

languid tulip
mighty hill
#

@wispy star No, you would need to turn off automatic payouts and use manual payout logic on your end to do that.

languid vault
#

So I can't sell a subscription product to a new customer at a checkout page?

#

And I can't enter a customer's info manually into Stripe as a subscription product buyer?

vocal wagon
#

I dont see an option looking at the docs for expand so I would have to request in a webhook?

languid tulip
vocal wagon
#

@languid tulip I want to know what product the user bought, not the price.

#

e.g. if two items are $5, I want to know which one they bought

#

i dont see an option to implement expand using redirectToCheckout()

#

so would I just have to make another call to the API after successful purchase?

languid tulip
vocal wagon
#

How would i go about using the returned object to go fetch the items they bought exactly?

languid tulip
# languid vault And I can't enter a customer's info manually into Stripe as a subscription produ...

You can manually create the customer object before starting the Subscription. Ideally you would not be collecting their payment information and manually entering it (due to PCI compliance). Yes you can start the subscription via the Dashboard as you were doing, but you must have a customer object created first and if you are using 'charge_automatically' then you must have payment information ahead of time as well.

mighty hill
#

@languid vault Taking a step back, can you tell us a bit more about what you're trying to build at a high level? As mentioned above, you can start a new Subscription from the Dashboard, but typically you would define Products and Prices that would then be used by your code or a plugin to create Subscriptions rather than you doing it manually.

languid vault
#

We have digital marketing services that customers pay on a monthly basis... So it would make sense that when they check out on my website, they are automatically added to the subscription and they will be charged automatically every 30 days...

#

I was told that PayPal has that feature, but my clients are business owners, they prefer to pay with their cards...

languid tulip
# vocal wagon How would i go about using the returned object to go fetch the items they bought...

You would listen for checkout.session.completed and then fetch that Checkout Session from the API and expand the line items (https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items). The product will then be in line_items.data.price (https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-product) and that is expandable as well.

mighty hill
#

@languid vault Usually the easiest way to build something like that would be to use Stripe Checkout in subscription mode, but it sounds like you're using a plugin. Do you know if the plugin you're using supports Stripe Checkout?

languid vault
#

I don't think so. The developer asked me to get recurring payments set up with PayPal, and use Stripe in the mean time while I wait for PayPal to get set up...

#

How do you get the Stripe Checkout in subscription mode?

mighty hill
languid vault
#

I can build a checkout page with a different platform if necessary...

#

Thank you for the info

daring lodge
#

๐Ÿ‘‹

peak nest
#

Hey how do i get in touch with customer service?

daring lodge
ripe spade
#

Hey Guys, need to check one question, recently i am upgrading the Stripe version from 8.1.0 to 16.7.1 in Android for my project. After some steps, i observed that stripe.createCardToken(card, "", "", new ApiResultCallback<Token>() {}) is always jumping to onError method instead of success and error message is showing as:

*The provided key 'pk_test_********************************************************************************************eHQxUV'
does not have access to account '' (or that account does not exist). Application access may have been revoked.

#

Does anyone know what could be the issue here and what am i missing?

daring lodge
ripe spade
#

Actually, i dont have access to the Dashboard so far but whenever i checked online so it says it would need some Account ID and i am passing that already "Stripe stripe = new Stripe(AddCreditCardActivity.this, stripeApiKey, "acct_XXXX");"

daring lodge
ripe spade
#

I can see in my android code

#

Oh okay, found a very silly mistake and changed the method from stripe.createCardToken(card, "", "", new ApiResultCallback<Token>() {}) to stripe.createCardToken(card, new ApiResultCallback<Token>() {}) means from 4 parameters to 2 and it started to work.

serene moon
#

Hey - interested to know if there's a way to prevent a charge from being included in a payout. As an example scenario we are charging users $5 and then transferring 90% of that to an instructor on our platform but only once that instructor has completed the class they are offering (that the user paid $5 for). A user may be able to pay weeks ahead of time so in order to prevent a scenario where our balance may be too low is there anyway to prevent that $5 charge from paying out on our main account until we transfer to the connected instructor account

daring lodge
ripe spade
#

Thanks for your help at least you started to look into this. @daring lodge

daring lodge
serene moon
safe tundra
#

hey all! question about API keys... does Stripe have any protections on how an API key is used? For example, can I specify that Stripe should ignore API requests with a certain key unless they originate from a specific IP address?

sage acorn
#

Quick question ๐Ÿ™‚ When allowing a customer to add/replace card on file and using setup intent, is it necessary or recommended for any reason to cancel previous attempts if they exist? Is it okay to just create a new one and forget about the previous one?

open crystal
#

i'm also curious about that, except in my case PaymentIntent. my account is filling up with incomplete payments. is that ok?! eeek

daring lodge
#
safe tundra
#

will do, thanks!

sage acorn
#

@open crystal doesn't sound great. I'm not really seeing any urgency (yet) from the docs to remove previous intents for my case. But it's there for a reason...

daring lodge
sage acorn
#

@daring lodge I'm not storing them in my database, but enforcing that methodology when attaching a card to a customer. Any reason I should be storing the intents?

daring lodge
#

Same for you @open crystal - these can be ignored using the other payments tabs in dashboard, or with status filters

sage acorn
#

What I'd really like to do is replace the existing card on file ... using elements, to benefit from 3d secure and all the other features.

#

We don't want customers having multiple methods on file

open crystal
#

i'm creating a temporary order (in my database) with each of my created PaymentIntents, and converting it to a real Order after webhook confirmation. Using PaymentIntents as described in docs/tutorial lead me to some icky development path, i feel

sage acorn
#

@open crystal the reliance/recommendation on webhooks is what's hanging me up a bit

open crystal
#

same!

sage acorn
#

I have a customer in real time updating information

daring lodge
#

To replace the existing saved card when you only want one in the steady state, I'd recommend using a setup intent to authenticate the new card, then updating any subscriptions or the customer invoice default payment method, and any representation you have for the "default" PM for that customer, then detach the previous payment method

#

so with webhooks that would be handled when the setup intent succeeds, you process the new payment method as described, remove the previous one

sage acorn
#

@daring lodge Agreed. But because I'm using elements, I can't decide on whether or not to wait for the webhook or do a lookup on the payment method after the fact. It 's hard to explain my hang up on the webhook. They seem reliable, but it's more about deciding a path for real time. Hard to explain my issue. It's probably just me.

#

I do see that I can await on stripe.setupCard

daring lodge
#

i'd recommend a two prong: await the async result from confirmCardSetup and call to your server to Do The THings.
As a backup, have a webhook handler (sometimes 3ds fails to redirect users back etc) and when you get the setup intent success event, you check if the PM has already been replaced, and if not, Do The THings

sage acorn
#

I wonder if there's a way to tell if the webhook fired from app initiated API request compared to stripe dashboard

fierce flume
#

Hello, Is it possible to work with stripe payment intent with 3d secure validation without webhooks to check if payment is successfully validated by the client ?

sage acorn
#

@fierce flume as @daring lodge just mentioned, there are cases where they are redirected, so you'll have to handle that when they come back to your app.

open crystal
#

๐Ÿ˜ข no love for webhooks

sage acorn
#

The new Stripe CLI is pretty awesome though!

daring lodge
# fierce flume Hello, Is it possible to work with stripe payment intent with 3d secure validati...

You can await the result of confirmCardPayment as in most cases this should work well, but issuers sometimes do funny things with 3ds and it can lead to a customer not getting directed back to your app, so you should not 100% depend on that, even if it works most of the time. We recommend listening to webhooks to catch any cases where something in the user device/browser interferes with a synchronous handling.

#

This is similar to (but distinct from) redirects after checkout -- you shouldnt rely 100% on customer redirects to your success page for fulfillment. You can handle this and check the session result when the customer hits your success page, but you should also listen for checkout success webhooks incase the redirect fails or the customer closes their browser after paying before they get to your page.

sage acorn
#

If a customer's invoice/subscription status is unpaid (expired card for example) and they update the method, does this new smart retry thing I'm reading about pick up on that? Or would I need to manually initiate a collection request for unpaid balance?

bold basalt
#

@sage acorn hello, I think you need to set the new card PaymentMethod as the default_payment_method on the Subscription first, then it will be picked up for the Subscription's retries

sage acorn
#

@bold basalt sounds right. I'm about to deviate from the subscription level and set as default for invoice payments on the customer object. There's no reason in our application for a customer to have multiple cards. Hoping the same retry applies there as well

bold basalt
#

@sage acorn yeah should work the same there, assuming the Subscription doesn't have default_payment_mehtod set and is already leveraging invoice_settings.default_payment_method from the Customer object

sacred totem
#

Hello! Iโ€™ve a question about the api. Iโ€™ve got 2 api keys that I can connect with, but when using the public keys only one returns a fingerprint. Is there some setting I have to fiddle with to get both keys to return a fingerprint? This is specifically when dealing with the BankAccount object.

vocal wagon
#

Anyone have experience writing unit tests for webhooks? Webhooks are working as I want them to in my staging environment but I want to be extra safe. My webhook endpoint is "/api/payments/stripe/webhook/<webhook name>"

#

can I just simulate post requests to that endpoint?
/api/payments/stripe/webhook/customer_created/ for example? doesn't seem to be working

bold basalt
#

@sacred totem fingerprint is a secret key only field, not viewable via publishable key, that is by design.

#

@sacred totem you can do a server-side roundtrip to look up the fingerprint of a token

sage acorn
#

@vocal wagon I created a single controller to handle all webhooks from Stripe. It's just a switch statement to determine what actual method to call, which allows for dependency injection. Since a unit test should be detached from any network related functionality and be isolated, I would make sure your webhook entrance point is very simple, which triggers a separate method to handle the payload.

sacred totem
#

@bold basalt I see, thank you!

bold basalt
#

@vocal wagon you would set up a mock event body and pass that to your webhook handler function instead of mocking the whole POST request

vocal wagon
#

hmm - I'm using dj stripe so I don't have one webhook handler function

#

Mine are set up this way -

@webhooks.handler("checkout.session.completed")
def checkout_success(event, **kwargs):

fierce flume
vocal wagon
#

path("stripe/", include("djstripe.urls", namespace="djstripe")),

bold basalt
#

@fierce flume hello, confirmCardPayment will result in a successful PaymentIntent

#

@fierce flume you don't have to do anything further with that PaymentIntent

sage acorn
fierce flume
bold basalt
#

@fierce flume can you link to that earlier msg for context

vocal wagon
#

I don't need to write my own tests since dj stripe already has these pre-written, is that the case?

#

or I will need to import them and customzie them to my project?

bold basalt
#

@fierce flume sure but my answer still stands. You don't have to do backend logic to make the payment a "successful" payment. Are you asking "do I need to check the status of the PaymentIntent after confirmCardPayment() completes?" if so, sure you can check that server-side but you don't have to do anything to the PaymentIntent server side to make it succeed.

sage acorn
#

@vocal wagon I'm in .net world so it's beyond me ... sorry ๐Ÿ˜ฆ

vocal wagon
vocal wagon
sage acorn
#

@vocal wagon Sure. You may ask a question directly on their repo... someone there may be able to help.

fierce flume
fierce flume
vocal wagon
#

tried there first

bold basalt
#

@fierce flume ok so in that case, after confirmCardPayment promise resolves, you can then send that PaymentIntent ID to your server, look up the status and then update your own charge object record

fierce flume
frigid sonnet
#

Hi! I sell a Discord bot but we do not want to do the VPS to do the Stripe payments, we want to use Stripeโ€™s checkout. How can we implement a custom field so the user can put their UserID when they checkout?

bold basalt
#

@fierce flume that is why you need to listen to webhook events, to handle that case

#

@frigid sonnet hello, Checkout itself doesn't support a custom field on the page itself yet, you could set up a text input before displaying Checkout, and validate that on your end (whether it is a UserID or not), then send that as metadata on the CheckoutSession or the underlying PaymentIntent of the Checkout

frigid sonnet
#

Is there any intent for custom fields to be added to checkout?

fierce flume
bold basalt
#

@fierce flume why 2 endpoints, what is the first one for?

#

@frigid sonnet I think I've heard feedback around that but not sure there's anything in the works on that

frigid sonnet
#

Alright. Thank you for the insight!

sage acorn
#

Is it possible for a webhook to contain data that's not available immediately when fetching from the API? For example, on attaching a new card via elements, on the webhook if I immediately try to fetch that payment method, it's not found. I have a breakpoint in the code. It's certainly there now in Stripe, but at the time of the hook, not found.

bold basalt
#

@sage acorn I don't think that would be possible no. Like I'm assuming the webhook event you're listening to is related to that object you're fetching? in which case it would already exist in the API.

sage acorn
#

@bold basalt I'm going to try again to confirm.

#

@bold basalt So it appears there is a difference between { customer.default_source } and {customer.invoice_settings.default_payment_method}

bold basalt
#

@sage acorn yep

sage acorn
#

I tried to set both

bold basalt
#

@sage acorn you shouldn't be setting both, only the latter

sage acorn
#

What's the point of the first one?

#

If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

#

In the docs, is the previous prop deprecated in favor of payment methods API?

bold basalt
#

@sage acorn first one was pre-PaymentMethods, for Tokens/Cards/Sources, looks like you're using PaymentMethods.
PaymentMethods don't work with default_source

#

@sage acorn and yes Tokens/Cards/Sources are not now considered legacy

sage acorn
#

I shouldn't have waited all these years to come back to a new stripe project

#

Is there any benefit to setting the default payment method on the subscription itself rather than the customer settings?

#

It does that in the guide / example but I'm trying to keep this as simple as possible. One payment method for a c ustomer... period.

#

And thank you @bold basalt for your help.

bold basalt
#

@sage acorn if you have multiple Subscriptions that use different PaymentMethods attached to the same Customer, then you'd use default_payment_method

#

@sage acorn but yeah for the simple case, just use invoice_settings.default_payment_method

tight holly
#

[โ“ Question] Does Fraud Prevention rules have access to "metadata", we have some additional data fields we would like to send while creating charge as these fields are custom can these be sent using

#

[โ“ Question] Does Fraud Prevention rules have access to "metadata": https://stripe.com/docs/api/charges/create#create_charge-metadata , we have some additional data fields we would like to send while creating charge as these fields are custom can these be sent using "metaData" field with Charge object while creating charge: https://stripe.com/docs/api/charges/create, so we can use these fields and create custom Fraud rules. I was not able to find anything to see if this is possible wondering if any one had done something like this before to create fraud rules using "metadata"

dim hearth
tight holly
#

nice this is good

nocturne schooner
#

Hello!

Can you please let us know if we can code payment routing logic to distribute payments from one Stripe account that initially collects payments to connected accounts? We have different reseller accounts and need to allocate payments based on shipping address and product type. Thanks!

dim hearth
echo pollen
#

Are there any negatives to responding to a Stripe webhook with a "BadRequest" ?

#

The webhook for a charge success fired before the payment had been recorded in my database... The webhook was perfectly fine, I just couldn't match it to the payment that triggered it at that second

dim hearth
nocturne schooner
echo pollen
#

it was a microsecond gap, the webhook fired and then the row was there

#

I just retriggered the event from the dashboard but I don't want to babysit it, and I don't need anything from Stripe after I verify the data in the webhook anyways

celest coral
#

Hi! Is there a way to delete all PaymentMethods on a Customer? I only see detaching one-by-one or deleting the Customer...

dim hearth
dim hearth
spiral whale
#

Does Stripe report your revenue to the government?

#

I am a web developer, a customer asked me that what information does stripe gives to the government of Canada? If they submit a report of income on your behalf, do they include where the money was generated from, for example, which website the transaction came from? Do they give a breakdown point of each transaction they process or the total amount of revenue that you generated within a given duration of time? Does anyone know their contact info, phone number within Canada, I couldn't find it on their website?

atomic locust
#

Is it possible to send a payment amount from the website or do the prices have to be preset? i.e. use a value in an input field to send the payment amount.

pure island
#

Hi, I want to create a card in the back end. where do i get the source string from? i thought it was an object with required parameters like exp_month card number..etc

dim hearth
atomic locust
#

integration? Are there specific requirements for implementation?

dim hearth
# pure island Hi, I want to create a card in the back end. where do i get the source string fr...

Here's an example of how you would create a source in the backend w/ card data:

curl https://api.stripe.com/v1/sources \
   -u sk_test_XXXXX: \
   -d type=card \
   -d currency=usd \
   -d owner[email]="jenny.rosen@example.com" \
   -d card[number]=4242424242424242 \
   -d card[exp_month]=12 \
   -d card[exp_year]=2022 \
   -d card[cvc]=123

If you're handling raw card data on your server you should make sure you are PCI compliant

dim hearth
atomic locust
#

so looking for what I would consider relatively simple setup. Generating payment options for website running on a php server. Allow page to accept payment amount from customer. From that value calculate a final amount (adding fees, etc). Then processing the payment.

pure island
lucid raft
#

you want to charge the customer including the fees etc.

atomic locust
lucid raft
lucid raft
atomic locust
#

I heard to accept a payment the products/amounts had to be preset in our Strip account and the site had to pull from that as offerings for the website? Is that true?

lucid raft
#

Stripe API has the flexibility to support different user cases

#

Having product/price catalog could help you to create subscriptions or charge user fix amount and help you with reporting etc.

atomic locust
#

for a php server will any dependencies be required on the server? e.g. can this run in a shared hosting environment?

lucid raft
#

@atomic locust no requirements on your hosting environment as long as your hosting environment is secure and could access Stripe API

atomic locust
#

secure? meaning ssl certificate for the site?

lucid raft
#

yup, also you will have to store your secret key, db credential somewhere. you will need secure them.

atomic locust
#

what is SOP to secure those?

lucid raft
#

what do you mean by SOP?

atomic locust
#

sorry, standard operating procedure. ๐Ÿ˜€

lucid raft
#

I don't know. I mean security is not entirely about integrating with Stripe, Your site needs to be secure in general from different attacking surfaces. Securing your Stripe key is definitely one of it. You can take a look our doc here https://stripe.com/docs/keys#safe-keys

vocal wagon
#
Error: Stripe webhook failed with TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView, KeyObject, or CryptoKey. Received undefined

Code:
exports.handler = async ({ body, headers }) => {

  try {
    // check the webhook to make sure itโ€™s valid
    const stripeEvent = stripe.webhooks.constructEvent(
      body,
      headers['stripe-signature'],
      process.env.GATSBY_STRIPE_WEBHOOK_SECRET
    );

    // only do stuff if this is a successful Stripe Checkout purchase
    if (stripeEvent.type === 'checkout.session.completed') {
      const eventObject = stripeEvent.data.object;
      console.log(eventObject)

      
    }

    return {
      statusCode: 200,
      body: JSON.stringify({ received: true }),
    };
  } catch (err) {
    console.log(`Stripe webhook failed with ${err}`);

    return {
      statusCode: 400,
      body: `Webhook Error: ${err.message}`,
    };
  }
};
#

This code was running fine before but now it's giving me this error in my webhook

pale belfry
#

Hello are we out of working hours now?

vocal wagon
#

I found the solution, i needed to install stripe in my functions folder

lucid raft
#

@pale belfry do you have any questions?

pale belfry
#

@lucid raft Oh hello, well, I have this code for Creating a Bank Account token, but when I run it, I don't even get a console log of anything below stripe.tokens.create ```
const SellerForm = (props) => {
const dispatch = useDispatch();
const history = useHistory();
const { currentUser, userErr } = useSelector(mapState);
const [businesstype, setbusinesstype] = useState("");
const [businessname, setbusinessname] = useState("");
const [accountnumber, setaccountnumber] = useState("");
const [routingnumber, setroutingnumber] = useState("");
const [errors, setErrors] = useState([]);

const CreateAccount = (bankToken) => {
const accountform = React.useRef("account-form")
const formdata = new FormData(accountform)
formdata.set('external_account', bankToken)
console.log('it worked')
fetch('/create-account', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(Object.fromEntries(formdata))
}).then(function(r) {
return r.json();
}).then(function(response) {
JSON.stringify(response, null, 2)
});
}

const handleStripeConnectBtn = (event) => {
event.preventDefault();
console.log("hello1");
stripe.tokens.create ({
bank_account: {
country: 'US',
currency: 'USD',
accountnumber,
routingnumber,
// account_holder_type: businesstype,
account_holder_name: businessname,
}

})
.then(function(response) {
// debug("created bank account" + response.token.id)
console.log("hello2");

CreateAccount(response.token.id); // btok_xxxx

})
};

#

I'm using react, the problem is that the 'const handleStripeConnectBtn' function stops running after console.log("hello1")

lucid raft
#

@pale belfry do you see any console errors in the browser dev tool? And if you add .catch() after .then, will you catch any errors?

pale belfry
#

@lucid raft I tried adding .catch(error) to the end but I don't think I know how to do this in JS

#

Working on it now

lucid raft
#

@pale belfry You can simply do this after

.then(function(response) {
  // debug("created bank account" + response.token.id)
    console.log("hello2");

    CreateAccount(response.token.id); // btok_xxxx
  }).catch((error) => {console.log(error})

You can go to your browser dev tool e.g. in Chrome by Option + โŒ˜ + J (on macOS), or Shift + CTRL + J (on Windows/Linux)

#

to see if there any errors thrown

radiant orchid
#

Can anyone help me I have some doubts regarding the stripe address? Does stripe validate the billing address? Like I am in Canada and adding input as USA but card is of Canada does that validates ?

vocal wagon
#

When I try to fetch from the stripe API, I get a 401 error. Is there something wrong with my endpoint?

lucid raft
valid grotto
#

Hi All, I hope that somebody might be able to help with this error message: Failed to execute โ€˜postMessageโ€™ on โ€˜DOMWindowโ€™: The target origin provided (โ€˜https://js.stripe.comโ€™) does not match the recipient windowโ€™s origin (โ€˜https://www.holmanindustries.com.auโ€™).
I am experiencing the issue that the form fields cannot be filled in by the customer when we send out the customer payment page. The normal checkout has no issues.

vocal wagon
#

@lucid raftHow would I fetch using the stripe api? I am using a webhook for when checkout is completed. I then want to use that id session to get the lineitems for the session using fetch (in this case axios)

#

The rest of my code is using the stripe library

swift hearth
#

Help - Read Payment Form Field

vocal wagon
#

I am just not sure how to fetch and if I could with stripe

swift hearth
#

Hello - I am building custom stripe payment form and below is my code. Could you please help read the CVC, Expiry, Card Number entered by the user?

lucid raft
#

@vocal wagon you can fetch the session using

const session = await stripe.checkout.sessions.retrieve(
  'cs_test_xxxxx'
);
swift hearth
#

Change Event - Value is empty

lucid raft
vocal wagon
#

Ill give it a look, thank you

pale belfry
#

@lucid raft Thanks for that, the function seems to stop completely after console.log("hello1"), meaning that stripe.tokens.create is not running at all

lucid raft
lucid raft
#

@vocal wagon I have deleted your message because it contains a secret key even though it is a test key. Please don't share the key with anyone.

vocal wagon
#

@lucid raftOh sorry, i must have missed that. Thank you again!

lucid raft
swift hearth
#

@lucid raft - Thank you for helping. I will look further into how to create a payment method on stripe, But this is helpful.

valid grotto
#

the page loads ok but then the fields do not load. <div id="stripe-cvc-element" class="wc-stripe-elements-field">
<!-- a Stripe Element will be inserted here. -->
</div>

lucid raft
valid grotto
lucid raft
valid grotto
echo pollen
#

I see a "recent error" on my Developers dashboard, but when I click on it, no info loads. I tried clearing the filters and still don't see it

bleak breach
echo pollen
bleak breach
#

hmm and when you click on it nothing happens? Do you get an error?

echo pollen
#

No, the Logs tab loads with 4 filters set (Date/Status/This Account/Outgoing Connect requests) with "No Results"

#

clearing all filters on the failed tab doesn't show it

bleak breach
#

What's your account ID? I can have a look from our end

echo pollen
#

is that the acct_ value? I can post that without too much issue then?

bleak breach
#

You can't do anything with an account ID without the corresponding secret API key ๐Ÿ™‚

#

Unless you work at Stripe, which I do

echo pollen
#

ah okay ๐Ÿ™‚

#

acct_1HElt4KBxM5FymZf

#

would have been at 4:07 PM PST

#

(or is it PDT??? I never know)

bleak breach
#

In test mode, right?

echo pollen
#

no, this is live

bleak breach
#

Yeah this is odd

#

I'm seeing the same thing, I'm just looking into whether this is a dashboard bug

echo pollen
#

I do see that we had a terminal used for a purchase around then

#

just wondering if it's a me issue, or if it was something the staff did

bleak breach
#

I have no idea why this isn't showing up on Dashboard and I'm going to file a bug report for this, but you did have an error on 2021-07-20 23:07:32 UTC with the following error message:

{
  error: {
    message: "The Stripe Terminal ConnectionToken has expired. Please generate a new one using v1/terminal/connection_tokens.",
    type: "invalid_request_error"
  }
}
#

As far as errors go no biggie, you probably already fixed it by getting a new ConnectionToken and activating the device before it expired

echo pollen
#

If I had to guess, staff had our "store purchase" page up for a loooooong time and then tried to run a transaction

#

thanks!

bleak breach
#

yeah I don't think there's anything wrong with your integration, just a user error ๐Ÿ™‚

vocal wagon
#

What's the proper way to request line items?

#
const session = await stripe.checkout.sessions.retrieve(eventObject.id, line_items=true); ?
bleak breach
vocal wagon
#

oh!

#

perfect

#

I've seen so many docs they're all mess in my head by now

#

thank you

bleak breach
#

tl;dr you'd want:

const session = await stripe.checkout.sessions.retrieve(eventObject.id, { expand: ['line_items'] });
hollow nebula
#

Hello, for the invoice receipt email we send the customer, is it possible to have a custom invoice number?

vocal wagon
#

stripe dev help is probably the best support discord i've encountered

valid grotto
bleak breach
valid grotto
#

@lucid raft When you first load the page all the fields are there as well showing the correct placeholders. the fields disappear shortly after page load though.

bleak breach
sacred crest
#

Hey all, I have an API that handles two Stripe events: ['checkout.session.completed', 'invoice.paid'].

For context, although you may already know, Stripe sends webhook requests in random order (or at least they are received in random order) which creates complexity for consumers (e.g. me).

What's the best way to manage race conditions?

Here are two ways that I've thought of myself, which have proven to be insufficient solutions:

  1. Send Stripe a 500 Internal Server Error to force a webhook request retry (which takes an hour for the second request to take place).
  2. Create application logic that deals with this complexity. In my case, I create "Customer" and "Payment" records in my own database (I'm using Prisma ORM). Because "Payment" records require a "CustomerId" on create, I'm required to create the "Customer" record in a place where I don't have all of the required information. Long story short, because Prisma ORM doesn't support table locking out of the box, I'm SOL for this approach.
smoky ledge
#

Does Stripe offer a public bug tracker?

valid grotto
bleak breach
bleak breach
smoky ledge
#

It's already reported; just was curious if it was fixed.

bleak breach
smoky ledge
#

Sure yeah; it's a Tax Bug where it replicates price points with the same exclusive and inclusive settings respectively. (inside invoivces)

bleak breach
# sacred crest Hey all, I have an API that handles two Stripe events: ['checkout.session.comple...

Definitely don't recommend sending 500s ever, as that can cause your webhook endpoint to be disabled if it happens too often. We recommend implementing a queue system where if the event is out of order (which should be rare) you "queue" the event to revisit once the expected event has been received: https://stripe.com/docs/webhooks/best-practices#event-ordering

sacred crest
# bleak breach Definitely don't recommend sending 500s ever, as that can cause your webhook end...

Understood. What are some of the best practices you've seen with the "queue" approach? Does the aforementioned approach eliminate the need for database table locking? Lastly, does this approach eliminate the benefit of webhook retries if something goes wrong with a 5xx error (since you'd be sending off the initial request to a background process and sending a 200 back to Stripe immeditately)?

bleak breach
# sacred crest Understood. What are some of the best practices you've seen with the "queue" app...

The queue approach is similar to what you mentioned (returning a 500 to Stripe so Stripe retries the event later) except it's all internal to your systems rather than relying on Stripe. You essentially push the event to the back of your queue to be processed later, preferably after the missing event has landed and been processed.

In general you should avoid returning a 500 at all, as anything but a 200 response instructs Stripe to try again later. Too many non-200s will cause Stripe to automatically disable your webhook endpoint. Even if you send the event to a background progress you still received the event and should acknowledge that as such to Stripe.

Another option is if you get an out of order event is to retrieve the object in question directly, which is guaranteed to be up-to-date and reflect that object's most recent state.

bleak breach
smoky ledge
#

(inside support itself)

#

Jessica confirmed it

bleak breach
#

Can you give me your account ID? I should be able to find it then

smoky ledge
#

Sure; one second.

bleak breach
#

Thanks! Back in a sec

smoky ledge
#

Of course;

bleak breach
sacred crest
copper panther
#

How do people generally get the Strip service fees back at the time of charge? It looks like the only option is either by immediately calling a balance_transaction request or via webhook. Webhook I'm guessing is the only real option but am I missing something? No way to get that back with a charge return? What is considered best practice for this?

lucid raft
lucid raft
echo pollen
#

last question of the night for me, creating a payment intent with confirm=true,offsession=true,paymentmethod=pmWhatever is functionally the same thing as creating the payment intent WITHOUT those values, and then confirming with them?

sacred crest
lucid raft
copper panther
# lucid raft See this https://support.stripe.com/questions/passing-the-stripe-fee-on-to-custo...

Thanks but the scenario is for connected accounts. The fee is x-y% + z cents. The issue we are running into is that in order to update our sales reporting accurately to reflect what is paid out to the connected account, we need to know the actual Stripe processing fee and it can vary. We need that info returned back to store in our DB else we run the risk of bad info (guess that is not updated). Make sense? Seems like it would be best to have that returned with the charge object but it is not. Am I not seeing something? Thanks

lucid raft
echo pollen
lucid raft
lucid raft
echo pollen
#

charge.succeeded

#

but I was originally creating the payment intent with confirm/the method/off session, but now I'll create the payment intent first, grab the Id and then confirm off session if needed

lucid raft
#

@echo pollen what information are you storing in your DB? Payment_Intent ID ?

copper panther
# lucid raft <@!867196184480710656> I think it varies depends on the payment method types? e...

1My apologies. I'm not understanding the logic. Let's say our client has connected to our platform with a Standard account. We are just calculating a platform fee based on our agrement and charging that. We then need to know how much the Stripe fees are so that we can add that to our database so they have an accurate itemized sales report - Total Sale | Platform fee | Stripe Fees | The client's net. We are aware of the balance_transaction but that is a separate call after the charge info has been returned. This leaves us with having to either insert incomplete or "best guestimate" Stripe fee and client net amounts and make another call to balance_ transaction (two calls for each charg?) or rely on a webhook which adds a possible point of failure to update if something goes wrong. FYI - the balance_transaction call directly after the charge throws an error evidently due to some latency in the system. None if this seems ideal by any stretch. This is why I think we may be missing something. Is there a way to get the charge confirmation and Stripe fees back in the same call. If not, what is best practice?

echo pollen
#

I have information about what invoices are being paid for, and by whom (since our setup allows for the invoiced person to pay, or their boss if they are feeling nice), at what time, ect. But yes, I store the payment intent id and the stripe customer ID if the payment is going to stripe to be processed (aka all payments but Paper Checks)

#

so the webhook fired, but my logic couldn't find the record to process and record as paid/setup payment history/fire off a payment webhook to our invoicing software, because stripe was too fast and I hadn't inserted my record yet :p

lucid raft
echo pollen
#

I was originally going to store the webhook in my job queue table to process later, but creating the intent and getting that Id first seems the better solution for me at this moment

lucid raft
#

@copper panther n1. The fee information WILL be available in the balance_transactions.
Depends on your integration path, are you using Direct charge? destination charge? These will all impact the Total Sale The client's net. not the stripe fees or platform fees.

What you can do to get balance transaction in a Single API call is to use expand feature when you create the charge. https://stripe.com/docs/api/expanding_objects

#

@copper panther but be aware that this single call will only work for synchronous payment like Credit card and you are not using auth and capture

#

rely on a webhook which adds a possible point of failure to update if something goes wrong.

#

Stripe integration heavily relies on webhooks and it is very common integration path.

lucid raft
copper panther
# lucid raft Stripe integration heavily relies on webhooks and it is very common integration ...

Thank you. RE: balance_transactions - yes, understood. It is the having to make a separate call at a later time that was bugging us. Good information with the expanding responses. I was not aware of that. Do you know if the Stripe fee is even available at the time of charge? If so, this will work. We are using single call synchronous CC payments as of now as well. Either way, we will weigh the benefits/uture limitations of that vs. webhooks.

echo pollen
#

yeah a few different ways to make it work, I'm brainstorming for tomorrow morning now

#

I just can't babysit my internal DB logs watching for the error I throw when stripe sends me a webhook for a payment intent I don't "know" about yet

lucid raft
#

Do you know if the Stripe fee is even available at the time of charge? If so, this will work.
It is immediately available for synchronous payment like Credit card and you are not using auth and capture \

#

@copper panther ^

echo pollen
#

I'm glad I caught it today, vs having to try to hunt it down a month from now when the accountant does some reconciliation work

lucid raft
#

@copper panther and it is available for blended fees like x% + zcents; some merchants are using IC+, the fee will not be immediately available

lucid raft
# echo pollen I just can't babysit my internal DB logs watching for the error I throw when str...

Another thing you can try is use the metadata when create payment_intent. The metadata contains some of your internal reference ids. In this case, you get the event with the internal reference ID, you will know if you make that request or not. https://stripe.com/docs/api/metadata

echo pollen
#

yeah, thinking of what works best for me

hollow nebula
#

How can I know that the trial has ended? I couldn't find a proper webhook event

golden cosmos
hollow nebula
#

@golden cosmos Thank you for the quick response. I like to get an event just when the trial ends. 3 days before is good, but in my case I like to get notified of the exact time trial ends. I have set cancel_at_period_end for the trial subscription. So, will I get notified using customer.subscription.deleted webhook?

golden cosmos
green notch
#

For SCA to work in an iframe, I need the right server side response, if I'm using elements?

#

My code is erroring out with the "authentication required" when using a test card requiring SCA

#

(Also I finally got the publishable test key)

golden cosmos
#

@hollow nebula yep! looks like you'll get a customer.subscription.deleted if you set cancel_at_period_end

hollow nebula
#

Great, thanks for the help

golden cosmos
#

hello @green notch! are you following the documentation here : https://stripe.com/docs/payments/3d-secure#custom-iframe when attempting to display an iframe for your customers to authenticate? would you happen to have a sample of your code which we're able to use to replicate the issue you're seeing?

green notch
#

Currently the frontend is not designed to handle SCA

golden cosmos
green notch
#

I'm confused about the docs. Is there a way to get the SCA website to be shown from the frontend, or should the backend send the site?

kindred frigate
#

hello,
I am getting below issue when try to call stripe checkout API in c#

dry hatch
#

If you provide a request Id we can check how it went

kindred frigate
dry hatch
golden cosmos
green notch
golden cosmos
#

@green notch yep that's right!

green notch
#

Our current setup is such that we just send our server a request and then that handles the rest

#

So I guess the backend needs working too

dry hatch