logPurchaseEvents()

This method logs all application purchase events in the Hurree platform, which is then used to produce analytics.

To add the method

  1. Open your project.
  2. You can add the method anywhere, but we recommend that you open the controllers.js file in the js folder. controllers.js
  3. Add the method code wherever you have your payment gateway code:
    window.plugins.hurreSDK.logPurchaseEvents(
        successCallback,
        errorCallback,
        {Purchase_Event_Payload}
    )
    

Arguments

These are the arguments for the method.

  1. successCallback - Success Callback function is called a following a success log and includes a success message
  2. errorCallback - The Error Callback function is called in case of an error, and includes an error message
  3. Purchase_Event_Payload - The {Purchase_Event_Payload}'s keys are listed below

Object Keys

Key Type Mandatory Description
productIdentifer String Mandatory This is a unique product identifier.
currencyCode String Mandatory This is a currency code.
price String Mandatory This is the price of the individual product.
quantity Integer Mandatory This is the quantity of products purchased. The minimum is 1.

Sample Code

window.plugins.hurreSDK.logPurchaseEvents(
    function(data){
        //success callback function
    },
    function(err){
        //error callback function
    },
    {
        productIdentifier: "PRODUCT CODE WHICH IS PURCHASED",
        currencyCode: "USD",
        price: "1.99",
        quantity: "1"
    }
);

results matching ""

    No results matching ""