These docs are for v2.0. Click to read the latest docs for v2.1.

purchase()

Usage

CleengApi.purchase(offerId, callback);

Opens popup window prompting customer to purchase offer with given ID. If user is not logged in at cleeng.com, he will be prompted to do so.

Params

  • offerId identifier of an offer you want to sell
  • callback function called after popup window is closed (see example below)

Example

CleengApi.purchase('A123123123_US', function(result) {
    if (result.accessGranted) {
        alert('Thank you for buying this item!');
    }
});

Go to API Console