Class: CyberSource::SdkTracker

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/utilities/tracking/sdk_tracker.rb

Constant Summary collapse

@@inclusion_list =
[
    "CapturePaymentRequest",
    "CreateCreditRequest",
    "AddNegativeListRequest",
    "CreateBundledDecisionManagerCaseRequest",
    "FraudMarkingActionRequest",
    "CheckPayerAuthEnrollmentRequest",
    "PayerAuthSetupRequest",
    "ValidateRequest",
    "CreatePaymentRequest",
    "IncrementAuthRequest",
    "CreatePlanRequest",
    "RefundCaptureRequest",
    "RefundPaymentRequest",
    "AuthReversalRequest",
    "MitReversalRequest",
    "CreateSubscriptionRequest",
    "UpdateSubscription",
    "TaxRequest",
    "VoidTaxRequest",
    "ValidateExportComplianceRequest",
    "VerifyCustomerAddressRequest",
    "MitVoidRequest",
    "VoidCaptureRequest",
    "VoidCreditRequest",
    "VoidPaymentRequest",
    "VoidRefundRequest"
]

Instance Method Summary collapse

Instance Method Details

#insert_developer_id_tracker(requestObj, requestClass, runEnvironment, merchantConfigDeveloperId) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/cybersource_rest_client/utilities/tracking/sdk_tracker.rb', line 34

def insert_developer_id_tracker(requestObj, requestClass, runEnvironment, merchantConfigDeveloperId)
    if @@inclusion_list.include? requestClass
        developer_id_value = ''

        if runEnvironment == 'apitest.cybersource.com'
            developer_id_value = '0KFKGFGT'
        else
            developer_id_value = 'YDZP7DRQ'
        end

        if merchantConfigDeveloperId && !merchantConfigDeveloperId.strip.empty?
            developer_id_value=merchantConfigDeveloperId.strip
        end

        tester = JSON.parse requestObj
        
        if !tester.include? "clientReferenceInformation"
            tester['clientReferenceInformation'] = {}
        end

        if !tester['clientReferenceInformation'].include? "partner"
            tester['clientReferenceInformation']['partner'] = {}
        end

        if !tester['clientReferenceInformation']['partner'].include? "developerId" ||
            tester['clientReferenceInformation']['partner']['developerId'].nil? ||
            tester['clientReferenceInformation']['partner']['developerId'].empty?
            tester['clientReferenceInformation']['partner']['developerId'] = developer_id_value
        end

        requestObj = JSON.dump tester
    end

    return requestObj
end