Skip to content
This repository was archived by the owner on Apr 19, 2022. It is now read-only.
This repository was archived by the owner on Apr 19, 2022. It is now read-only.

canMakePayment is not return promise as its throwing undefined when used with .then #175

@m-nathani

Description

@m-nathani

Bug report

Describe the bug

i am using the below stripe version and integrated payment request button, however got a error canMakePayment returun null or false .. as the promise is showing as undefined.

    "@stripe/react-stripe-js": "^1.6.0",
    "@stripe/stripe-js": "^1.19.1",
TypeError: o.canMakePayment().then((function(t){t&&e&&l(!0)})).finally is not a function. (In 
'o.canMakePayment().then((function(t){t&&e&&l(!0)})).finally((function(){p(!1)}))', 'o.canMakePayment().then(
(function(t){t&&e&&l(!0)})).finally' is undefin...

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

It should return promise in every case to make the return consistent, and if its not supported then it should throw an error that could be catched in promise

System information

  • browser: Mobile Safari 10.0
  • browser.name: Mobile Safari
  • device.family: iPad
  • os: iOS 10.3.3
  • Server environment: Node

Additional context

this is the code i am using to check the canMakePayment on the payementRequest

    if (paymentRequest) {
      paymentRequest
        .canMakePayment()
        .then((res) => {
          if (res && subscribed) {
            setCanMakePayment(true);
          }
        })
        .finally(() => {
          setPaymentLoading(false);
        });
    }

Got this exception on my client using sentry..

TypeError: o.canMakePayment().then((function(t){t&&e&&l(!0)})).finally is not a function. (In 
'o.canMakePayment().then((function(t){t&&e&&l(!0)})).finally((function(){p(!1)}))', 'o.canMakePayment().then((
function(t) {t&&e&&l(!0)})).finally' is undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions