paperos-labs / feedback

Just a bug and ideas board
0 stars 0 forks source link

Payment Method Failing #222

Open danielandelin opened 2 years ago

danielandelin commented 2 years ago

User is unable to submit task. Error message doesn't reflect that the payment is failing.

image

danielandelin commented 2 years ago

https://app.savvi.legal/c/596610038/workbench/-1/11712/25530/task-view

wmerfalen commented 2 years ago

Currently, the message that comes up is misleading.

{"status":402,"code":"STRIPE_CARD_ERROR_CARD_DECLINED","message":"Invalid account."}

What's displaying to the user is that they have an "Invalid account.", but in reality, it should tell the user that their card was declined.

With that being said, nothing is broken here. Everything works as expected, you just need to update the message being displayed.

In order to get to this account, you have to sign into admin portal.

On Customer -> Data, type in Barkley Therapeutics

This is the problematic route. https://app.savvi.legal/api/account/transaction/25530/finalize

It is a POST. The curl copy is as follows:

curl 'https://app.savvi.legal/api/account/transaction/25530/finalize' \
  -H 'authority: app.savvi.legal' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'access-control-allow-methods: GET' \
  -H 'access-control-allow-origin: https://app.savvi.legal' \
  -H 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiOiJLR3gxS1NtRFJkX2R3dXdtWm1XaUVzbDlEaDRjNWRRdEZMTHRUbC1VdmxJIiwiYWxnIjoiRVMyNTYifQ.eyJqdGkiOiJyMElYa2FsM2d0RTJ0eXBIbDExYkllIiwic3ViIjo0NzksImlzcyI6Imh0dHBzOi8vYXBwLnNhdnZpLmxlZ2FsIiwiZXhwIjoxNjUwNDg2NDU3LCJhY2NvdW50X2lkIjo1OTY2MTAwMzgsImltcGVyc29uYXRvcl9pZCI6MTUsInNjb3BlIjpbXSwiY29tcGFueSI6IkJhcmtsZXkgVGhlcmFwZXV0aWNzIEluYy4iLCJlbWFpbCI6InJpY2tfYmFya2xleUBudXZvbGEtbmV0d29ya3MuY29tIiwiZ2l2ZW5fbmFtZSI6IlJpY2sgLSBQT1NTRVNTRUQiLCJmYW1pbHlfbmFtZSI6IkJhcmtsZXkgLSBQT1NTRVNTRUQiLCJpYXQiOjE2NTA0MDAwNTd9.FZ7PAJmGKj2HKzgV6b0fzSKgikFDPJnNBxXFJZR_JS4rug9zdrcL8Ld2JIByEdyrtXdgwnX7aeZNa0RJwY9tog' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'cookie: _ga=GA1.2.828486250.1635866495; _fbp=fb.1.1635866494807.1365615348; __stripe_mid=f3a52809-bc3c-4af9-a657-8967185c9e6d7f92c5; hubspotutk=66e4d12e2e015aa84a54e085f8e9c9e2; messagesUtk=451165079a5f4f5c84f5f8dee2c31dbc; messagesUtk=451165079a5f4f5c84f5f8dee2c31dbc; __hssrc=1; _gid=GA1.2.1398865663.1650399367; fs_uid=rs.fullstory.com#H1ZXJ#5652394114048000:6511189925158912/1670108745; __stripe_sid=cfb2c46a-df47-436c-b53f-7f746c60683f00bf60; __hstc=240791004.66e4d12e2e015aa84a54e085f8e9c9e2.1635887274723.1649363855584.1650399370101.58; __hssc=240791004.3.1650399370101' \
  -H 'origin: https://app.savvi.legal' \
  -H 'pragma: no-cache' \
  -H 'referer: https://app.savvi.legal/c/596610038/workbench/-1/11712/25530/task-view' \
  -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36' \
  --data-raw '{"finalize_snapshot":{"Company":[{"resource":"Barkley Therapeutics Inc.","Custom Label":"Company","Company Address":{"line_one":"3685 E St Hwy 29  ","line_two":" ","city":"Llano","state":"Texas","zip":"78643","country":"United States of America"},"Domestic Filing State":"Delaware","Business Description":"Biotech company working on longevity and innovating how to bring drugs to market faster ","EIN":"88-1036906"}],"Director":[{"resource":"Rick Barkley","Custom Label":"Director"}],"Officer":[{"resource":"Rick Barkley","Custom Label":"Officer","Title(s)":"President|CEO|Secretary"}],"State":[{"resource":"Texas","Custom Label":"Operating State","Business Start Date":"04-15-2022"}],"finalized_at":"04/19/2022"},"auto_send":1}' \
  --compressed
