firebase - Firebase 云功能 paypal 适用于本地主机,但不适用于服务器
问题描述
因此,我在 firebase 云功能中创建了一个节点服务器,并集成了 PayPal-node-sdk。问题是Paypal付款在本地主机的firebase模拟器模式下工作。但是当我进行“firebase deploy”并输入 URL 时。它不会继续并给出错误。
这是现在的代码
const functions = require('firebase-functions');
var paypal = require('paypal-rest-sdk');
paypal.configure({
'mode': 'sandbox', //sandbox or live
'client_id': 'ARsx8xed9TXkfOaRqh3WkeG-uzeFqT0qebkrJKssZkmBh1TWoC1ZYXpzNr8TlBDygpROnAkA8pXVmhl2',
'client_secret': 'SECRET_KEY'
});
exports.helloWorld = functions.https.onRequest((request, response) => {
var create_payment_json = {
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"redirect_urls": {
"return_url": "http://return.url",
"cancel_url": "http://cancel.url"
},
"transactions": [{
"item_list": {
"items": [{
"name": "item",
"sku": "item",
"price": "1.00",
"currency": "USD",
"quantity": 1
}]
},
"amount": {
"currency": "USD",
"total": "1.00"
},
"description": "This is the payment description."
}]
};
paypal.payment.create(create_payment_json, function (error, payment) {
if (error) {
throw error;
} else {
console.log("Create Payment Response");
console.log(payment);
for (var index = 0; index < payment.links.length; index++) {
//Redirect user to this endpoint for redirect url
if (payment.links[index].rel === 'approval_url') {
console.log(payment.links[index].href);
response.redirect(payment.links[index].href);
}
}
}
});
});
这是package.json
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "12"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^9.2.0",
"firebase-functions": "^3.11.0"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.2.0"
},
"private": true
}
这就是它在服务器中的显示方式 在 此处输入图像描述
这里可能是什么问题?
日志文件:
[2020-11-28T20:38:09.374Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2020-11-28T20:38:09.375Z] > authorizing via signed-in user
[2020-11-28T20:38:09.376Z] [iam] checking project safedine-66679 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[2020-11-28T20:38:09.379Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/safedine-66679:testIamPermissions
{"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]}
[2020-11-28T20:38:10.364Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:09 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=625","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:10.366Z] >>> HTTP REQUEST POST https://iam.googleapis.com/v1/projects/safedine-66679/serviceAccounts/safedine-66679@appspot.gserviceaccount.com:testIamPermissions
{"permissions":["iam.serviceAccounts.actAs"]}
[2020-11-28T20:38:11.304Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:10 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
=== Deploying to 'safedine-66679'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint C:\Users\e7cd\Documents\safedinecloudfunctions\functions
> eslint .
+ functions: Finished running predeploy script.
[2020-11-28T20:38:15.476Z] > [functions] package.json contents: {
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "12"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^9.2.0",
"firebase-functions": "^3.11.0"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.2.0"
},
"private": true
}
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
[2020-11-28T20:38:16.873Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/safedine-66679/services/cloudfunctions.googleapis.com
[2020-11-28T20:38:16.873Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/safedine-66679/services/runtimeconfig.googleapis.com
[2020-11-28T20:38:16.874Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/safedine-66679/services/cloudbuild.googleapis.com
[2020-11-28T20:38:18.073Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:17 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:18.102Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:17 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
+ functions: required API cloudbuild.googleapis.com is enabled
[2020-11-28T20:38:18.147Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:17 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
+ functions: required API cloudfunctions.googleapis.com is enabled
[2020-11-28T20:38:18.150Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/safedine-66679/adminSdkConfig
[2020-11-28T20:38:18.628Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:18 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
i functions: preparing functions directory for uploading...
[2020-11-28T20:38:18.630Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/safedine-66679/configs
[2020-11-28T20:38:19.072Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:18 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
i functions: packaged functions (37.56 KB) for uploading
[2020-11-28T20:38:19.249Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/-/functions
[2020-11-28T20:38:19.983Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:19 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:19.984Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/us-central1/functions:generateUploadUrl
[2020-11-28T20:38:20.811Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:20 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:20.812Z] >>> HTTP REQUEST PUT https://storage.googleapis.com/gcf-upload-us-central1-d8bc2486-f64e-4507-b510-b1d84696c343/d0b11078-1545-4bd6-b169-c922d3f11142.zip?GoogleAccessId=service-884835345747@gcf-admin-robot.iam.gserviceaccount.com&Expires=1606597700&Signature=ai0sX4ZEVHlv%2Fj%2Fmgkmc1YtZIHT4XuRU8PvtmonlUGYl5tSJU%2FTfms%2Fyqe9ul0H5hGs7%2FtgwFpbmU1o5rW1HwK4QWZzUIDjkkuS%2BSRowqjzhAFIdJfjDeHpMstXHFZu%2Buwe%2FQPvckIGRalK78kz%2FSLeRphET%2FLMLLqii1iPWpquKdEkQpnSc3wqR0OgxBP6RdGUidJrHlelukJNcB3FH0WruaWgRDfEQkSLLqJ5dINzNssh%2BYpT4LZ6kyhUV0Jk%2F4FJkHroRKP7YhGhw2m0eoPqNRKnwn2qb8vNpff8mZ4OKPN5ANT0yvmEFxLRe6szJl2T7H3f78PsR2WsM84XTFw%3D%3D
<request body omitted>
[2020-11-28T20:38:21.339Z] <<< HTTP RESPONSE 200 {"x-guploader-uploadid":"ABg5-UxNRqvU0vC4ykLP7YdMfyT3wIFx_-8bUO_CoHXy43oH0kXgZIq_mDiQ0F9pqPALaXL0pb3RIY4kxpdk7vIDvg","etag":"\"db38e2617f8e5abfd2e3331528f86eb7\"","x-goog-generation":"1606595900834314","x-goog-metageneration":"1","x-goog-hash":"crc32c=CS+02g==, md5=2zjiYX+OWr/S4zMVKPhutw==","x-goog-stored-content-length":"38464","x-goog-stored-content-encoding":"identity","vary":"Origin","content-length":"0","date":"Sat, 28 Nov 2020 20:38:20 GMT","server":"UploadServer","content-type":"text/html; charset=UTF-8","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""}
+ functions: functions folder uploaded successfully
i functions: updating Node.js 12 function helloWorld(us-central1)...
[2020-11-28T20:38:21.347Z] Trigger is: {"httpsTrigger":{}}
i functions: updating Node.js 12 function success(us-central1)...
[2020-11-28T20:38:21.348Z] Trigger is: {"httpsTrigger":{}}
[2020-11-28T20:38:21.350Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/us-central1/functions/helloWorld {"updateMask":"sourceUploadUrl,name,labels,runtime,environmentVariables,httpsTrigger"}
{"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-d8bc2486-f64e-4507-b510-b1d84696c343/d0b11078-1545-4bd6-b169-c922d3f11142.zip?GoogleAccessId=service-884835345747@gcf-admin-robot.iam.gserviceaccount.com&Expires=1606597700&Signature=ai0sX4ZEVHlv%2Fj%2Fmgkmc1YtZIHT4XuRU8PvtmonlUGYl5tSJU%2FTfms%2Fyqe9ul0H5hGs7%2FtgwFpbmU1o5rW1HwK4QWZzUIDjkkuS%2BSRowqjzhAFIdJfjDeHpMstXHFZu%2Buwe%2FQPvckIGRalK78kz%2FSLeRphET%2FLMLLqii1iPWpquKdEkQpnSc3wqR0OgxBP6RdGUidJrHlelukJNcB3FH0WruaWgRDfEQkSLLqJ5dINzNssh%2BYpT4LZ6kyhUV0Jk%2F4FJkHroRKP7YhGhw2m0eoPqNRKnwn2qb8vNpff8mZ4OKPN5ANT0yvmEFxLRe6szJl2T7H3f78PsR2WsM84XTFw%3D%3D","name":"projects/safedine-66679/locations/us-central1/functions/helloWorld","labels":{"deployment-tool":"cli-firebase"},"httpsTrigger":{},"runtime":"nodejs12","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"safedine-66679\",\"databaseURL\":\"https://safedine-66679.firebaseio.com\",\"storageBucket\":\"safedine-66679.appspot.com\"}"}}
[2020-11-28T20:38:21.351Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/us-central1/functions/success {"updateMask":"sourceUploadUrl,name,labels,runtime,environmentVariables,httpsTrigger"}
{"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-d8bc2486-f64e-4507-b510-b1d84696c343/d0b11078-1545-4bd6-b169-c922d3f11142.zip?GoogleAccessId=service-884835345747@gcf-admin-robot.iam.gserviceaccount.com&Expires=1606597700&Signature=ai0sX4ZEVHlv%2Fj%2Fmgkmc1YtZIHT4XuRU8PvtmonlUGYl5tSJU%2FTfms%2Fyqe9ul0H5hGs7%2FtgwFpbmU1o5rW1HwK4QWZzUIDjkkuS%2BSRowqjzhAFIdJfjDeHpMstXHFZu%2Buwe%2FQPvckIGRalK78kz%2FSLeRphET%2FLMLLqii1iPWpquKdEkQpnSc3wqR0OgxBP6RdGUidJrHlelukJNcB3FH0WruaWgRDfEQkSLLqJ5dINzNssh%2BYpT4LZ6kyhUV0Jk%2F4FJkHroRKP7YhGhw2m0eoPqNRKnwn2qb8vNpff8mZ4OKPN5ANT0yvmEFxLRe6szJl2T7H3f78PsR2WsM84XTFw%3D%3D","name":"projects/safedine-66679/locations/us-central1/functions/success","labels":{"deployment-tool":"cli-firebase"},"httpsTrigger":{},"runtime":"nodejs12","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"safedine-66679\",\"databaseURL\":\"https://safedine-66679.firebaseio.com\",\"storageBucket\":\"safedine-66679.appspot.com\"}"}}
[2020-11-28T20:38:21.859Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:21 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:21.878Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:21 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:21.879Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/-/functions
[2020-11-28T20:38:22.523Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:22 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:22.524Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:22.525Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:22.900Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:22 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:22.904Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:22 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:24.911Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:24.911Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:27.684Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:27 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:29.703Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:30.061Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:29 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:30.086Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:29 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:32.074Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:32.089Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:32.461Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:32 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:32.462Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:32 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:34.473Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:34.474Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:34.838Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:34 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:34.854Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:34 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:36.841Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:36.856Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:37.211Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:36 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:37.217Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:36 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:39.212Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:39.228Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:39.582Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:39 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:39.590Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:39 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-11-28T20:38:41.583Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:39:22.100Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:39:24.854Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:39:24 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
! functions[success(us-central1)]: Deployment error.
Function failed on loading user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging
Functions deploy had errors with the following functions:
helloWorld
success
To try redeploying those functions, run:
firebase deploy --only "functions:helloWorld,functions:success"
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
C:\Users\e7cd\Documents\safedinecloudfunctions>
从 Firebase 控制台登录
3:13:13.689 am
helloWorld
Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Function invocation was interrupted.
helloWorld
Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Function invocation was interrupted.
3:13:48.825 am
helloWorld
Function execution started
3:13:49.144 am
helloWorld
Provided module can't be loaded.
解决方案
来自 https://github.com/paypal/PayPal-node-SDK#usage:
在您的 package.json 文件中添加依赖项“paypal-rest-sdk”。
这是您的功能无法启动的原因之一。
鉴于您公开分享了您的贝宝访问凭据,我强烈建议您生成新的配对并停用您包含的那些。
推荐阅读
- angularjs - 带有 ng-include 的 ng-controller 无法正确绑定
- python - 读取 csv / 导入数据时重新排列 Pandas 中的列
- c# - C# 属性不返回我在 set 访问器处更改的值
- javascript - AG-GRID : 同时使用 onRowClicked 和 onRowDoubleClicked
- haskell - 最小化重复模式的函数重载
- python - 获取与星期一不同的星期开始日的星期数 - Python
- gitlab-ci - GitLab CI:如何禁用主分支以外的其他分支的提交/自动管道?
- python - Python OpenCV waitKey() 在一定时间内显示图像的精确度/准确度如何?
- python - 贝叶斯网络算法中的错误:使用 Python 的蒙蒂霍尔问题
- javascript - 基于嵌套数组按名称过滤