Sample code for 30+ languages & platforms
Go

CardConnect Delete Profile

See more CardConnect Examples

Demonstrates how to delete a profile.
A DELETE request to the profile endpoint deletes the stored data for the specified profile ID. ...

See https://developer.cardconnect.com/cardconnect-api?lang=json#delete-profile-request

Chilkat Go Downloads

Go
    success := false

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http := chilkat.NewHttp()

    http.SetBasicAuth(true)
    http.SetLogin("API_USERNAME")
    http.SetPassword("API_PASSWORD")

    url := "https://<site>.cardconnect.com:<port>/cardconnect/rest/profile/<profile ID>/<account ID>/<merchid>"
    responseStr := http.QuickDeleteStr(url)
    if http.LastMethodSuccess() == false {
        fmt.Println(http.LastErrorText())
        http.DisposeHttp()
        return
    }

    // A response status of 200 indicates potential success.  The JSON response body
    // must be examined to determine if it was truly successful or an error.
    fmt.Println("response status code = ", http.LastStatus())

    jsonResp := chilkat.NewJsonObject()
    jsonResp.Load(*responseStr)
    jsonResp.SetEmitCompact(false)

    fmt.Println("response JSON:")
    fmt.Println(*jsonResp.Emit())

    // A successful response looks like this:

    // {
    //   "respproc": "PPS",
    //   "resptext": "Profile Deleted",
    //   "respstat": "A",
    //   "respcode": "08"
    // }
    // 
    // 

    http.DisposeHttp()
    jsonResp.DisposeJsonObject()