Closed MilesYM closed 7 years ago
@MilesYM Thanks for reaching out to us.
Similar to the other samples, the code for setting billing address should look something like this:
// Create the Bill To info
$billto = new AnetAPI\CustomerAddressType();
$billto->setFirstName("Ellen");
$billto->setLastName("Johnson");
$billto->setCompany("Souveniropolis");
$billto->setAddress("14 Main Street");
$billto->setCity("Pecan Springs");
$billto->setState("TX");
$billto->setZip("44628");
$billto->setCountry("USA");
//Assign to the transactionRequest field
$transactionRequestType->setBillTo($billto);
Steps
transactionRequest
field, which gives you billTo
field and the setter to be called.Great! Thank you so much Ashtru!
Sorry I haven’t see that in the samples! I’m going to try! What’s the minimum required ? Name and postal code ?
Thanks!
How do you do when there is a Middle name or a suffix in name ?
In general, there are no required fields for a billing address. Some exception are:
Depending on the processor some fields might be required. You can see the Request Tab for CreateTransaction API in developer reference
Similarly for creating a shipping address,
In case of middle name or suffixes, there is no defined convention. You can generally add middle names (or more commonly middle initials) into the first name fields. The issuers normally use initials for the middle names.
@MilesYM Please respond if you were able to get this issue resolved. We will close this issue for for now. Feel free to comment in case of any further questions!
We've updated the charge-credit-card and authorize-credit-card to show samples of this. (updated in PR#70)
Hi guys,
Thanks for this awesome samples, really helpful. I’m trying to pass the name on the card to the API but I’m not sure how to do. I figured out there was a BillTo field with name in the API requests parameters but I’m not able to find it in the PHP SDK.
So far my piece of code is very similar to the original example:
`
`