I'm integrating CIM into an MVC3 app. I've added a service reference using the development url and coded the following:
public long x()
{
var u = this.User.Identity as IClaimsIdentity;
var id = u.Claims.First(x => x.ClaimType == ClaimTypes.NameIdentifier);
AuthorizeNet.CustomerProfileType cust = new AuthorizeNet.CustomerProfileType();
cust.merchantCustomerId = id.Value;
AuthorizeNet.MerchantAuthenticationType merch = new AuthorizeNet.MerchantAuthenticationType();
merch.name = "8aFRk4663XMd";
merch.transactionKey = "4MS675e62fQEdUXN";
AuthorizeNet.ServiceSoap svc = new AuthorizeNet.ServiceSoap();
AuthorizeNet.CreateCustomerProfileResponseType response = svc.CreateCustomerProfile(
merch, cust, AuthorizeNet.ValidationModeEnum.none
);
return response.customerProfileId;
}but, of course, it doesn't work because one cannot instantiate an interface like that (.ServiceSoap is an interface). The sample code makes a reference to a .Service - but that doesn't exist AFAICT.
so how is this supposed to work?
TIA - e!
08-18-2011 12:36 AM
incidentally, I did find an old post (http://community.developer.authorize.net/t5/Integration-and-Testing/CIM-Integration-as-Service-Refer...) with the exact problem I'm having but, alas, no solution.
08-18-2011 01:03 AM
if there's a better solution, I'm all ears. for now I'll be following this: http://stackoverflow.com/questions/7104192/cim-in-an-mvc3-app-how-to-instantiate-servicesoap/7104300...
08-18-2011 01:14 AM