Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canceling the payment directly from the application is not working as expected. #535

Open
arbaz8dots opened this issue Dec 2, 2024 · 2 comments

Comments

@arbaz8dots
Copy link

Summary

Cancel payment from application not working

Code to reproduce

Terminal.getInstance().cancelPaymentIntent(paymentIntent!!,object :PaymentIntentCallback{
override fun onFailure(e: TerminalException) {

        }

        override fun onSuccess(paymentIntent: PaymentIntent) {
            Terminal.getInstance().clearReaderDisplay(object :Callback{
                override fun onFailure(e: TerminalException) {
                    
                }

                override fun onSuccess() {
                    
                }

            })
        }
    }) 

Android version

Impacted devices (Android devices or readers)

SDK version

3.9.3

Other information

I attempted two methods: first, canceling the payment using the SDK and then clearing the display, and second, canceling the payment through the API followed by clearing the display.

@arbaz8dots arbaz8dots changed the title Cancel payment from application not working Canceling the payment directly from the application is not working as expected. Dec 2, 2024
@xiaoshen-stripe
Copy link
Contributor

Hi @arbaz8dots can we get some further detail to help investigate further?
Some helpful information would be: stack trace, PI ids, reader serial number and more details on the reproduction steps. Also, can you include what you feel the expected behavior should be?

@khiemvu
Copy link

khiemvu commented Jan 4, 2025

I am experiencing the same issue on version 3.10.1. The payment intent was generated with the status: "PaymentIntentStatus.requiresPaymentMethod".
My reader serial number is STRM26142031317 (and also applies to STRM26142031318 and STRM26138009267).

I/RestResponse(19288): REST response with code 200 received
I/RestResponse(19288): request-id: req_xBS4MUcCzeuy76
I/StripeTerminal(19288): class=RestClient message="url=https://api.stripe.com/v1/payment_intents/pi_3QdRvZRxZK17QACE0cTK4MAp status=OK headers={access-control-allow-credentials=true, access-control-allow-methods=GET, HEAD, PUT, PATCH, POST, DELETE, access-control-allow-origin=*, access-control-expose-headers=Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required, access-control-max-age=300, cache-control=no-cache, no-store, content-length=1872, content-security-policy=base-uri 'none'; default-src 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self'; upgrade-insecure-requests; report-uri /csp-violation https://q.stripe.com/csp-violation?q=70aPkREZadsAvDKTEcVk18h3_yqW3YFAVwPYZ9xFZ6r1ueCrIHq3uOQ56UlQKDrQt2rpeZ0Jxg%3D%3D, content-type=application/json, cross-origin-opener-policy-report-only=same-origin; report-to="coop", date=Sat, 04 Jan 2025 07:37:46 GMT, idempotency-key=1735976263795STRM26142031317hlTv7XR9, report-to={"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}, reporting-endpoints=coop="https://q.stripe.com/coop-report", request-id=req_xBS4MUcCzeuy76, server=nginx, strict-transport-security=max-age=63072000; includeSubDomains; preload, stripe-account=acct_1OwlwgRxZK17QACE, stripe-version=2019-02-19, vary=Origin, x-content-type-options=nosniff, x-stripe-priority-routing-enabled=true, x-stripe-routing-context-priority-tier=api-testmode, x-wc=AB} response={"amount":"1350","amountCapturable":"0","amountDetails":{"tip":{}},"amountReceived":"0","applicationFeeAmount":"209","captureMethod":"manual","charges":{"hasMore":false,"totalCount":0},"created":"1735976265","currency":"usd","id":"pi_3QdRvZRxZK17QACE0cTK4MAp","livemode":false,"metadata":{"attendee_name":"","cart_id":"24841","event_names":"New Happy Dad and Son 6 :Shrunk","gift_cart_names":"N/A","is_ticket":"true","passes_names":"N/A","ticket_currency":"usd","ticket_level_names":"T1","total_ticket":"1","venue_email":"","venue_id":"90","venue_name":"City Theater "},"paymentMethodOptions":{"cardPresent":{"requestExtendedAuthorization":false,"requestIncrementalAuthorizationSupport":false}},"paymentMethodTypes":["card_present"],"status":"requires_payment_method","__redacted_fields":["clientSecret"]}"
V/QueueFileCollector(19288): terminal_sdk_wire_metrics batch of size 2 generated.
V/BatchDispatcher(19288): Flushed successfully.
V/QueueFileCollector(19288): terminal_sdk_wire_metrics removed 2 entries.
V/QueueFileCollector(19288): terminal_sdk_wire_traces_2 batch of size 2 generated.
V/BatchDispatcher(19288): Flushed successfully.
V/QueueFileCollector(19288): terminal_sdk_wire_traces_2 removed 2 entries.
D/StripeTerminal(19288): class=Terminal message=collectPaymentMethod config="CollectConfiguration(skipTipping=false, moto=false, updatePaymentIntent=false, tippingConfiguration=null, enableCustomerCancellation=false, requestDynamicCurrencyConversion=false, surchargeNotice=null, allowRedisplay=null)"
D/StripeTerminal(19288): class=TerminalSession message=collectPaymentMethodWithExplicitAllowRedisplay config="CollectConfiguration(skipTipping=false, moto=false, updatePaymentIntent=false, tippingConfiguration=null, enableCustomerCancellation=false, requestDynamicCurrencyConversion=false, surchargeNotice=null, allowRedisplay=null)"
I/StripeTerminal(19288): class=TerminalSession message=enqueueOperation operation=CollectPaymentMethodOperation
V/QueueFileCollector(19288): terminal_sdk_wire_metrics batch of size 1 generated.
V/BatchDispatcher(19288): Flushed successfully.
V/QueueFileCollector(19288): terminal_sdk_wire_metrics removed 1 entries.
V/QueueFileCollector(19288): terminal_sdk_wire_traces_2 batch of size 1 generated.
V/BatchDispatcher(19288): Flushed successfully.
V/QueueFileCollector(19288): terminal_sdk_wire_traces_2 removed 1 entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants