Skip to content

NullReferenceException in PaymentsApi.CreatePaymentAsync when MLE enabled #150

@AdTarling

Description

@AdTarling

I've been investigating the updates required to enable MLE for all applicable API calls.
On the whole all is working, however, I'm receiving a NullReferenceException from PaymentsApi.CreatePaymentAsync so I was wondering if there's a bug with that as other API calls through the SDK are fine.

FYI - this isn't a new payment gateway integration and CreatePaymentAsync works without the MLE additions.

Error stacktrace
System.NullReferenceException: Object reference not set to an instance of an object.
at CyberSource.Client.ApiClient.CallApiAsync(String path, Method method, Dictionary2 queryParams, Object postBody, Dictionary2 headerParams, Dictionary2 formParams, Dictionary2 fileParams, Dictionary`2 pathParams, String contentType, Boolean isResponseMLEForApi)
at CyberSource.Api.PaymentsApi.CreatePaymentAsyncWithHttpInfo(CreatePaymentRequest createPaymentRequest)
at CyberSource.Api.PaymentsApi.CreatePaymentAsync(CreatePaymentRequest createPaymentRequest)

Jsonified config
[
{
"Key": "authenticationType",
"Value": "JWT"
},
{
"Key": "merchantID",
"Value": "redacted"
},
{
"Key": "merchantsecretKey",
"Value": "redacted"
},
{
"Key": "merchantKeyId",
"Value": "redacted"
},
{
"Key": "runEnvironment",
"Value": "apitest.cybersource.com"
},
{
"Key": "enableRequestMLEForOptionalApisGlobally",
"Value": "true"
},
{
"Key": "requestMleKeyAlias",
"Value": "CyberSource_SJC_US"
},
{
"Key": "keyAlias",
"Value": "redacted"
},
{
"Key": "keyPass",
"Value": "redacted"
},
{
"Key": "keysDirectory",
"Value": "C:\\Git\\StAustell_v10\\StAustell.Umbraco\\bin\\Debug\\net8.0\\..\\..\\..\\wwwroot\\Resources"
},
{
"Key": "keyFilename",
"Value": "redacted"
},
{
"Key": "enableResponseMleGlobally",
"Value": "true"
},
{
"Key": "responseMlePrivateKeyFilePath",
"Value": "C:\\Git\\StAustell_v10\\StAustell.Umbraco\\bin\\Debug\\net8.0\\..\\..\\..\\wwwroot\\Resources\\redacted.p12"
},
{
"Key": "responseMlePrivateKeyFilePassword",
"Value": "redacted"
}
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions