C# to unityscript

Can anyone help me with this, i am trying to implement canvas payments in facebook and i’ am almost there.

void PayCallback(FBResult result){

    if (result != null){

        var response = Json.Deserialize(result.Text) as Dictionary<string, object>;
      
        if(Convert.ToString(response["status"]) == "completed"){

            GiveItem();
        }
  
        else{

        // Payment Failed
        }
    }
}
  
void GiveItem(){

    // Implement your give item here
}

I’ am having problems with this part:

if(Convert.ToString(response[“status”]) == “completed”){

Thank you.

It’s exactly the same in Unityscript and C#.

–Eric

Hi Eric,

It’s giving me this error:

Assets/Scripts/Plugs/Engagement/FaceBook/Payments.js(67,28): BCE0005: Unknown identifier: ‘Convert’.

This one worked, in case anyone wanted to know:

if(response[“status”].ToString() == “completed”){
}

Convert is in the System namespace.

–Eric

Hey I am doing the same thing . I just want to know is this issue resolved ??? … Please let me know …

I am not able to understand what data is going to return from response . How can i debug it … Do i need to need to deserialize it ??