Do you think we could implement Facebook credits

Discussion and feedback on Construct 2

Post » Wed Nov 09, 2011 1:08 am

Here is a post on how to implement Facebook credits to your game.

https://developers.facebook.com/blog/post/489/

Is there a way to implement this code into Construct 2?
B
69
S
11
G
6
Posts: 324
Reputation: 8,321

Post » Wed Nov 09, 2011 1:16 am

You need server side scripting (see step 3: build callback.php) to use credits (and generally any other payment system). This is to keep it secure - it can't all just be done in javascript. However this means you have to do some coding yourself, and right now since we advertise Construct 2 as a non-programming tool, it means a lot of our users don't know how to do this, and it's a bit complicated to instruct beginners on how to set up things like this.

We've got some ideas to work around this problem though. Hopefully we can come up with something soon.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Nov 09, 2011 1:26 am

Wow thanks for the quick reply. If there is any feature that I think will attract people is this feature. In game purchases is the way of the future. And if you do this you will be beyond so many other engines.

Even if you make it so that it is possible to do this in construct 2 in some way shape or form, it would be best to include it. For example if I could add some scripting function to make it possible that would be amazing.
B
69
S
11
G
6
Posts: 324
Reputation: 8,321

Post » Mon Dec 10, 2012 9:28 pm

Greetings.

I just tried to navigate the facebook integration of in-app payments and now I need a few tylenol; my head is banging. For myself (and probably a lot of others) doing this type of programming/integration is extremely stressful.

C2 is a god-send for me, because it doesn't require me to stare at lines of code and deal with API/SDK documentation... all that stuff hurts, seriously.

I'm 100% serious when I say that some sort of plugin for C2 that handles at least basic functionality with using facebook credits for virtual goods would be most welcome.

Is there any progress on an official release for this or are there any users of C2 with programming expertise working on / considering working on something like this?
B
16
S
6
G
2
Posts: 152
Reputation: 3,764

Post » Mon Dec 10, 2012 9:43 pm

Credits and sign up are currently the only thing I have complete on my game. I must say like they've been saying. It's a royal pain to integrate. I ended up going the direct URL route. So I have the browser redirect to the pay dialog then this redirects to a php script that updates the users 'gems' and also add a receipt in the MySQL database for troubleshooting reference. After this it redirects back to the program and shows them a receipt with their Facebook transaction number and my MySQL reference number. If there's a third party plugin out there I'd recommend using it over trying it yourself. If you want to see it in action send me a pm. I cam set you up as a credits tester on my game. lockegames.com/relicsofyore/lanceal2012-12-10 21:45:12
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Tue Dec 11, 2012 3:20 am

lanceal, did you give any thought to selling the thing as a plugin? I'm sure there's gotta be a lot of guys like me that just don't have the time, know-how, or energy to try this!

That's a huge step! Being able to buy virtual currency with credits is really all I want to implement.

Can you give some ideas of what's needed? I'm assuming you absolutely have to have a website with dedicated server / PHP?

Also, are you a god? :P
B
16
S
6
G
2
Posts: 152
Reputation: 3,764

Post » Tue Dec 11, 2012 4:31 am

Not a god lol. Just super patient. You do need a server with php, yes. As far as a plugin I only needed the browser plugin. Everything else needed to be php. I put my first attempt up in the tutorial section. It works but by no means is a finished product. Even now I need to finish the error handler section in the php code and tell my construct 2 project how to look for the error and handle accordingly. I would be willing to help you set it up for your project but it was a bit time consuming so I would probably ask for a few bucks in return to cover the time spent.
The info you need is here:
https://developers.facebook.com/docs/reference/dialogs/pay/
And here:
https://developers.facebook.com/docs/payments/callback/
And here:
https://developers.facebook.com/docs/payments/build/
And of course the construct2 manual browser section:
https://www.scirra.com/manual/110/browser

That's the info I used to implement it. It seems like a lot but it really isn't hard to do if you commit to learning one of those sections at a time. First setup credits for the app, then work on the callback section, the build the pay dialog, then commit to learning the browser plugin reference section, particularly browser.url browser,queryparam, and browser.hash.
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Tue Dec 11, 2012 7:53 pm

Dude, I really appreciate the tips and references. You gave me some structure to try and tackle this problem, so mucho gracias.

I'm gonna give it a shot on my own for now; the lesson tends to stick when you have to struggle through it yourself, ya know? If I still can't wrap my head around it, I may call upon your services.

Thanks again; your time is appreciated, sir!
B
16
S
6
G
2
Posts: 152
Reputation: 3,764

Post » Tue Dec 11, 2012 7:58 pm

@Space Ape

Anytime :)
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Tue Dec 11, 2012 8:06 pm

@Space Ape,
As proof of concept I purchased $1 worth of gems from my store a few days ago. So as you can see, it's definitely possible. :)

B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Next

Return to Construct 2 General

Who is online

Users browsing this forum: gamecorpstudio, WhosWho and 9 guests