pikaju / flutter-braintree

Flutter plugin that wraps the native Braintree SDKs. Enables payments with credit cards, PayPal, Google Pay and more.
https://pub.dev/packages/flutter_braintree
MIT License
64 stars 116 forks source link

Error: Functions did not deploy properly. HELP #89

Open developer-farhan opened 2 years ago

developer-farhan commented 2 years ago

here's my cloud function but when I deploy it I get functions did not deploy properly I don't know what to do help

** const functions = require("firebase-functions");

const braintree = require('braintree');

var gateway = new braintree.BraintreeGateway({ environment: braintree.Environment.Sandbox, merchantId: 'cr2s5pwdwhrvb63k', publicKey: 'pqyp57ptchh7g83k', privateKey: '3b1cabd33c7da9d2db73cda178c05355' });

exports.paypalPayment = functions.https.onRequest(async (req,res)=>{ const nonceFromTheClient = req.body.payment_method_nonce; const deviceData = req.body.device_data;

gateway.transaction.sale({ amount: "10.00", paymentMethodNonce: 'fake-valid-nonce', deviceData: deviceData, // options: { // submitForSettlement: true // } },(err,result)=>{

if(err!=null){ console.log(err); }else{ res.json({ result:'Success' });} }); });

**