Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) CardConnect FundingDemonstrates 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
Use ChilkatAx-win32.pkg Procedure Test Handle hoHttp Boolean iSuccess String sUrl String sResponseStr Handle hoJsonResp Integer iFundingmasterid String sFundingdate String sDatechanged String sMerchid Integer i Integer iCount_i String sAmount Integer iFundingadjustmentid String sDescription String sCurrency String sCategory String sV_type String sDateadded Integer iFundingid String sNetsales String sTotalfunding String sFee String sDeposittrancode String sDdanumber String sThirdparty String sReversal String sInterchangefee String sAdjustment String sDepositachtracenumber String sServicecharge String sOtheradjustment String sAbanumber String sDate String sDowngradereasoncodes String sCardproc String sSourcetransactionid Integer iBatchid String sRespcode String sInterchangeunitfee String sAuthcode String sPlancode Integer iAuthdate Integer iFundingtxnid String sCardbrand String sTerminalnumber String sCardnumber String sCardtype String sRetref String sStatus String sInterchangepercentfee String sInvoicenumber String sTemp1 Integer iTemp1 Boolean bTemp1 // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End Set ComBasicAuth Of hoHttp To True Set ComLogin Of hoHttp To "API_USERNAME" Set ComPassword Of hoHttp To "API_PASSWORD" Move "https://<site>.cardconnect.com:<port>/cardconnect/rest/funding?merchid=<merchid>&date=<MMDD>" To sUrl Get ComQuickGetStr Of hoHttp sUrl To sResponseStr Get ComLastMethodSuccess Of hoHttp To bTemp1 If (bTemp1 = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End // 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. Get ComLastStatus Of hoHttp To iTemp1 Showln "response status code = " iTemp1 Get Create (RefClass(cComChilkatJsonObject)) To hoJsonResp If (Not(IsComObjectCreated(hoJsonResp))) Begin Send CreateComObject of hoJsonResp End Get ComLoad Of hoJsonResp sResponseStr To iSuccess Set ComEmitCompact Of hoJsonResp To False Showln "response JSON:" Get ComEmit Of hoJsonResp To sTemp1 Showln sTemp1 // 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 Get ComIntOf Of hoJsonResp "fundingmasterid" To iFundingmasterid Get ComStringOf Of hoJsonResp "fundingdate" To sFundingdate Get ComStringOf Of hoJsonResp "datechanged" To sDatechanged Get ComStringOf Of hoJsonResp "merchid" To sMerchid Move 0 To i Get ComSizeOfArray Of hoJsonResp "adjustments" To iCount_i While (i < iCount_i) Set ComI Of hoJsonResp To i Get ComIntOf Of hoJsonResp "adjustments[i].fundingmasterid" To iFundingmasterid Get ComStringOf Of hoJsonResp "adjustments[i].amount" To sAmount Get ComStringOf Of hoJsonResp "adjustments[i].datechanged" To sDatechanged Get ComIntOf Of hoJsonResp "adjustments[i].fundingadjustmentid" To iFundingadjustmentid Get ComStringOf Of hoJsonResp "adjustments[i].description" To sDescription Get ComStringOf Of hoJsonResp "adjustments[i].currency" To sCurrency Get ComStringOf Of hoJsonResp "adjustments[i].category" To sCategory Get ComStringOf Of hoJsonResp "adjustments[i].type" To sV_type Get ComStringOf Of hoJsonResp "adjustments[i].dateadded" To sDateadded Get ComStringOf Of hoJsonResp "adjustments[i].merchid" To sMerchid Move (i + 1) To i Loop Move 0 To i Get ComSizeOfArray Of hoJsonResp "fundings" To iCount_i While (i < iCount_i) Set ComI Of hoJsonResp To i Get ComIntOf Of hoJsonResp "fundings[i].fundingid" To iFundingid Get ComStringOf Of hoJsonResp "fundings[i].netsales" To sNetsales Get ComStringOf Of hoJsonResp "fundings[i].totalfunding" To sTotalfunding Get ComStringOf Of hoJsonResp "fundings[i].fee" To sFee Get ComStringOf Of hoJsonResp "fundings[i].datechanged" To sDatechanged Get ComStringOf Of hoJsonResp "fundings[i].deposittrancode" To sDeposittrancode Get ComStringOf Of hoJsonResp "fundings[i].ddanumber" To sDdanumber Get ComStringOf Of hoJsonResp "fundings[i].thirdparty" To sThirdparty Get ComStringOf Of hoJsonResp "fundings[i].dateadded" To sDateadded Get ComIntOf Of hoJsonResp "fundings[i].fundingmasterid" To iFundingmasterid Get ComStringOf Of hoJsonResp "fundings[i].reversal" To sReversal Get ComStringOf Of hoJsonResp "fundings[i].interchangefee" To sInterchangefee Get ComStringOf Of hoJsonResp "fundings[i].adjustment" To sAdjustment Get ComStringOf Of hoJsonResp "fundings[i].currency" To sCurrency Get ComStringOf Of hoJsonResp "fundings[i].depositachtracenumber" To sDepositachtracenumber Get ComStringOf Of hoJsonResp "fundings[i].servicecharge" To sServicecharge Get ComStringOf Of hoJsonResp "fundings[i].otheradjustment" To sOtheradjustment Get ComStringOf Of hoJsonResp "fundings[i].abanumber" To sAbanumber Move (i + 1) To i Loop Move 0 To i Get ComSizeOfArray Of hoJsonResp "txns" To iCount_i While (i < iCount_i) Set ComI Of hoJsonResp To i Get ComStringOf Of hoJsonResp "txns[i].date" To sDate Get ComStringOf Of hoJsonResp "txns[i].amount" To sAmount Get ComStringOf Of hoJsonResp "txns[i].downgradereasoncodes" To sDowngradereasoncodes Get ComIntOf Of hoJsonResp "txns[i].fundingid" To iFundingid Get ComStringOf Of hoJsonResp "txns[i].cardproc" To sCardproc Get ComStringOf Of hoJsonResp "txns[i].sourcetransactionid" To sSourcetransactionid Get ComStringOf Of hoJsonResp "txns[i].type" To sV_type Get ComIntOf Of hoJsonResp "txns[i].batchid" To iBatchid Get ComStringOf Of hoJsonResp "txns[i].respcode" To sRespcode Get ComStringOf Of hoJsonResp "txns[i].interchangeunitfee" To sInterchangeunitfee Get ComStringOf Of hoJsonResp "txns[i].authcode" To sAuthcode Get ComStringOf Of hoJsonResp "txns[i].plancode" To sPlancode Get ComIntOf Of hoJsonResp "txns[i].authdate" To iAuthdate Get ComIntOf Of hoJsonResp "txns[i].fundingtxnid" To iFundingtxnid Get ComStringOf Of hoJsonResp "txns[i].cardbrand" To sCardbrand Get ComStringOf Of hoJsonResp "txns[i].currency" To sCurrency Get ComStringOf Of hoJsonResp "txns[i].terminalnumber" To sTerminalnumber Get ComStringOf Of hoJsonResp "txns[i].cardnumber" To sCardnumber Get ComStringOf Of hoJsonResp "txns[i].cardtype" To sCardtype Get ComStringOf Of hoJsonResp "txns[i].retref" To sRetref Get ComStringOf Of hoJsonResp "txns[i].status" To sStatus Get ComStringOf Of hoJsonResp "txns[i].interchangepercentfee" To sInterchangepercentfee Get ComStringOf Of hoJsonResp "txns[i].invoicenumber" To sInvoicenumber Move (i + 1) To i Loop End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.