Firebase와 Braintree를위한 Cloud 기능을 통합 할 수 있는지 확인하려고합니다. the docs에 따라 클라우드 기능을위한 프로젝트를 만들었습니다. 프로젝트 디렉토리에서 나는 다음을 실행했습니다 : npm install braintree
. 내가Braintree와 Firebase의 Cloud 기능 통합
를 찾을 수 없습니다오류 구문 분석 트리거 오류를 가지고이 테스트 기능을 배포하려고 할 때
const functions = require('firebase-functions'); var braintree = require("braintree"); var gateway = braintree.connect({ environment: braintree.Environment.Sandbox, merchantId: "useYourMerchantId", publicKey: "useYourPublicKey", privateKey: "useYourPrivateKey" }); // // Create and Deploy Your First Cloud Functions // // https://firebase.google.com/docs/functions/write-firebase- functions // exports.helloWorld = functions.https.onRequest((request, response) => { response.send("Hello from Firebase!"); //gateway.clientToken.generate({}, function (err, response) { //response.send(response.clientToken); //}); });
: 나는 다음으로 테스트 목적
index.js
을 수정 모듈 '브레인'
저는 Firebase, Cloud Functions 및 node.js를 처음 사용하고 Braintree를 Firebase Functions 프로젝트로 가져 오는 방법에 대한 모든 정보를 제공합니다.
나는 당신이 여기에있는 너무 많은 토대를 다루고 있다고 생각한다. Node.js를 처음 접한다면 Node.js에서 Braintree API를 호출하는 것으로 시작하는 것이 좋습니다. 파이어베이스를 처음 접한다면 파이어베이스와 Node.js SDK (또는 웹 컨텍스트에서 자바 스크립트에 더 익숙한 웹 SDK)와의 상호 작용을 권장합니다. 이 두 가지에 대한 경험이 있으면 클라우드 기능을 믹스에 추가하는 것이 더 나아질 것입니다. –
그렇습니다. 오류의 가능한 원인에 대한 빠른 수정은 아래와 같습니다. :-) –