{"_id":"570bd8ee2bf01d2000c05867","__v":5,"project":"56abbf55f25f160d00e17f4e","category":{"_id":"570a5676ade45d0e00c1ad33","__v":0,"project":"56abbf55f25f160d00e17f4e","version":"56abbf55f25f160d00e17f51","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-04-10T13:34:46.864Z","from_sync":false,"order":3,"slug":"client-side-api","title":"Client Side API"},"user":"56abbec30b9e0b0d00616274","parentDoc":null,"version":{"_id":"56abbf55f25f160d00e17f51","project":"56abbf55f25f160d00e17f4e","__v":12,"createdAt":"2016-01-29T19:36:53.665Z","releaseDate":"2016-01-29T19:36:53.665Z","categories":["56abbf56f25f160d00e17f52","56abca6bf9757e0d007c6650","56acddfa0ab3c00d00ce3332","56af65da9d32e30d0006d30f","56af66cab34d210d003d9ad0","56af6afcd21e9c0d00b628d1","56af6d6ecc4cbd0d00ce2c88","5705b12221cfed0e00e8c580","570a5676ade45d0e00c1ad33","570d7d25d1e4b82000d9e385","570eac3c3160d10e0041df0e","575709000fd6a3200010dded"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-11T17:03:42.865Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":13,"body":"### Displaying the Kred Purchase Dialog\n\nYou may bring up the \"purchase kreds\" dialog box by using the `showKredPurchaseDialog` method on the microtransaction services object. The only argument is the default purchase method you would like to display, which can be either `offers` to show the OfferPal Kred options, or `mobile` to show the mobile payment options. Any other value will simply show the default purchase dialog.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`type`\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Optional type of offer to display, can be `offers` or `mobile` - any other value shows the default dialog\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n**Example:** Display the OfferPal Kred purchase dialog:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"kongregate.mtx.showKredPurchaseDialog(\\\"offers\\\");\",\n      \"language\": \"haxe\",\n      \"name\": \"ActionScript 3\"\n    },\n    {\n      \"code\": \"kongregate.mtx.showKredPurchaseDialog(\\\"offers\\\");\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n## Handling Guest Users\n\nSince guest users on Kongregate are not allowed to purchase items, you must decide how you want to handle them in your game. In general, whenever a guest user wants to purchase an item, it is a good idea to display a message letting them know they must sign in or register before they can purchase, and then display the sign-in lightbox. Further documentation on this process can be found [here](doc:concepts-handling-guests).","excerpt":"Displays the Kred purchase interface\n`showKredPurchaseDialog(type)`","slug":"client-api-mtx-showkredpurchasedialog","type":"fn","title":"Mtx.ShowKredPurchaseDialog"}

Mtx.ShowKredPurchaseDialog

Displays the Kred purchase interface `showKredPurchaseDialog(type)`

### Displaying the Kred Purchase Dialog You may bring up the "purchase kreds" dialog box by using the `showKredPurchaseDialog` method on the microtransaction services object. The only argument is the default purchase method you would like to display, which can be either `offers` to show the OfferPal Kred options, or `mobile` to show the mobile payment options. Any other value will simply show the default purchase dialog. [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`type`", "0-1": "String", "0-2": "Optional type of offer to display, can be `offers` or `mobile` - any other value shows the default dialog" }, "cols": 3, "rows": 1 } [/block] **Example:** Display the OfferPal Kred purchase dialog: [block:code] { "codes": [ { "code": "kongregate.mtx.showKredPurchaseDialog(\"offers\");", "language": "haxe", "name": "ActionScript 3" }, { "code": "kongregate.mtx.showKredPurchaseDialog(\"offers\");", "language": "javascript" } ] } [/block] ## Handling Guest Users Since guest users on Kongregate are not allowed to purchase items, you must decide how you want to handle them in your game. In general, whenever a guest user wants to purchase an item, it is a good idea to display a message letting them know they must sign in or register before they can purchase, and then display the sign-in lightbox. Further documentation on this process can be found [here](doc:concepts-handling-guests).