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) ClickBank Parse Instant Notification JSON

Demonstrates how to parse the JSON of a ClickBank instant notification.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoJson
    Boolean iSuccess
    String sTransactionTime
    String sReceipt
    String sTransactionType
    String sVendor
    String sAffiliate
    String sRole
    String sTotalAccountAmount
    String sPaymentMethod
    String sTotalOrderAmount
    String sTotalTaxAmount
    String sTotalShippingAmount
    String sCurrency
    String sOrderLanguage
    String sCustomerShippingFirstName
    String sCustomerShippingLastName
    String sCustomerShippingFullName
    String sCustomerShippingPhoneNumber
    String sCustomerShippingEmail
    String sCustomerShippingAddressAddress1
    String sCustomerShippingAddressAddress2
    String sCustomerShippingAddressCity
    String sCustomerShippingAddressCounty
    String sCustomerShippingAddressState
    String sCustomerShippingAddressPostalCode
    String sCustomerShippingAddressCountry
    String sCustomerBillingFirstName
    String sCustomerBillingLastName
    String sCustomerBillingFullName
    String sCustomerBillingPhoneNumber
    String sCustomerBillingEmail
    String sCustomerBillingAddressState
    String sCustomerBillingAddressPostalCode
    String sCustomerBillingAddressCountry
    String sUpsellUpsellOriginalReceipt
    Integer iUpsellUpsellFlowId
    String sUpsellUpsellSession
    String sUpsellUpsellPath
    String sHopfeedHopfeedClickId
    Integer iHopfeedHopfeedApplicationId
    Integer iHopfeedHopfeedCreativeId
    String sHopfeedHopfeedApplicationPayout
    String sHopfeedHopfeedVendorPayout
    String sVersion
    Integer iAttemptCount
    String sVendorVariablesV1
    String sVendorVariablesV2
    Integer i
    Integer iCount_i
    String sStrVal
    String sItemNo
    String sProductTitle
    Boolean iShippable
    Boolean iRecurring
    String sAccountAmount
    Integer iQuantity
    String sDownloadUrl
    String sLineItemType

    Get Create (RefClass(cComChilkatJsonObject)) To hoJson
    If (Not(IsComObjectCreated(hoJson))) Begin
        Send CreateComObject of hoJson
    End

    Get ComLoad Of hoJson "{  ...  }" To iSuccess

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

    // See the parsing code below..

    // Sample notification JSON: 

    // {
    //     "transactionTime": "2016-06-05T13:47:51-06:00",
    //     "receipt": "CWOGBZLN",
    //     "transactionType": "SALE",
    //     "vendor": "testacct",
    //     "affiliate": "affiliate1",
    //     "role": "VENDOR",
    //     "totalAccountAmount": 0.00,
    //     "paymentMethod": "VISA",
    //     "totalOrderAmount": 0.00,
    //     "totalTaxAmount": 0.00,
    //     "totalShippingAmount": 0.00,
    //     "currency": "USD",
    //     "orderLanguage": "EN",
    //     "trackingCodes": [
    //         "tracking_code"
    //     ],
    //     "lineItems": [
    //         {
    //             "itemNo": "1",
    //             "productTitle": "Product Title",
    //             "shippable": false,
    //             "recurring": false,
    //             "accountAmount": 5.00,
    //             "quantity": 1,
    //             "downloadUrl": "<download_url>"
    //             "lineItemType": "CART"
    //        }
    //         {
    //             "itemNo": "2",
    //             "productTitle": "Second Product",
    //             "shippable": false,
    //             "recurring": true,
    //             "accountAmount": 2.99,
    //             "quantity": 1,
    //             "downloadUrl": "<download_url>"
    //             "lineItemType": "CART"
    //        }
    // 
    //     ],
    //      "customer": {
    //         "shipping": {
    //             "firstName": "TEST",
    //             "lastName": "GUY",
    //             "fullName": "Test Guy",
    //             "phoneNumber": "",
    //             "email": "test@example.net",
    //             "address": {
    //                 "address1": "12 Test Lane",
    //                 "address2": "Suite 100",
    //                 "city": "LAS VEGAS",
    //                 "county": "LAS VEGAS",
    //                 "state": "NV",
    //                 "postalCode": "89101",
    //                 "country": "US"
    //             }
    //         },
    //         "billing": {
    //             "firstName": "TEST",
    //             "lastName": "GUY",
    //             "fullName": "Test Guy",
    //             "phoneNumber": "",
    //             "email": "test@example.net",
    //             "address": {
    //                 "state": "NV",
    //                 "postalCode": "89101",
    //                 "country": "US"
    //             }
    //         }
    //     },
    //      "upsell": {
    //         "upsellOriginalReceipt": "XXXXXXXX",
    //         "upsellFlowId": 55,
    //         "upsellSession": "VVVVVVVVVV",
    //         "upsellPath": "upsell_path"
    //     },
    //      "hopfeed": {
    //         "hopfeedClickId": "hopfeed_click",
    //         "hopfeedApplicationId": 0000,
    //         "hopfeedCreativeId": 0000,
    //         "hopfeedApplicationPayout": 0.00,
    //         "hopfeedVendorPayout": 0.00
    //     },
    //      "version": 6.0,
    //     "attemptCount": 1,
    //      "vendorVariables": {
    //        "v1": "variable1", 
    //        "v2": "variable2" 
    //     }
    //  }
    // 
    // 

    Get ComStringOf Of hoJson "transactionTime" To sTransactionTime
    Get ComStringOf Of hoJson "receipt" To sReceipt
    Get ComStringOf Of hoJson "transactionType" To sTransactionType
    Get ComStringOf Of hoJson "vendor" To sVendor
    Get ComStringOf Of hoJson "affiliate" To sAffiliate
    Get ComStringOf Of hoJson "role" To sRole
    Get ComStringOf Of hoJson "totalAccountAmount" To sTotalAccountAmount
    Get ComStringOf Of hoJson "paymentMethod" To sPaymentMethod
    Get ComStringOf Of hoJson "totalOrderAmount" To sTotalOrderAmount
    Get ComStringOf Of hoJson "totalTaxAmount" To sTotalTaxAmount
    Get ComStringOf Of hoJson "totalShippingAmount" To sTotalShippingAmount
    Get ComStringOf Of hoJson "currency" To sCurrency
    Get ComStringOf Of hoJson "orderLanguage" To sOrderLanguage
    Get ComStringOf Of hoJson "customer.shipping.firstName" To sCustomerShippingFirstName
    Get ComStringOf Of hoJson "customer.shipping.lastName" To sCustomerShippingLastName
    Get ComStringOf Of hoJson "customer.shipping.fullName" To sCustomerShippingFullName
    Get ComStringOf Of hoJson "customer.shipping.phoneNumber" To sCustomerShippingPhoneNumber
    Get ComStringOf Of hoJson "customer.shipping.email" To sCustomerShippingEmail
    Get ComStringOf Of hoJson "customer.shipping.address.address1" To sCustomerShippingAddressAddress1
    Get ComStringOf Of hoJson "customer.shipping.address.address2" To sCustomerShippingAddressAddress2
    Get ComStringOf Of hoJson "customer.shipping.address.city" To sCustomerShippingAddressCity
    Get ComStringOf Of hoJson "customer.shipping.address.county" To sCustomerShippingAddressCounty
    Get ComStringOf Of hoJson "customer.shipping.address.state" To sCustomerShippingAddressState
    Get ComStringOf Of hoJson "customer.shipping.address.postalCode" To sCustomerShippingAddressPostalCode
    Get ComStringOf Of hoJson "customer.shipping.address.country" To sCustomerShippingAddressCountry
    Get ComStringOf Of hoJson "customer.billing.firstName" To sCustomerBillingFirstName
    Get ComStringOf Of hoJson "customer.billing.lastName" To sCustomerBillingLastName
    Get ComStringOf Of hoJson "customer.billing.fullName" To sCustomerBillingFullName
    Get ComStringOf Of hoJson "customer.billing.phoneNumber" To sCustomerBillingPhoneNumber
    Get ComStringOf Of hoJson "customer.billing.email" To sCustomerBillingEmail
    Get ComStringOf Of hoJson "customer.billing.address.state" To sCustomerBillingAddressState
    Get ComStringOf Of hoJson "customer.billing.address.postalCode" To sCustomerBillingAddressPostalCode
    Get ComStringOf Of hoJson "customer.billing.address.country" To sCustomerBillingAddressCountry
    Get ComStringOf Of hoJson "upsell.upsellOriginalReceipt" To sUpsellUpsellOriginalReceipt
    Get ComIntOf Of hoJson "upsell.upsellFlowId" To iUpsellUpsellFlowId
    Get ComStringOf Of hoJson "upsell.upsellSession" To sUpsellUpsellSession
    Get ComStringOf Of hoJson "upsell.upsellPath" To sUpsellUpsellPath
    Get ComStringOf Of hoJson "hopfeed.hopfeedClickId" To sHopfeedHopfeedClickId
    Get ComIntOf Of hoJson "hopfeed.hopfeedApplicationId" To iHopfeedHopfeedApplicationId
    Get ComIntOf Of hoJson "hopfeed.hopfeedCreativeId" To iHopfeedHopfeedCreativeId
    Get ComStringOf Of hoJson "hopfeed.hopfeedApplicationPayout" To sHopfeedHopfeedApplicationPayout
    Get ComStringOf Of hoJson "hopfeed.hopfeedVendorPayout" To sHopfeedHopfeedVendorPayout
    Get ComStringOf Of hoJson "version" To sVersion
    Get ComIntOf Of hoJson "attemptCount" To iAttemptCount
    Get ComStringOf Of hoJson "vendorVariables.v1" To sVendorVariablesV1
    Get ComStringOf Of hoJson "vendorVariables.v2" To sVendorVariablesV2
    Move 0 To i
    Get ComSizeOfArray Of hoJson "trackingCodes" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJson To i
        Get ComStringOf Of hoJson "trackingCodes[i]" To sStrVal
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJson "lineItems" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJson To i
        Get ComStringOf Of hoJson "lineItems[i].itemNo" To sItemNo
        Get ComStringOf Of hoJson "lineItems[i].productTitle" To sProductTitle
        Get ComBoolOf Of hoJson "lineItems[i].shippable" To iShippable
        Get ComBoolOf Of hoJson "lineItems[i].recurring" To iRecurring
        Get ComStringOf Of hoJson "lineItems[i].accountAmount" To sAccountAmount
        Get ComIntOf Of hoJson "lineItems[i].quantity" To iQuantity
        Get ComStringOf Of hoJson "lineItems[i].downloadUrl" To sDownloadUrl
        Get ComStringOf Of hoJson "lineItems[i].lineItemType" To sLineItemType
        Move (i + 1) To i
    Loop



End_Procedure

 

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