#TheMakerTeam-session
1 messages ยท Page 1 of 1 (latest)
You may want to double check if you are using correct Stripe Account
First, let's look at your account request log to see the error
This is a payment to one of my connected accounts in test mode. So, I guess I am confused by your comment as to what I need to look at here?
I only have a single account
What type of your connected account? And did you use Destination Charge?
I used an express account and it is not a destination charge
How did you initialize the Checkout Session?
Here is the log error message:{
"error": {
"message": "Invalid checkout.session id: cs_test_a1FjSlA9NQhrC57NzIyjMiyU3IPA1Rqi4kJJMTCooUBiQ4RHRYsgql4BVK",
"type": "invalid_request_error"
}
}
I created a payment intent and then passed the user to the URL returned by the creation of the intent
Here is my code for this
Dim myamount As Integer = Request.Form("amount")
Dim optionstt = New SessionCreateOptions With {
.LineItems = New List(Of SessionLineItemOptions) From {
New SessionLineItemOptions With {
.Amount = Request.Form("amount") + "00",
.Quantity = 1,
.Currency = "USD",
.Name = "Donation"
}
},
.Mode = "payment",
.SuccessUrl = "https://helpmeabort.com/ccapv.aspx?session_id={CHECKOUT_SESSION_ID}",
.CancelUrl = "https://helpmeabort.com/cancelcc.aspx",
.PaymentIntentData = New SessionPaymentIntentDataOptions With {
.ApplicationFeeAmount = (myamount * 0.2).ToString + "00"
}
}
Dim requestOptions = New RequestOptions With {
.StripeAccount = myaccount
}
Dim sessionservice = New SessionService()
Dim sessionss As Session = sessionservice.Create(optionstt, requestOptions)
' Dim j As Object = New JavaScriptSerializer().Deserialize(Of Object)(sessionss.ToString)
Dim j As Object = New JavaScriptSerializer().Deserialize(Of Object)(sessionss.ToJson)
I should not that this transaction runs fine and returns me to the ccapv.aspx with the CHECKOUT_SESSION_ID passed in the URL string
sorry NOTE
You are using a Stripe Account header
Dim requestOptions = New RequestOptions With {
.StripeAccount = myaccount
}
means this is a Direct Charge. You shouldn't use Direct Charge with express account.
Direct Charge is for Standard Account. For express you should use Destination Charge instead
We want the money to go directly to the connected account with our fee taken out
I guess I am confused here. The transaction is working perfectly I just can not retrieve the results on the success page
Yeah that's a common reason for doing that, but you will have more problems later on, including but not limited to:
- Express accounts can't handle dispute
- You will need to cover negative balance for express accounts
- These charges aren't compatible with Radar
- You can't easily get metrics
Yeah it's working technically. I can help you on retrieving the result, but I just want to heads-up that you are running into an unrecommended integration path
For retrieving the object, because it's a Direct Charge and the Checkout Session lives under your connected account, you will need to retrieve also with a Stripe Account header
Sure, just like you did
Dim requestOptions = New RequestOptions With {
.StripeAccount = myaccount
}
Include this into the Retrieve Checkout Session API that you got invalid error (Service.Get(Request.QueryString("session_id")) it)
Give me a sec to look at it
I see what you mean. I will give that a shot thank you
I am having a problem with this approach here is the code for this
Dim requestOptions = New RequestOptions With {
.StripeAccount = Session("myaccount")
}
Dim Service = New SessionService()
Dim myservice = Service.Get(Request.QueryString("session_id"), requestOptions)
it is saying the Value of type 'RequestOption' can not be converted to type 'SessionGetOptions'
Still here?
Hey, yes looking. It should be working if you use Session object but one of my colleague will be joining soon and they have a bit more Java experience
I am looking at the SDK README https://github.com/stripe/stripe-java#per-request-configuration
I am using .NET
๐ Taking over from Orakaro, catching up now
Awesome
Can you try changing to following?
Dim myservice = Service.Get(Request.QueryString("session_id"), null, requestOptions)
You were setting RequestOptions on SessionGetOptions parameter, so it threw the error: https://github.com/stripe/stripe-dotnet/blob/master/src/Stripe.net/Services/Checkout/Sessions/SessionService.cs#L46-L49
Still throwing the same error Stripe.StripeException: Invalid checkout.session id: cs_test_a1FjSlA9NQhrC57NzIyjMiyU3IPA1Rqi4kJJMTCooUBiQ4RHRYsgql4BVK
Wait give me a sec
That works thank you for your help
No problem! Happy to help ๐
You made my day dude