#Jerald

1 messages · Page 1 of 1 (latest)

trim prismBOT
robust lily
#

Hi! Let me help you with this.

#

Could you please share the complete error message?

jade lichen
#

this error occur when payment intent succeeded event trigger in CLI

robust lily
#

I can't access this endpoint, are you sure your CLI can? Is this on your internal network?

jade lichen
#

yes

robust lily
#

How are you running your command?

jade lichen
#

I configure it using cli

robust lily
#

This looks like your CLI can't access the host.
But please share your webhook endpoint code.

jade lichen
#

How we can test the webhook endpoint is configured correctly

robust lily
#

You can share your code with me.

atomic vigil
#

[HttpPost]
public async Task<IHttpActionResult> WebhookAsync()
{
var stripeInput = await new StreamReader(HttpContext.Current.Request.InputStream).ReadToEndAsync();
var webhookSecretKey = ConfigurationManager.AppSettings["WebhookSecretKey"];

        try
        {
            var stripeEvent = EventUtility.ParseEvent(stripeInput);
            var stripeSignature = HttpContext.Current.Request.Headers["Stripe-Signature"];
            stripeEvent = EventUtility.ConstructEvent(stripeInput, stripeSignature, webhookSecretKey);
            var healthcarePayment = new HealthcarePayment();

            switch (stripeEvent.Type)
            {
                case Events.PaymentIntentProcessing:
                    healthcarePayment.Status = PaymentStatus.Processing;
                    BuildHealthcarePayment(stripeEvent, healthcarePayment);
                    await UpdatePaymentAsync(stripeInput, stripeSignature, healthcarePayment);
                    break;

                case Events.PaymentIntentSucceeded:
                    healthcarePayment.Status = PaymentStatus.Succeeded;
                    BuildHealthcarePayment(stripeEvent, healthcarePayment);
                    await UpdatePaymentAsync(stripeInput, stripeSignature, healthcarePayment);
                    break;

                case Events.PaymentIntentPaymentFailed:
                    healthcarePayment.Status = PaymentStatus.Failed;
                    BuildHealthcarePayment(stripeEvent, healthcarePayment);
                    await UpdatePaymentAsync(stripeInput, stripeSignature, healthcarePayment);
                    break;
            }

            return Ok();
        }
#

what is the meaning of EOF? in stripe

robust lily
atomic vigil
#

in my code why its throw EOF error? do you have any idea

robust lily
#

By looking at it, no.
What docs have you been following?

atomic vigil
#

Stripe docs

robust lily
#

I understand, which one exactly?

atomic vigil
robust lily
#

I don't see anything unusual.
Could you try putting logs in your code to see if the program even reaches your webhook code.

atomic vigil
#

what you think when the inputstraem is empty then I think we will get EOF error

trim prismBOT
lunar rune
#

not sure, there's not really enough information to work with here

#

sometimes you get this if for example you are trying to visit your URL in your browser directly instead of actually sending a POST request, for example.

atomic vigil
#

is this because https?