Home Javascript SDK Rest API/SSO Webhooks AppMarket Login
My apps
Login first

Help & Docs
Settings page
Pricing page
Credits API
Events

Pricing Dialog

If you want to get money for your app you can create price plans to buy credits.
The payment is done by Cashcow.
Cashcow takes comission of 15% for each deal. We will pay you the rest of the money at the end of each month by bank transfer or credit card.

How to impelemnet?

First you need to set your app pricing plan URL in the app settings.
for example: http://www.yourdomain.com/pricingpage

The HTML of the pricing page
The pricing page must be a clean div HTML without HTML, HEAD and BODY tags.
The prcing page MUST start with <div class="pricing-container"></div>
example of pricing page:
<div class="pricing-container"> <div class="grid"> <table> <thead> <tr> <th><th> <th>Credits<th> <th>price per credit<th> <th>total price<th> <tr> <thead> <tbody> <tr> <td> <input type="radio" name="plan" value="MD5-HASH-CODE-HERE" /></td> <td>500 <td>0.20 USD</td> <td>100 USD</td> </tr> <tr> <td> <input type="radio" name="plan" value="MD5-HASH-CODE-HERE" /></td> <td>1000</td> <td>0.15 USD</td> <td>150 USD</td> </tr> </tbody> </table> </div> </div>

Encrypt pricing values
When user choose a price plan from your pricing page the radio input (see example above:MD5-HASH-CODE-HERE)
must have an MD5 encrypted value.

First, You need to create a json string for each input you added.
for example:
{credits:500,price:100,type:'credits'}
This tell Cashcow that user can buy 500 credits for 100 USD.
the json parameter: type is used to tell Cashcow that is a credits deal.

Second, when you create the JSON string, you need to encrypt it with MD5 Hash and your app token.
example in c#:
public static string Encrypt(string app_token, string priceplan_json) { byte[] keyArray; byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(priceplan_json); string key = app_token; MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider(); keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key)); //Always release the resources and flush data // of the Cryptographic service provide. Best Practice hashmd5.Clear(); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); //set the secret key for the tripleDES algorithm tdes.Key = keyArray; //mode of operation. there are other 4 modes. //We choose ECB(Electronic code Book) tdes.Mode = CipherMode.ECB; //padding mode(if any extra byte added) tdes.Padding = PaddingMode.PKCS7; ICryptoTransform cTransform = tdes.CreateEncryptor(); //transform the specified region of bytes array to resultArray byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length); //Release resources held by TripleDes Encryptor tdes.Clear(); //Return the encrypted data into unreadable string format return Convert.ToBase64String(resultArray, 0, resultArray.Length); }

The result is something like this:
XXDFFGDHFHRTYhrthytry645746366-534534534wfsfsfdasddw

That's all! now you just need to add this value to the radio input:
<input type="radio" name="plan" value="XXDFFGDHFHRTYhrthytry645746366-534534534wfsfsfdasddw" />

When user select this price plan he will charge at 100 USD(for example) and get 500 credits for your app.