GithubHelp home page GithubHelp logo

Comments (3)

hsmith825 avatar hsmith825 commented on May 20, 2024

The es6-promise-plugin is installed. For others that run into this problem, I get it to work with statements of the form:
ApplePay.canMakePayments()
.then(function(message) {
// Apple Pay is enabled and a supported card is setup. Expect:
// 'This device can make payments and has a supported card'
console.log(message);
})
.catch(function(message) {
// There is an issue, examine the message to see the details, will be:
// 'This device cannot make payments.''
// 'This device can make payments but has no supported cards'
console.log("message);
});

from cordova-plugin-applepay.

samkelleher avatar samkelleher commented on May 20, 2024

Hi Howard,

Yes you're quite right. It's not the Promise in the older webviews that might be the problem, but it is the arrow functions that is shown in my examples.

The two snippets below are functionally identical.

Works in modern devices, or JavaScript projects using a transpiler:

.then((payment) => { });

Used in older devices, or non-transpiled projects:

.then(function(payment) { });

from cordova-plugin-applepay.

hsmith825 avatar hsmith825 commented on May 20, 2024

Thanks!

From: Sam Kelleher [mailto:[email protected]]
Sent: Monday, May 30, 2016 10:41 AM
To: samkelleher/cordova-plugin-applepay [email protected]
Cc: hsmith825 [email protected]; State change [email protected]
Subject: Re: [samkelleher/cordova-plugin-applepay] Cordova supported platforms lack suport for ES6 Promise (#5)

Hi Howard,

Yes you're quite right. It's not the Promise in the older webviews that might be the problem, but it is the arrow functions https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions that is shown in my examples.

The two snippets below are functionally identical.

Works in modern devices, or JavaScript projects using a transpiler:

.then((payment) => { });

Used in older devices, or non-transpiled projects:

.then(function(payment) { });


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub #5 (comment) , or mute the thread https://github.com/notifications/unsubscribe/ABVFjE0117JDBeJeDxW-PqNvVSDY8Ty3ks5qGyEegaJpZM4Ip0a5 . https://github.com/notifications/beacon/ABVFjDzY-cOOzF_DA5OPU1WCvpQGJ2HHks5qGyEegaJpZM4Ip0a5.gif

from cordova-plugin-applepay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.