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
(AutoIt) 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
; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oHttp = ObjCreate("Chilkat.Http") Local $bSuccess $oHttp.BasicAuth = True $oHttp.Login = "API_USERNAME" $oHttp.Password = "API_PASSWORD" Local $sUrl = "https://<site>.cardconnect.com:<port>/cardconnect/rest/funding?merchid=<merchid>&date=<MMDD>" Local $sResponseStr = $oHttp.QuickGetStr($sUrl) If ($oHttp.LastMethodSuccess = False) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf ; 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. ConsoleWrite("response status code = " & $oHttp.LastStatus & @CRLF) $oJsonResp = ObjCreate("Chilkat.JsonObject") $oJsonResp.Load($sResponseStr) $oJsonResp.EmitCompact = False ConsoleWrite("response JSON:" & @CRLF) ConsoleWrite($oJsonResp.Emit() & @CRLF) ; 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 Local $iFundingmasterid Local $sFundingdate Local $sDatechanged Local $sMerchid Local $i Local $iCount_i Local $sAmount Local $iFundingadjustmentid Local $sDescription Local $sCurrency Local $sCategory Local $sV_type Local $sDateadded Local $iFundingid Local $sNetsales Local $sTotalfunding Local $sFee Local $sDeposittrancode Local $sDdanumber Local $sThirdparty Local $sReversal Local $sInterchangefee Local $sAdjustment Local $sDepositachtracenumber Local $servicecharge Local $sOtheradjustment Local $sAbanumber Local $sDate Local $sDowngradereasoncodes Local $sCardproc Local $sourcetransactionid Local $iBatchid Local $sRespcode Local $sInterchangeunitfee Local $sAuthcode Local $sPlancode Local $iAuthdate Local $iFundingtxnid Local $sCardbrand Local $sTerminalnumber Local $sCardnumber Local $sCardtype Local $sRetref Local $status Local $sInterchangepercentfee Local $sInvoicenumber $iFundingmasterid = $oJsonResp.IntOf("fundingmasterid") $sFundingdate = $oJsonResp.StringOf("fundingdate") $sDatechanged = $oJsonResp.StringOf("datechanged") $sMerchid = $oJsonResp.StringOf("merchid") $i = 0 $iCount_i = $oJsonResp.SizeOfArray("adjustments") While $i < $iCount_i $oJsonResp.I = $i $iFundingmasterid = $oJsonResp.IntOf("adjustments[i].fundingmasterid") $sAmount = $oJsonResp.StringOf("adjustments[i].amount") $sDatechanged = $oJsonResp.StringOf("adjustments[i].datechanged") $iFundingadjustmentid = $oJsonResp.IntOf("adjustments[i].fundingadjustmentid") $sDescription = $oJsonResp.StringOf("adjustments[i].description") $sCurrency = $oJsonResp.StringOf("adjustments[i].currency") $sCategory = $oJsonResp.StringOf("adjustments[i].category") $sV_type = $oJsonResp.StringOf("adjustments[i].type") $sDateadded = $oJsonResp.StringOf("adjustments[i].dateadded") $sMerchid = $oJsonResp.StringOf("adjustments[i].merchid") $i = $i + 1 Wend $i = 0 $iCount_i = $oJsonResp.SizeOfArray("fundings") While $i < $iCount_i $oJsonResp.I = $i $iFundingid = $oJsonResp.IntOf("fundings[i].fundingid") $sNetsales = $oJsonResp.StringOf("fundings[i].netsales") $sTotalfunding = $oJsonResp.StringOf("fundings[i].totalfunding") $sFee = $oJsonResp.StringOf("fundings[i].fee") $sDatechanged = $oJsonResp.StringOf("fundings[i].datechanged") $sDeposittrancode = $oJsonResp.StringOf("fundings[i].deposittrancode") $sDdanumber = $oJsonResp.StringOf("fundings[i].ddanumber") $sThirdparty = $oJsonResp.StringOf("fundings[i].thirdparty") $sDateadded = $oJsonResp.StringOf("fundings[i].dateadded") $iFundingmasterid = $oJsonResp.IntOf("fundings[i].fundingmasterid") $sReversal = $oJsonResp.StringOf("fundings[i].reversal") $sInterchangefee = $oJsonResp.StringOf("fundings[i].interchangefee") $sAdjustment = $oJsonResp.StringOf("fundings[i].adjustment") $sCurrency = $oJsonResp.StringOf("fundings[i].currency") $sDepositachtracenumber = $oJsonResp.StringOf("fundings[i].depositachtracenumber") $servicecharge = $oJsonResp.StringOf("fundings[i].servicecharge") $sOtheradjustment = $oJsonResp.StringOf("fundings[i].otheradjustment") $sAbanumber = $oJsonResp.StringOf("fundings[i].abanumber") $i = $i + 1 Wend $i = 0 $iCount_i = $oJsonResp.SizeOfArray("txns") While $i < $iCount_i $oJsonResp.I = $i $sDate = $oJsonResp.StringOf("txns[i].date") $sAmount = $oJsonResp.StringOf("txns[i].amount") $sDowngradereasoncodes = $oJsonResp.StringOf("txns[i].downgradereasoncodes") $iFundingid = $oJsonResp.IntOf("txns[i].fundingid") $sCardproc = $oJsonResp.StringOf("txns[i].cardproc") $sourcetransactionid = $oJsonResp.StringOf("txns[i].sourcetransactionid") $sV_type = $oJsonResp.StringOf("txns[i].type") $iBatchid = $oJsonResp.IntOf("txns[i].batchid") $sRespcode = $oJsonResp.StringOf("txns[i].respcode") $sInterchangeunitfee = $oJsonResp.StringOf("txns[i].interchangeunitfee") $sAuthcode = $oJsonResp.StringOf("txns[i].authcode") $sPlancode = $oJsonResp.StringOf("txns[i].plancode") $iAuthdate = $oJsonResp.IntOf("txns[i].authdate") $iFundingtxnid = $oJsonResp.IntOf("txns[i].fundingtxnid") $sCardbrand = $oJsonResp.StringOf("txns[i].cardbrand") $sCurrency = $oJsonResp.StringOf("txns[i].currency") $sTerminalnumber = $oJsonResp.StringOf("txns[i].terminalnumber") $sCardnumber = $oJsonResp.StringOf("txns[i].cardnumber") $sCardtype = $oJsonResp.StringOf("txns[i].cardtype") $sRetref = $oJsonResp.StringOf("txns[i].retref") $status = $oJsonResp.StringOf("txns[i].status") $sInterchangepercentfee = $oJsonResp.StringOf("txns[i].interchangepercentfee") $sInvoicenumber = $oJsonResp.StringOf("txns[i].invoicenumber") $i = $i + 1 Wend |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.