wmerfalen commented 2 years ago

Relevant logs that have the account id attached to the user who is experiencing this

Apr 19 00:56:33 prod-2 node[2700938]: ./utils/mysql-one 'SELECT body FROM pandadoc_webhook_log WHERE id = 54137' | jq '.'
Apr 19 00:56:33 prod-2 node[2700938]: [stripe-webhook] processed metadata for 'charge.failed':
Apr 19 00:56:33 prod-2 node[2700938]: {
Apr 19 00:56:33 prod-2 node[2700938]:   customer_id: 'REDACTED',
Apr 19 00:56:33 prod-2 node[2700938]:   savvi_amount: '0',
Apr 19 00:56:33 prod-2 node[2700938]:   fee_amount: '750',
Apr 19 00:56:33 prod-2 node[2700938]:   server: 'app.savvi.legal',
Apr 19 00:56:33 prod-2 node[2700938]:   task_id: '34051',
Apr 19 00:56:33 prod-2 node[2700938]:   user_id: '479',
Apr 19 00:56:33 prod-2 node[2700938]:   account_id: '596610038',
Apr 19 00:56:33 prod-2 node[2700938]:   idempotency_key: '34051Foreign Corporation Filing(Texas) Varies By State55010993'
Apr 19 00:56:33 prod-2 node[2700938]: }
Apr 19 00:56:34 prod-2 node[2700938]: [stripe-webhook] Saving 'customer.subscription.created' hook to DB. Want to inspect it?
Apr 19 00:56:34 prod-2 node[2700938]: ./utils/mysql-one 'SELECT body FROM pandadoc_webhook_log WHERE id = 54138' | jq '.'
Apr 19 00:56:34 prod-2 node[2700938]: [stripe-webhook] processed metadata for 'customer.subscription.created':
Apr 19 00:56:34 prod-2 node[2700938]: undefined
Apr 19 00:56:34 prod-2 node[2700938]: Error in setting hubspot subscription data for account:  null -------- Start Data -------- n>
Apr 19 00:56:34 prod-2 node[2700938]:  Error:  [TypeError: Cannot read properties of undefined (reading 'name')
Apr 19 00:56:34 prod-2 node[2700938]:     updateHubspotSubscri|47  |/src/api/util/huspot-fragments/hubspot-subscriptions.js
Apr 19 00:56:34 prod-2 node[2700938]:     runMicrotasks       |----|vvvvv
Apr 19 00:56:34 prod-2 node[2700938]:     processTicksAndRejec|96  |node:internal/process/task_queues
Apr 19 00:56:34 prod-2 node[2700938]: ]
Apr 19 00:56:34 prod-2 node[2700938]: [stripe-webhook] Saving 'payment_intent.created' hook to DB. Want to inspect it?
Apr 19 00:56:34 prod-2 node[2700938]: ./utils/mysql-one 'SELECT body FROM pandadoc_webhook_log WHERE id = 54139' | jq '.'
Apr 19 00:56:34 prod-2 node[2700938]: [stripe-webhook] no handler for 'payment_intent.created'
Apr 19 00:57:49 prod-2 node[2700938]: [stripe-webhook] Saving 'charge.failed' hook to DB. Want to inspect it?
Apr 19 00:57:49 prod-2 node[2700938]: ./utils/mysql-one 'SELECT body FROM pandadoc_webhook_log WHERE id = 54140' | jq '.'
Apr 19 00:57:49 prod-2 node[2700938]: [stripe-webhook] processed metadata for 'charge.failed':
Apr 19 00:57:49 prod-2 node[2700938]: {
Apr 19 00:57:49 prod-2 node[2700938]:   customer_id: 'REDACTED',
Apr 19 00:57:49 prod-2 node[2700938]:   savvi_amount: '0',
Apr 19 00:57:49 prod-2 node[2700938]:   fee_amount: '750',
Apr 19 00:57:49 prod-2 node[2700938]:   server: 'app.savvi.legal',
Apr 19 00:57:49 prod-2 node[2700938]:   task_id: '34051',
Apr 19 00:57:49 prod-2 node[2700938]:   user_id: '479',
Apr 19 00:57:49 prod-2 node[2700938]:   account_id: '596610038',
Apr 19 00:57:49 prod-2 node[2700938]:   idempotency_key: '34051Foreign Corporation Filing(Texas) Varies By State55010995'
Apr 19 00:57:49 prod-2 node[2700938]: }
Apr 19 00:57:55 prod-2 node[2700938]: Socket remove ws.userId:  479  ws.accountId:  596610038
Apr 19 01:01:52 prod-2 node[2700938]: [stripe-webhook] Saving 'charge.failed' hook to DB. Want to inspect it?
Apr 19 01:01:52 prod-2 node[2700938]: ./utils/mysql-one 'SELECT body FROM pandadoc_webhook_log WHERE id = 54145' | jq '.'
Apr 19 01:01:52 prod-2 node[2700938]: [stripe-webhook] processed metadata for 'charge.failed':
Apr 19 01:01:52 prod-2 node[2700938]: {
Apr 19 01:01:52 prod-2 node[2700938]:   customer_id: 'REDACTED',
Apr 19 01:01:52 prod-2 node[2700938]:   savvi_amount: '0',
Apr 19 01:01:52 prod-2 node[2700938]:   fee_amount: '750',
Apr 19 01:01:52 prod-2 node[2700938]:   server: 'app.savvi.legal',
Apr 19 01:01:52 prod-2 node[2700938]:   task_id: '34051',
Apr 19 01:01:52 prod-2 node[2700938]:   user_id: '479',
Apr 19 01:01:52 prod-2 node[2700938]:   account_id: '596610038',
Apr 19 01:01:52 prod-2 node[2700938]:   idempotency_key: '34051Foreign Corporation Filing(Texas) Varies By State55011003'
Apr 19 01:01:52 prod-2 node[2700938]: }
Apr 19 01:06:56 prod-2 node[2700938]: Socket remove ws.userId:  2124816879  ws.accountId:  372
Apr 19 01:10:54 prod-2 node[2700938]: [pandadoc-webhook] Saving webhook to DB log. Want to inspect it?
Apr 19 01:10:54 prod-2 node[2700938]: ./utils/mysql-one 'SELECT body FROM pandadoc_webhook_log WHERE id = 54147' | jq '.[0].data.m>
Apr 19 01:10:54 prod-2 node[2700938]: Webhook document.sent
Apr 19 01:10:54 prod-2 node[2700938]: Attempting to send message to account:  1046 {
Apr 19 01:10:54 prod-2 node[2700938]:   text: ' :link: *Document Signature Links Generated*\n' +
Apr 19 01:10:54 prod-2 node[2700938]:     ' - IsoTalent, Inc.--Board Consent (Equity Grant) Apr 19th, 2022 links generated.\n' +
Apr 19 01:10:54 prod-2 node[2700938]:     '(rlifferth@isotalent.com, paul@isotalent.com, amiller@isotalent.com, tim@altaglobal.com>
Apr 19 01:10:54 prod-2 node[2700938]:   style: 'normal'
Apr 19 01:10:54 prod-2 node[2700938]: }
Apr 19 01:10:54 prod-2 node[2700938]: []
SHRoberts91 commented 2 years ago

Actually want to fix this on the back end as well before closing.