#Kade

1 messages · Page 1 of 1 (latest)

keen widgetBOT
junior kelp
#

hello! how can I help?

lavish forge
#

When I tried to pay with my card using the Stripe Pos_E model,
A window appears on the Stripe Pos_E model that fails to pay.
But I couldn't get any error code in my program.

#

On the Payment page, it just says Imcomplete.

junior kelp
#

can you share a picture of what that looks like?

lavish forge
#

And below is my code.

#

I couldn't get any error information even if I received information about PaymentID.

junior kelp
#

can you share the request id for that error message?

lavish forge
#

the paymentID is pi_3NdSMhLOsQno84zQ1T3pIcsF

#

Can't I upload the information about paymentid?
If so, I will delete it.

junior kelp
#

it's fine, there's nothing sensitive about a PaymentIntent id

lavish forge
#

OK. I see.

junior kelp
#

i think you need to trace through your own code prior to this part - where is the section that you confirm the PaymentIntent and what's the response that you receive?

lavish forge
#

This is the code that brings information about the payment.

#

// PaymentIntent 조회
var service = new PaymentIntentService();
var paymentIntent = service.Get(paymentId);

            // 결제가 성공했는지 확인
            if (paymentIntent.Status == "succeeded")
            {
                // 결제 성공 처리 로직
                dispose();

                Source.Log.log.Info("결제 성공");
                NavigationService.Navigate(new Uri("View/PaymentComplete.xaml", UriKind.RelativeOrAbsolute));
            }
            else if (paymentIntent.Status == "canceled")
            {
                dispose();
                Source.Log.log.Info("결제 취소");
                NavigationService.Navigate(new Uri("View/ChoicePayment.xaml", UriKind.RelativeOrAbsolute));
            }
#

And I checked with both Last PaymentError and Stripexception.

junior kelp
#

@lavish forge can you share what's the response returned when you retrieve that PaymentIntent for var paymentIntent = service.Get(paymentId);

lavish forge
#

I check this

#

But i can't take any response about the last error

#

And in Dashboard paymentpage

#

REspons body is

#

{
"error": {
"code": "incorrect_number",
"doc_url": "https://stripe.com/docs/error-codes/incorrect-number",
"message": "Your card number is incorrect.",
"param": "number",
"request_log_url": "https://dashboard.stripe.com/logs/req_Kn0YvgUvZOgFcJ?t=1691650724",
"type": "card_error"
}
}

Learn more about error codes and how to resolve them.

junior kelp
#

then you need to handle the error based off the response at the point of PaymentIntent confirmation

lavish forge
#

not using paymentIntent.LastPaymentError != null ?

junior kelp
#

like you mentioned, LastPaymentError isn't showing anything, so you need to handle this at the point of PaymentIntent confirmation

lavish forge
#

Then, is there any way to get an error?
LastPaymentError.Inspect Type = "card_error" and PaymentInt.LastPaymentError.Code == "incorrect_number" but no value was received.

#

Or is there a way to detect the signal from Stripe to Reader?

#

I will detect the status in the image

junior kelp
#

hmmm, sorry, i think i got a little bit mixed up before, lets take a couple of steps back.

#

what did you do / which test card did you use to trigger the incorrect_number error?

lavish forge
#

The payment was made using a real card, not a test card.
The payment was made with SamSungPay.

junior kelp
#

give me a while to get back to you

lavish forge
#

I got it!

tranquil comet
#

👋 Could you clarify which Doc you have been following? Is that a server driven flow?

lavish forge
#

server driven is correct.

tranquil comet
#

Okie so you called Proces PaymentIntent on backend, correct?

#

After that did you call Confirm PaymentIntent anywhere?

#

(I guess you don't)

lavish forge
#

you mean Did i use this?
var service = new PaymentIntentService();
service.Get("{{PAYMENT_INTENT_ID}}");

tranquil comet
#

No before that

#

calling ProcessPaymentIntent

lavish forge
#

you mean this?
var options = new ReaderProcessPaymentIntentOptions { PaymentIntent = "pi_xxx" };
var service = new ReaderService();
service.ProcessPaymentIntent("tmr_xxx", options);

tranquil comet
#

Yes

lavish forge
#

I already did it
StripeConfiguration.ApiKey = "";

            var options = new PaymentIntentCreateOptions
            {
                Currency = "CAD",
                PaymentMethodTypes = new List<string> { "card_present" },
                CaptureMethod = "automatic",
                Amount = PageSelect.totalmoney * 100
            };
            Source.Log.log.Info(options);
            var service = new PaymentIntentService();
            var paymentIntent = service.Create(options);

            // PaymentIntent에서 Payment ID 가져오기
            paymentId = paymentIntent.Id;
            Source.Log.log.Info("PaymentID = " + paymentId);

            var options2 = new ReaderProcessPaymentIntentOptions { PaymentIntent = paymentId };

            var service2 = new ReaderService();
            service2.ProcessPaymentIntent("tmr_xxx", options2);
tranquil comet
lavish forge
#

Like the information in that document, the decline signal to the terminal was checked on the paymentpage.

tranquil comet
#

Yes but it's recommended to check via webhook, and you can look at the action block

#

Hope that makes sense!

lavish forge
#

Sorry for the long question.
If so, what is the
var service = new WebhookEndpointService();
service.Create(options);
When I use this to make a webhook, what happens to the respective signals for successful and unsuccessful payments?
Example) failed, success, error, etc.

#

I apologize for the length of this question.

tranquil comet
#

But once you set it up, you can listen to any events come from Stripe

#

And then you can listen to terminal.reader.action_failed as the above Terminal Doc mentioned

ancient sand
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

lavish forge
#

I understand perfectly.
I apologize if I bothered you.
I hope you have a great day.

ancient sand
#

you haven't, please let me know if you need any more help