Giter Site home page Giter Site logo

Comments (4)

Nouman-Javaid avatar Nouman-Javaid commented on June 10, 2024 1

I am facing the same error i- e
[Error: AbortError]

Did anyone find any solution?

from react-native-payments.

dfragosodiaz avatar dfragosodiaz commented on June 10, 2024 1

Hi! Our team is also getting a similar issue where the app crashes when using apple pay. Does anyone have any idea of why this might be happening? Did something change lately with this package that might be causing problems interacting with ApplePay?

from react-native-payments.

hivie7510 avatar hivie7510 commented on June 10, 2024

I wish I could get this far. Even using your code I am stuck at null is not an object (evaluating 'ReactNativePayments.createPaymentRequest'). I know this is a week later, but if you see this do you have anything that you remember that would have caused this issue.

from react-native-payments.

sagarjeu avatar sagarjeu commented on June 10, 2024

[Error: AbortError]
on simulator iphone 14 for merchantIdentifier: 'merchant.apple.test',

ApplepayAPi() {
const METHOD_DATA = [
{
supportedMethods: ['apple-pay'],
data: {
merchantIdentifier: 'merchant.apple.test',
supportedNetworks: ['visa'],
countryCode: 'US',
currencyCode: 'USD',
},
},
];
const DETAILS = {
id: 'example',
displayItems: [
{
label: 'Movie Ticket',
amount: {currency: 'USD', value: '15.00'},
},
],
total: {
label: 'Merchant Name',
amount: {currency: 'USD', value: '15.00'},
},
};
const OPTIONS = {
requestPayerName: false,
requestPayerPhone: false,
requestPayerEmail: false,
requestShipping: false,
};
let paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS, OPTIONS);

paymentRequest.addEventListener('shippingaddresschange', e => {
  const updatedDetails = getUpdatedDetailsForShippingAddress(
    paymentRequest.shippingAddress,
  );

  e.updateWith(updatedDetails);
});

paymentRequest.addEventListener('shippingoptionchange', e => {
  const updatedDetails = getUpdatedDetailsForShippingOption(
    paymentRequest.shippingOption,
  );

  e.updateWith(updatedDetails);
});

paymentRequest
  .canMakePayments()
  .then(canMakePayment => {
    if (canMakePayment) {
      console.log('Can Make Payment');
      paymentRequest
        .show()
        .then(paymentResponse => {
          // Your payment processing code goes here
          paymentResponse.complete('success');
          Alert.alert('Payment Complete');
        })
        .catch(error => {
          console.log('Show Error', error);
        });
    } else {
      console.log('Cant Make Payment');
    }
  })
  .catch(error => {
    console.log('Can Make Payments Error', error);
  });

}

from react-native-payments.

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.