Sample code for 30+ languages & platforms
Unicode C++

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 Unicode C++ Downloads

Unicode C++
#include <CkHttpW.h>
#include <CkJsonObjectW.h>

void ChilkatSample(void)
    {
    bool success = false;

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

    CkHttpW http;

    http.put_BasicAuth(true);
    http.put_Login(L"API_USERNAME");
    http.put_Password(L"API_PASSWORD");

    const wchar_t *url = L"https://<site>.cardconnect.com:<port>/cardconnect/rest/profile/<profile ID>/<account ID>/<merchid>";
    const wchar_t *responseStr = http.quickDeleteStr(url);
    if (http.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",http.lastErrorText());
        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.
    wprintf(L"response status code = %d\n",http.get_LastStatus());

    CkJsonObjectW jsonResp;
    jsonResp.Load(responseStr);
    jsonResp.put_EmitCompact(false);

    wprintf(L"response JSON:\n");
    wprintf(L"%s\n",jsonResp.emit());

    // A successful response looks like this:

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