Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Visual FoxPro Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Jira
MYOB

Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
Xero
eBay
effectconnect

 

 

 

(Visual FoxPro) 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 ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL lnSuccess
LOCAL lcUrl
LOCAL lcResponseStr
LOCAL loJsonResp
LOCAL lnFundingmasterid
LOCAL lcFundingdate
LOCAL lcDatechanged
LOCAL lcMerchid
LOCAL i
LOCAL lnCount_i
LOCAL lcAmount
LOCAL lnFundingadjustmentid
LOCAL lcDescription
LOCAL lcCurrency
LOCAL lcCategory
LOCAL lcV_type
LOCAL lcDateadded
LOCAL lnFundingid
LOCAL lcNetsales
LOCAL lcTotalfunding
LOCAL lcFee
LOCAL lcDeposittrancode
LOCAL lcDdanumber
LOCAL lcThirdparty
LOCAL lcReversal
LOCAL lcInterchangefee
LOCAL lcAdjustment
LOCAL lcDepositachtracenumber
LOCAL lcServicecharge
LOCAL lcOtheradjustment
LOCAL lcAbanumber
LOCAL lcDate
LOCAL lcDowngradereasoncodes
LOCAL lcCardproc
LOCAL lcSourcetransactionid
LOCAL lnBatchid
LOCAL lcRespcode
LOCAL lcInterchangeunitfee
LOCAL lcAuthcode
LOCAL lcPlancode
LOCAL lnAuthdate
LOCAL lnFundingtxnid
LOCAL lcCardbrand
LOCAL lcTerminalnumber
LOCAL lcCardnumber
LOCAL lcCardtype
LOCAL lcRetref
LOCAL lcStatus
LOCAL lcInterchangepercentfee
LOCAL lcInvoicenumber

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

loHttp.BasicAuth = 1
loHttp.Login = "API_USERNAME"
loHttp.Password = "API_PASSWORD"

lcUrl = "https://<site>.cardconnect.com:<port>/cardconnect/rest/funding?merchid=<merchid>&date=<MMDD>"
lcResponseStr = loHttp.QuickGetStr(lcUrl)
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    CANCEL
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.
? "response status code = " + STR(loHttp.LastStatus)

loJsonResp = CreateObject('Chilkat_9_5_0.JsonObject')
loJsonResp.Load(lcResponseStr)
loJsonResp.EmitCompact = 0

? "response JSON:"
? loJsonResp.Emit()

* 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

lnFundingmasterid = loJsonResp.IntOf("fundingmasterid")
lcFundingdate = loJsonResp.StringOf("fundingdate")
lcDatechanged = loJsonResp.StringOf("datechanged")
lcMerchid = loJsonResp.StringOf("merchid")
i = 0
lnCount_i = loJsonResp.SizeOfArray("adjustments")
DO WHILE i < lnCount_i
    loJsonResp.I = i
    lnFundingmasterid = loJsonResp.IntOf("adjustments[i].fundingmasterid")
    lcAmount = loJsonResp.StringOf("adjustments[i].amount")
    lcDatechanged = loJsonResp.StringOf("adjustments[i].datechanged")
    lnFundingadjustmentid = loJsonResp.IntOf("adjustments[i].fundingadjustmentid")
    lcDescription = loJsonResp.StringOf("adjustments[i].description")
    lcCurrency = loJsonResp.StringOf("adjustments[i].currency")
    lcCategory = loJsonResp.StringOf("adjustments[i].category")
    lcV_type = loJsonResp.StringOf("adjustments[i].type")
    lcDateadded = loJsonResp.StringOf("adjustments[i].dateadded")
    lcMerchid = loJsonResp.StringOf("adjustments[i].merchid")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResp.SizeOfArray("fundings")
DO WHILE i < lnCount_i
    loJsonResp.I = i
    lnFundingid = loJsonResp.IntOf("fundings[i].fundingid")
    lcNetsales = loJsonResp.StringOf("fundings[i].netsales")
    lcTotalfunding = loJsonResp.StringOf("fundings[i].totalfunding")
    lcFee = loJsonResp.StringOf("fundings[i].fee")
    lcDatechanged = loJsonResp.StringOf("fundings[i].datechanged")
    lcDeposittrancode = loJsonResp.StringOf("fundings[i].deposittrancode")
    lcDdanumber = loJsonResp.StringOf("fundings[i].ddanumber")
    lcThirdparty = loJsonResp.StringOf("fundings[i].thirdparty")
    lcDateadded = loJsonResp.StringOf("fundings[i].dateadded")
    lnFundingmasterid = loJsonResp.IntOf("fundings[i].fundingmasterid")
    lcReversal = loJsonResp.StringOf("fundings[i].reversal")
    lcInterchangefee = loJsonResp.StringOf("fundings[i].interchangefee")
    lcAdjustment = loJsonResp.StringOf("fundings[i].adjustment")
    lcCurrency = loJsonResp.StringOf("fundings[i].currency")
    lcDepositachtracenumber = loJsonResp.StringOf("fundings[i].depositachtracenumber")
    lcServicecharge = loJsonResp.StringOf("fundings[i].servicecharge")
    lcOtheradjustment = loJsonResp.StringOf("fundings[i].otheradjustment")
    lcAbanumber = loJsonResp.StringOf("fundings[i].abanumber")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResp.SizeOfArray("txns")
DO WHILE i < lnCount_i
    loJsonResp.I = i
    lcDate = loJsonResp.StringOf("txns[i].date")
    lcAmount = loJsonResp.StringOf("txns[i].amount")
    lcDowngradereasoncodes = loJsonResp.StringOf("txns[i].downgradereasoncodes")
    lnFundingid = loJsonResp.IntOf("txns[i].fundingid")
    lcCardproc = loJsonResp.StringOf("txns[i].cardproc")
    lcSourcetransactionid = loJsonResp.StringOf("txns[i].sourcetransactionid")
    lcV_type = loJsonResp.StringOf("txns[i].type")
    lnBatchid = loJsonResp.IntOf("txns[i].batchid")
    lcRespcode = loJsonResp.StringOf("txns[i].respcode")
    lcInterchangeunitfee = loJsonResp.StringOf("txns[i].interchangeunitfee")
    lcAuthcode = loJsonResp.StringOf("txns[i].authcode")
    lcPlancode = loJsonResp.StringOf("txns[i].plancode")
    lnAuthdate = loJsonResp.IntOf("txns[i].authdate")
    lnFundingtxnid = loJsonResp.IntOf("txns[i].fundingtxnid")
    lcCardbrand = loJsonResp.StringOf("txns[i].cardbrand")
    lcCurrency = loJsonResp.StringOf("txns[i].currency")
    lcTerminalnumber = loJsonResp.StringOf("txns[i].terminalnumber")
    lcCardnumber = loJsonResp.StringOf("txns[i].cardnumber")
    lcCardtype = loJsonResp.StringOf("txns[i].cardtype")
    lcRetref = loJsonResp.StringOf("txns[i].retref")
    lcStatus = loJsonResp.StringOf("txns[i].status")
    lcInterchangepercentfee = loJsonResp.StringOf("txns[i].interchangepercentfee")
    lcInvoicenumber = loJsonResp.StringOf("txns[i].invoicenumber")
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loJsonResp


 

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