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

Cancel reader action #708

Open
romanornr opened this issue Jan 10, 2025 · 0 comments
Open

Cancel reader action #708

romanornr opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@romanornr
Copy link

romanornr commented Jan 10, 2025

What happened?

When I try to cancel with this code

app.post('/readers/cancel-action', async (req, res) => {
    try {
        const {readerId} = req.body;
        const canceledReader = await stripe.terminal.readers.cancelAction(readerId);
        res.json(canceledReader);
    } catch (error) {
        console.error('Error canceling reader action:', error);
        res.status(500).json({error: 'Failed to cancel reader action'});
    }
});

I get

    at generateV1Error (/home/romano/github/stripe-terminal/legacy-backend/node_modules/stripe/cjs/Error.js:11:20)
    at res.toJSON.then.Error_js_1.StripeAPIError.message (/home/romano/github/stripe-terminal/legacy-backend/node_modules/stripe/cjs/RequestSender.js:108:62)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  type: 'StripeInvalidRequestError',
  raw: {
    message: 'Reader is currently processing a transaction from a different integration mode.',
    request_log_url: 'https://dashboard.stripe.com/logs/req_KT7XTssYPZTsIc?t=1736521054',
    type: 'invalid_request_error',
    headers: {
      server: 'nginx',
      date: 'Fri, 10 Jan 2025 14:57:34 GMT',
      'content-type': 'application/json',
      'content-length': '247',
      connection: 'keep-alive',
      '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-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=4AoX2tSJ9Hru991LD4OI9RYr7TDRuF89WIUovYo20X3UMNpPRTBxcOP7LXoxd-cCHRapG3OBAw%3D%3D",
      'cross-origin-opener-policy-report-only': 'same-origin; report-to="coop"',
      'idempotency-key': 'stripe-node-retry-f8660cbf-c480-40d4-b577-53dbf72f66ac',
      'original-request': 'req_KT7XTssYPZTsIc',
      '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_KT7XTssYPZTsIc',
      'stripe-should-retry': 'false',
      'stripe-version': '2024-09-30.acacia',
      vary: 'Origin',
      'x-content-type-options': 'nosniff',
      'x-stripe-priority-routing-enabled': 'true',
      'x-stripe-routing-context-priority-tier': 'livemode-critical',
      'x-wc': 'AB',
      'strict-transport-security': 'max-age=63072000; includeSubDomains; preload'
    },
    statusCode: 400,
    requestId: 'req_KT7XTssYPZTsIc'
  },
  rawType: 'invalid_request_error',
  code: undefined,
  doc_url: undefined,
  param: undefined,
  detail: undefined,
  headers: {
    server: 'nginx',
    date: 'Fri, 10 Jan 2025 14:57:34 GMT',
    'content-type': 'application/json',
    'content-length': '247',
    connection: 'keep-alive',
    '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-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=4AoX2tSJ9Hru991LD4OI9RYr7TDRuF89WIUovYo20X3UMNpPRTBxcOP7LXoxd-cCHRapG3OBAw%3D%3D",
    'cross-origin-opener-policy-report-only': 'same-origin; report-to="coop"',
    'idempotency-key': 'stripe-node-retry-f8660cbf-c480-40d4-b577-53dbf72f66ac',
    'original-request': 'req_KT7XTssYPZTsIc',
    '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_KT7XTssYPZTsIc',
    'stripe-should-retry': 'false',
    'stripe-version': '2024-09-30.acacia',
    vary: 'Origin',
    'x-content-type-options': 'nosniff',
    'x-stripe-priority-routing-enabled': 'true',
    'x-stripe-routing-context-priority-tier': 'livemode-critical',
    'x-wc': 'AB',
    'strict-transport-security': 'max-age=63072000; includeSubDomains; preload'
  },
  requestId: 'req_KT7XTssYPZTsIc',
  statusCode: 400,
  userMessage: undefined,
  charge: undefined,
  decline_code: undefined,
  payment_intent: undefined,
  payment_method: undefined,
  payment_method_type: undefined,
  setup_intent: undefined,
  source: undefined
}

The reader stays stuck and shows to tap with card. I can cancel the payment intent but clearing out the reader is another problem. There's no cancel button on the stripe reader either

Environment

No response

Reproduction

No response

@romanornr romanornr added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant