Open developer-farhan opened 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' });} }); });
**
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' });} }); });
**