- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to use the CIM PHP API to charge a possibly different dollar amount each month on a subscription.
The customer will enter their information on my site, the customer and payment profile will be created in CIM using the API, and I'll store the customer profile ID and payment ID for updating or billing later.
A few questions:
1) I can't see a way to add or update the billing address using the PHP API (I see a form for it in the online CIM interface, but only shipping address in the API).
2) Is this a correct view of how CIM works
3) Will this work OK with AVS to avoid higher discount rates (especially given the billing address issue above)?
Thanks!
Solved! Go to Solution.
04-10-2012 10:23 AM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found out how to do it, it just isn't documented that I could see.
The billing address is sent as part of the payment profile, not separately like the shipping address. It was the ->billTo part that I was missing.
$customerProfile = new AuthorizeNetCustomer;
$customerProfile->description = "Description of customer";
$customerProfile->merchantCustomerId = 123;
$customerProfile->email = "user@domain.com";
$paymentProfile = new AuthorizeNetPaymentProfile;
$paymentProfile->customerType = "individual";
$paymentProfile->billTo->firstName = "john";
$paymentProfile->billTo->lastName = "Doe";
$paymentProfile->billTo->company = "John Doe Company";
$paymentProfile->billTo->address = "1 Main Street";
$paymentProfile->billTo->city = "Boston";
$paymentProfile->billTo->state = "MA";
$paymentProfile->billTo->zip = "02412";
$paymentProfile->billTo->country = "USA";
$paymentProfile->billTo->phoneNumber = "555-555-5555";
$paymentProfile->billTo->faxNumber = "555-555-5556";
$paymentProfile->payment->creditCard->cardNumber = "4111111111111111";
$paymentProfile->payment->creditCard->expirationDate = "2015-10";
$customerProfile->paymentProfiles[] = $paymentProfile;
$response = $request->createCustomerProfile($customerProfile);
Hopefully someone else finds this useful (and it would be nice if this was reflected in the CIM.markdown documentation).
04-10-2012 12:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found out how to do it, it just isn't documented that I could see.
The billing address is sent as part of the payment profile, not separately like the shipping address. It was the ->billTo part that I was missing.
$customerProfile = new AuthorizeNetCustomer;
$customerProfile->description = "Description of customer";
$customerProfile->merchantCustomerId = 123;
$customerProfile->email = "user@domain.com";
$paymentProfile = new AuthorizeNetPaymentProfile;
$paymentProfile->customerType = "individual";
$paymentProfile->billTo->firstName = "john";
$paymentProfile->billTo->lastName = "Doe";
$paymentProfile->billTo->company = "John Doe Company";
$paymentProfile->billTo->address = "1 Main Street";
$paymentProfile->billTo->city = "Boston";
$paymentProfile->billTo->state = "MA";
$paymentProfile->billTo->zip = "02412";
$paymentProfile->billTo->country = "USA";
$paymentProfile->billTo->phoneNumber = "555-555-5555";
$paymentProfile->billTo->faxNumber = "555-555-5556";
$paymentProfile->payment->creditCard->cardNumber = "4111111111111111";
$paymentProfile->payment->creditCard->expirationDate = "2015-10";
$customerProfile->paymentProfiles[] = $paymentProfile;
$response = $request->createCustomerProfile($customerProfile);
Hopefully someone else finds this useful (and it would be nice if this was reflected in the CIM.markdown documentation).
04-10-2012 12:40 PM
