cancel
Showing results for 
Search instead for 
Did you mean: 

CIM CreateCustomerPaymentProfile & GetCustomerProfile do not return PaymentProfile information

 

Using the following code bits fails to return the ID, even though the profile is actually created when I check it online.

 

 

 

_apiLogin = login; // valid api login
_transactionKey = key; // valid api transaction key
_merchantAuthentication = new MerchantAuthenticationType();
_merchantAuthentication.name = _apiLogin;
_merchantAuthentication.transactionKey = _transactionKey;
_serviceUrl = URL; // (this could be prod or test
private AdnCimService.ServiceSoapClient client = new ServiceSoapClient();

System.ServiceModel.EndpointAddress newEndpoint = new System.ServiceModel.EndpointAddress(new Uri(_serviceUrl), 

client.Endpoint.Address.Identity, client.Endpoint.Address.Headers, 
client.Endpoint.Address.GetReaderAtMetadata(), client.Endpoint.Address.GetReaderAtExtensions());
client.Endpoint.Address = newEndpoint;

CreateCustomerPaymentProfileResponseType response = client.CreateCustomerPaymentProfile(_merchantAuthentication, customerProfileId, paymentProfile, ValidationModeEnum.none);
if(response.resultCode == MessageTypeEnum.Ok)
{
return response.customerPaymentProfileId;
}

above. response.customerPaymentProfileId is always zero, even though the profile is proven to be created.

 

And, in the code:

 

 

// cimId was the previously saved customer AND profile id
 CustomerProfileMaskedType customerProfileMaskedType = DB.AdnCIM.GetCustomerProfile(cimId);


 

 

here, customerProfileMaskedType.paymentProfiles is NOT null, but when you do:

 

 

CreditCardMaskedType creditCardType = (CreditCardMaskedType)customerPaymentProfileMaskedType.payment.Item

 

the creditCardType tem IS null. But, again, the payment profile does exist when I check it online.

 

Does anyone have any insight on this?

 

 

 

rachmann
Contributor
1 REPLY 1

 

Hi rachmann,


It's difficult to identify a problem simply by looking at the provided code. I would recommend that you start working backwards by looking at the entire content of the "response" and seeing if you can determine why the line used to retrieve the payment profile ID is not working.

 

Thanks,

Joy

Joy
Administrator Administrator
Administrator