I am using the CIM API to manage customer profiles, payments etc. One of the requirement is automatic recurring billing (ARB). In my code, I retrieve the customer based on the customerprofileId. This returns a GetCustomerProfileResponseType object. From this object I read the payment info like this...
svcRef.GetCustomerProfileResponseType cust = client.GetCustomerProfile(auth, id);
NameAndAddressType addr = null;
svcRef.PaymentType payType = null;
if (cust != null)
{
if (cust.profile != null)
{
if (cust.profile.paymentProfiles != null)
{
if (cust.profile.paymentProfiles.GetUpperBound(0) >= 0)
{
addr = cust.profile.paymentProfiles[0].billTo;
svcRef.PaymentMaskedType mPmt = cust.profile.paymentProfiles[0].payment;
if (mPmt != null)
{
payType = new CreditCard.svcRef.PaymentType();
payType.Item = mPmt.Item;
}
}
}
}
}
then I assign the payType to the payment property of the subscription object (of type ARNSubsciptionType) like so....
sub.payment = payType;
ISSUE: The payType is now of type CreditCardMaskedType.
Will this work for ARBCreateSubscription?
Solved! Go to Solution.
07-18-2011 08:13 AM