Code Monkey home page Code Monkey logo

react-native-make-payment's People

Contributors

dependabot[bot] avatar dmengelt avatar jlugia avatar stephenmcd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-make-payment's Issues

App crash issue: After getting response my app will crash.

import { PaymentRequest as Gpay } from "@google/react-native-make-payment";

const paymentDetails = {
total: {
amount: {
currency: "USD",
value: "14.95",
},
},
};
const googlePayRequest = {
apiVersion: 2,
apiVersionMinor: 0,
allowedPaymentMethods: [
{
type: "CARD",
parameters: {
allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
allowedCardNetworks: ["AMEX", "DISCOVER", "JCB", "MASTERCARD", "VISA"],
},
tokenizationSpecification: {
type: "PAYMENT_GATEWAY",
parameters: {
gateway: "stripe",
"stripe:version": "2018-10-31",
"stripe:publishableKey":
"myPublishertestkey",
},
},
},
],
merchantInfo: {
// merchantId: "01234567890123456789",
merchantId: "",
merchantName: "",
},
transactionInfo: {
totalPriceStatus: "FINAL",
totalPrice: paymentDetails.total.amount.value,
currencyCode: paymentDetails.total.amount.currency,
countryCode: "US",
},
};

const paymentMethods = [
{
supportedMethods: "google_pay",
data: googlePayRequest,
},
];
const GooglePay = new Gpay(paymentMethods, paymentDetails);
function showPaymentForm() {
try {
GooglePay.show()
.then((response) => {
if (response === null) {
console.log("Payment sheet cancelled");
} else {
console.log("REsponse", JSON.stringify(response));
}
})
.catch((error) => {
console.log(paymentRequest.show() error: ${error});
});
} catch (err) {
console.log("final error", err);
}
}

Expo plugin to enable `com.google.android.gms.wallet.api.enabled`

const { AndroidConfig, withAndroidManifest } = require("@expo/config-plugins");

const { addMetaDataItemToMainApplication, getMainApplicationOrThrow } =
  AndroidConfig.Manifest;

/**
 * Adds the following to AndroidManifest.xml:
 *
 * <application>
 *   ...
 *	 <meta-data
 *     android:name="com.google.android.gms.wallet.api.enabled"
 *     android:value="true|false" />
 * </application>
 */
function setGooglePayMetaData(modResults) {
  const GOOGLE_PAY_META_NAME = "com.google.android.gms.wallet.api.enabled";
  const mainApplication = getMainApplicationOrThrow(modResults);

  addMetaDataItemToMainApplication(
    mainApplication,
    GOOGLE_PAY_META_NAME,
    "true",
  );

  return modResults;
}

function withGooglePayAndroid(expoConfig) {
  return withAndroidManifest(expoConfig, (config) => {
    config.modResults = setGooglePayMetaData(config.modResults);
    return config;
  });
}

module.exports = function withGooglePay(config, props) {
  config = withGooglePayAndroid(config, props);
  return config;
};

Error on iOS: cannot find getConstants() of null

Hi, I have added this package in expo app for react native. For android this works perfectly but once I run app on iOS, I was getting this error. cannot find getConstants() of null.

Can you tell me what should I do to get rid of this error on iOS?

Thank you.

[BUG] GooglePayButton ignore props.

Hi, in the example we can see that the button has several arguments, such as radius, type and theme. But in native code, these arguments are ignored, instead default values are used.

 var type = ButtonConstants.ButtonType.BUY
 var theme = ButtonConstants.ButtonTheme.DARK
 var cornerRadius = 10

TransactionDetails

I'm unable to see the transaction details in my response although the tokenization data and payment method everything is there in response but not the transaction details

Impossible to create multiple instances of MakePaymentModule class

When following the instructions for working with Google Pay, you'll need to initialize a payment request instance as follows:
const paymentRequest = new PaymentRequest(paymentMethods, paymentDetails);
which includes payment details which are unique for each payment.
This initialization includes payment details that are unique to each payment transaction. However, when attempting to create a new instance with updated payment details, you may encounter the following issue:

**Possible Unhandled Promise Rejection (id: 0):
Error: You attempted to set the key `softwareInfo` with the value `{"id":"react-native-make-payment","version":"0.1.0"}` on an object that is meant to be immutable and has been frozen.
Error: You attempted to set the key `softwareInfo` with the value `{"id":"react-native-make-payment","version":"0.1.0"}` on an object that is meant to be immutable and has been frozen.**
Screenshot 2023-09-21 at 16 31 17

I kindly request your assistance in resolving this issue or providing instructions on how to bypass it.

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.