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

DataFlex 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

 

 

 

(DataFlex) 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

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.