# In app purchase - ServerLog function not deploying

**URL:** <https://community.thunkable.com/t/in-app-purchase-serverlog-function-not-deploying/2134464>\
**Category:** In App Purchase\
**Tags:** iap\
**Created:** [November 16, 2022, 5:49pm UTC](https://community.thunkable.com/t/in-app-purchase-serverlog-function-not-deploying/2134464 "2022-11-16T17:49:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan\_hall\_apps](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@ryan\_hall\_apps](https://community.thunkable.com/u/ryan_hall_apps)\
**Post date:** [November 16, 2022, 5:49pm UTC](https://community.thunkable.com/t/in-app-purchase-serverlog-function-not-deploying/2134464/1 "2022-11-16T17:49:54Z")

</div>

I am working through the in app purchase documents. All my funcitons deployed except the serverLog function. [serverLog docs](https://docs.thunkable.com/in-app-purchases/host-your-server-side-verification-code-on-firebase/setup-your-cloud-environment/server-logs).

Not sure what I am missing. I know @jared is a pro at this so hopefully he can straighten me out.

index.js:

```auto
const functions = require("firebase-functions");
const admin = require("firebase-admin");
admin.initializeApp();

exports.purchaseInfo = functions.https.onRequest((request, response) => {
  const dbRef = admin.database().ref("purchases")
  const data = request.body;
  const queryTerms = request.query;
  const objToSave = {
    data, queryTerms, timestamp: admin.firestore.FieldValue.serverTimestamp(),
  };

  //add this objToSave the realtime database
  dbRef.push(objToSave);

  
  response.send("success").status(200);
});

```

package.js:

```auto
{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "version": "1.0.0",
  "dependencies": {
    "firebase-admin": "^9.8.0",
    "firebase-functions": "^3.14.1"
  }
}

```

I get this notification when it fails:  
 ![1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/d/7d8a668bf7dfd9de6942e9a40c3982c5c2e6100e.png)

---

<div class="post-metadata">

**Author:** ![ryan\_hall\_apps](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@ryan\_hall\_apps](https://community.thunkable.com/u/ryan_hall_apps)\
**Post date:** [November 16, 2022, 10:06pm UTC](https://community.thunkable.com/t/in-app-purchase-serverlog-function-not-deploying/2134464/2 "2022-11-16T22:06:24Z")

</div>

I may have figured it out. I have not tested to see if it works but it did deploy and I got the green check in the Google Cloud Functions.

Possible error on this page? [serverLog docs](https://docs.thunkable.com/in-app-purchases/host-your-server-side-verification-code-on-firebase/setup-your-cloud-environment/server-logs).

The line in the code currently:

```auto
exports.purchaseInfo = functions.https.onRequest((request, response) => {

```

This line should be???

```auto
exports.serverLog = functions.https.onRequest((request, response) => {

```

I’m on a NO-CODE website because I don’t know anything about actual code. So I could be wrong. However I got my green check mark. Now I will continue through the docs and update as I go unless someone corrects me otherwise.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [November 17, 2022, 11:27am UTC](https://community.thunkable.com/t/in-app-purchase-serverlog-function-not-deploying/2134464/3 "2022-11-17T11:27:20Z")

</div>

You should be able to name it whatever you want. Glad it’s working though!

One thing to be sure of is that the entryPoint matches the export name. I’d guess that to be the issue here for you.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:12pm UTC](https://community.thunkable.com/t/in-app-purchase-serverlog-function-not-deploying/2134464/4 "2024-11-08T13:12:43Z")

</div>


