Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

C++ Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(C++) CardConnect Funding

Demonstrates how to get the merchant funding information.

The funding endpoint provides merchant funding information supported by supplemental transaction and funding adjustment detail. This information is provided by the host payment processing platform (for example, First Data Omaha). ...

See https://developer.cardconnect.com/cardconnect-api?lang=json#funding

Chilkat C/C++ Library Downloads

MS Visual C/C++

Linux/CentOS C/C++

Alpine Linux C/C++

MAC OS X C/C++

armhf/aarch64 C/C++

C++ Builder

iOS C/C++

Android C/C++

Solaris C/C++

MinGW C/C++

#include <CkHttp.h>
#include <CkJsonObject.h>

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

    CkHttp http;
    bool success;

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

    const char *url = "https://<site>.cardconnect.com:<port>/cardconnect/rest/funding?merchid=<merchid>&date=<MMDD>";
    const char *responseStr = http.quickGetStr(url);
    if (http.get_LastMethodSuccess() == false) {
        std::cout << http.lastErrorText() << "\r\n";
        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.
    std::cout << "response status code = " << http.get_LastStatus() << "\r\n";

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

    std::cout << "response JSON:" << "\r\n";
    std::cout << jsonResp.emit() << "\r\n";

    // A successful response looks like this:

    // ------
    // See the parsing code below...
    // ------

    // {
    //   "fundingmasterid": 1121753252164835,
    //   "fundingdate": "2019-04-22",
    //   "adjustments": [
    //     {
    //       "fundingmasterid": 1121753252164835,
    //       "amount": "-44.98",
    //       "datechanged": "2019-04-22",
    //       "fundingadjustmentid": 1121754400164838,
    //       "description": "THE CARDHOLDER DID NOT AUTHORIZE THE CHARGE.",
    //       "currency": "USD",
    //       "category": "REVERSAL",
    //       "type": "CHARGEBACKS/CHARGEBACK REVERSALS",
    //       "dateadded": "2019-04-22",
    //       "merchid": "MERCHANT_ID"
    //     },
    //     {
    //       "fundingmasterid": 1121753252164835,
    //       "amount": "-32.96",
    //       "datechanged": "2019-04-22",
    //       "fundingadjustmentid": 1121754401164838,
    //       "description": "THIRD PARTY ADJUSTMENTS",
    //       "currency": "USD",
    //       "category": "THIRD PARTY",
    //       "type": "THIRD PARTY ADJUSTMENTS",
    //       "dateadded": "2019-04-22",
    //       "merchid": "MERCHANT_ID"
    //     }
    //   ],
    //   "datechanged": null,
    //   "fundings": [
    //     {
    //       "fundingid": 1121753284164836,
    //       "netsales": "129453.03",
    //       "totalfunding": "129375.09",
    //       "fee": "0",
    //       "datechanged": "2019-04-22",
    //       "deposittrancode": null,
    //       "ddanumber": "3300770540",
    //       "thirdparty": "-32.96",
    //       "dateadded": "2019-04-22",
    //       "fundingmasterid": 1121753252164835,
    //       "reversal": "-44.98",
    //       "interchangefee": "0",
    //       "adjustment": "0",
    //       "currency": "USD",
    //       "depositachtracenumber": null,
    //       "servicecharge": "0",
    //       "otheradjustment": "0",
    //       "abanumber": "121140399"
    //     }
    //   ],
    //   "merchid": "MERCHANT_ID",
    //   "txns": [
    //     {
    //       "date": "2019-04-19",
    //       "amount": "76.75",
    //       "downgradereasoncodes": null,
    //       "fundingid": 1121753409164836,
    //       "cardproc": "FNOR",
    //       "sourcetransactionid": null,
    //       "type": "SALE",
    //       "batchid": 1900942289,
    //       "respcode": "00",
    //       "interchangeunitfee": "0",
    //       "authcode": "PPS209",
    //       "plancode": null,
    //       "authdate": 20190419194808,
    //       "fundingtxnid": 1121753252164835,
    //       "cardbrand": "VISA",
    //       "currency": "USD",
    //       "terminalnumber": null,
    //       "cardnumber": "42XXXXXXXXXX4242",
    //       "cardtype": "Credit",
    //       "retref": "109624271288",
    //       "status": "Processed",
    //       "interchangepercentfee": "0",
    //       "invoicenumber": null
    //     },
    //     {
    //       "date": "2019-04-19",
    //       "amount": "9.99",
    //       "downgradereasoncodes": null,
    //       "fundingid": 1121753410164836,
    //       "cardproc": "FNOR",
    //       "sourcetransactionid": null,
    //       "type": "SALE",
    //       "batchid": 1900942289,
    //       "respcode": "00",
    //       "interchangeunitfee": "0",
    //       "authcode": "PPS009",
    //       "plancode": null,
    //       "authdate": 20190419201502,
    //       "fundingtxnid": 1121753252164835,
    //       "cardbrand": "VISA",
    //       "currency": "USD",
    //       "terminalnumber": null,
    //       "cardnumber": "47XXXXXXXXXX1443",
    //       "cardtype": "Credit",
    //       "retref": "109638272902",
    //       "status": "Processed",
    //       "interchangepercentfee": "0",
    //       "invoicenumber": null
    //     }
    //   ]
    // }
    // 

    // Use this online tool to generate parsing code from sample JSON: 
    // Generate Parsing Code from JSON

    int fundingmasterid;
    const char *fundingdate = 0;
    const char *datechanged = 0;
    const char *merchid = 0;
    int i;
    int count_i;
    const char *amount = 0;
    int fundingadjustmentid;
    const char *description = 0;
    const char *currency = 0;
    const char *category = 0;
    const char *v_type = 0;
    const char *dateadded = 0;
    int fundingid;
    const char *netsales = 0;
    const char *totalfunding = 0;
    const char *fee = 0;
    const char *deposittrancode = 0;
    const char *ddanumber = 0;
    const char *thirdparty = 0;
    const char *reversal = 0;
    const char *interchangefee = 0;
    const char *adjustment = 0;
    const char *depositachtracenumber = 0;
    const char *servicecharge = 0;
    const char *otheradjustment = 0;
    const char *abanumber = 0;
    const char *date = 0;
    const char *downgradereasoncodes = 0;
    const char *cardproc = 0;
    const char *sourcetransactionid = 0;
    int batchid;
    const char *respcode = 0;
    const char *interchangeunitfee = 0;
    const char *authcode = 0;
    const char *plancode = 0;
    int authdate;
    int fundingtxnid;
    const char *cardbrand = 0;
    const char *terminalnumber = 0;
    const char *cardnumber = 0;
    const char *cardtype = 0;
    const char *retref = 0;
    const char *status = 0;
    const char *interchangepercentfee = 0;
    const char *invoicenumber = 0;

    fundingmasterid = jsonResp.IntOf("fundingmasterid");
    fundingdate = jsonResp.stringOf("fundingdate");
    datechanged = jsonResp.stringOf("datechanged");
    merchid = jsonResp.stringOf("merchid");
    i = 0;
    count_i = jsonResp.SizeOfArray("adjustments");
    while (i < count_i) {
        jsonResp.put_I(i);
        fundingmasterid = jsonResp.IntOf("adjustments[i].fundingmasterid");
        amount = jsonResp.stringOf("adjustments[i].amount");
        datechanged = jsonResp.stringOf("adjustments[i].datechanged");
        fundingadjustmentid = jsonResp.IntOf("adjustments[i].fundingadjustmentid");
        description = jsonResp.stringOf("adjustments[i].description");
        currency = jsonResp.stringOf("adjustments[i].currency");
        category = jsonResp.stringOf("adjustments[i].category");
        v_type = jsonResp.stringOf("adjustments[i].type");
        dateadded = jsonResp.stringOf("adjustments[i].dateadded");
        merchid = jsonResp.stringOf("adjustments[i].merchid");
        i = i + 1;
    }

    i = 0;
    count_i = jsonResp.SizeOfArray("fundings");
    while (i < count_i) {
        jsonResp.put_I(i);
        fundingid = jsonResp.IntOf("fundings[i].fundingid");
        netsales = jsonResp.stringOf("fundings[i].netsales");
        totalfunding = jsonResp.stringOf("fundings[i].totalfunding");
        fee = jsonResp.stringOf("fundings[i].fee");
        datechanged = jsonResp.stringOf("fundings[i].datechanged");
        deposittrancode = jsonResp.stringOf("fundings[i].deposittrancode");
        ddanumber = jsonResp.stringOf("fundings[i].ddanumber");
        thirdparty = jsonResp.stringOf("fundings[i].thirdparty");
        dateadded = jsonResp.stringOf("fundings[i].dateadded");
        fundingmasterid = jsonResp.IntOf("fundings[i].fundingmasterid");
        reversal = jsonResp.stringOf("fundings[i].reversal");
        interchangefee = jsonResp.stringOf("fundings[i].interchangefee");
        adjustment = jsonResp.stringOf("fundings[i].adjustment");
        currency = jsonResp.stringOf("fundings[i].currency");
        depositachtracenumber = jsonResp.stringOf("fundings[i].depositachtracenumber");
        servicecharge = jsonResp.stringOf("fundings[i].servicecharge");
        otheradjustment = jsonResp.stringOf("fundings[i].otheradjustment");
        abanumber = jsonResp.stringOf("fundings[i].abanumber");
        i = i + 1;
    }

    i = 0;
    count_i = jsonResp.SizeOfArray("txns");
    while (i < count_i) {
        jsonResp.put_I(i);
        date = jsonResp.stringOf("txns[i].date");
        amount = jsonResp.stringOf("txns[i].amount");
        downgradereasoncodes = jsonResp.stringOf("txns[i].downgradereasoncodes");
        fundingid = jsonResp.IntOf("txns[i].fundingid");
        cardproc = jsonResp.stringOf("txns[i].cardproc");
        sourcetransactionid = jsonResp.stringOf("txns[i].sourcetransactionid");
        v_type = jsonResp.stringOf("txns[i].type");
        batchid = jsonResp.IntOf("txns[i].batchid");
        respcode = jsonResp.stringOf("txns[i].respcode");
        interchangeunitfee = jsonResp.stringOf("txns[i].interchangeunitfee");
        authcode = jsonResp.stringOf("txns[i].authcode");
        plancode = jsonResp.stringOf("txns[i].plancode");
        authdate = jsonResp.IntOf("txns[i].authdate");
        fundingtxnid = jsonResp.IntOf("txns[i].fundingtxnid");
        cardbrand = jsonResp.stringOf("txns[i].cardbrand");
        currency = jsonResp.stringOf("txns[i].currency");
        terminalnumber = jsonResp.stringOf("txns[i].terminalnumber");
        cardnumber = jsonResp.stringOf("txns[i].cardnumber");
        cardtype = jsonResp.stringOf("txns[i].cardtype");
        retref = jsonResp.stringOf("txns[i].retref");
        status = jsonResp.stringOf("txns[i].status");
        interchangepercentfee = jsonResp.stringOf("txns[i].interchangepercentfee");
        invoicenumber = jsonResp.stringOf("txns[i].invoicenumber");
        i = i + 1;
    }
    }

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.