Dynamic Order of Items API

6 posts

Flag Post

Currently with the game I am working on, I make the user purchase or use Kreds to get Ocho (the in-game currency for my game)

I’m using the skeleton giving here
for the callback url.

All i did was make items for the $all_items array and added code to give the user Ocho under the commented line:
// Award items to the user here!

The problem I am having is that the Ocho is credited to the user, and the log in my database shows this as well saying the purchase is complete. However, once I’m done with this purchase, I get an email from Kongregrate saying:

You recently purchased the following item in *******:
We were unable to communicate with the game server in order to deliver you the item in-game, so your account has been automatically refunded with 0 Kreds.
Please feel free to contact us with any questions at kreds@kongregate.com.

I’m not quite sure if it’s because I’m not ‘using’ the item via Kongregate’s API or not or something.

Could anybody be so kind to enlighten me possible reasons why this is happening?

btw, I have not published this game yet. Don’t want to publish it if the user can get unlimited Ocho’s for a cost of no Kreds lol

Flag Post

How are you logging the data in your database? Directly from your client or using Kongregate’s API callback URL that you specify when uploading your game?

Flag Post

I am logging the data in my database in the API callback URL that I specified when uploading the game only when the (“item_order_placed” == $event) condition is satisfied

Flag Post

I’m willing to bet you aren’t sending a confirmation JSON call back. Check out the bottom of this page.


At this point you should render a JSON response object with a single attribute state. You may either set state to completed or canceled. If you cancel the order the user’s Kreds will be refunded and they will be notified via private message. If you wish to complete the order, you should render the completed status and award the user their virtual items at this point. Here is an example of a valid completed JSON response:


(See bolded part for why I think its this)

Flag Post

hmm…..weird because after the end of making a successful log to the DB i have this line

print(json_encode(array(“state” => “completed”)));

Flag Post

so after talking to some peeps on here i tried instead of

print(json_encode(array(“state” => “completed”)));

I tried

$object0 = array(“state” => “completed”);

and to no avail :(

also tried exit(); instead of return; sighs