#TheMakerTeam-session

1 messages ยท Page 1 of 1 (latest)

velvet reef
#

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

quasi crow
#

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

velvet reef
#

What type of your connected account? And did you use Destination Charge?

quasi crow
#

I used an express account and it is not a destination charge

velvet reef
#

How did you initialize the Checkout Session?

quasi crow
#

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

velvet reef
#

Do you mean created a Checkout Session?

#

Payment Intent != Checkout Session

quasi crow
#

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

velvet reef
#

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

quasi crow
#

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

velvet reef
#

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

quasi crow
#

I completely understand your point

#

Can you elaborate on the Stripe Header for me?

velvet reef
#

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)

quasi crow
#

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?

velvet reef
#

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

quasi crow
#

I am using .NET

karmic aspen
#

๐Ÿ‘‹ Taking over from Orakaro, catching up now

quasi crow
#

Awesome

karmic aspen
#

Can you try changing to following?

  Dim myservice = Service.Get(Request.QueryString("session_id"), null, requestOptions)
quasi crow
#

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

karmic aspen
#

No problem! Happy to help ๐Ÿ™‚

quasi crow
#

You made my day dude