-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added missing account_acquisition to writable attributes #377
Conversation
Hey there @mickpaliokas, thank you so much for your contribution! I tried it out, it works great. Per our CONTRIBUTING.md file, it would be super awesome if you could add a test for this. You could, for example, add the following lines to the // Account Acquisition
$account->account_acquisition = new Recurly_AccountAcquisition();
$account->account_acquisition->cost_in_cents = 123;
$account->account_acquisition->currency = 'USD'; And then just update the XML to add in the extra data. For my example above, it would look like this: <account_acquisition><cost_in_cents>123</cost_in_cents><currency>USD</currency></account_acquisition> Once we get that test in, I'll be happy to merge this! As for the note about the |
Updated PR with a test |
As for the other issue in the Create Account section of the Recurly API documentation, shipping address attribute is referred to as If I were to include |
Right, that is correct. There can be multiple shipping addresses on an account, so the attribute is actually <account>
<account_code>1</account_code>
<email>verena@example.com</email>
<first_name>Verena</first_name>
<last_name>Example</last_name>
<username>verena1234</username>
<cc_emails>bob@example.com,susan@example.com</cc_emails>
<company_name>Recurly Inc</company_name>
<preferred_locale>en-US</preferred_locale>
<address>
<address1>123 Main St.</address1>
<city>San Francisco</city>
<state>CA</state>
<zip>94105</zip>
<country>US</country>
</address>
<shipping_addresses>
<shipping_address>
<nickname>Work</nickname>
<first_name>Verena</first_name>
<last_name>Example</last_name>
<company>Recurly Inc</company>
<phone>555-222-1212</phone>
<email>verena@example.com</email>
<address1>123 Main St.</address1>
<address2>Suite 101</address2>
<city>San Francisco</city>
<state>CA</state>
<zip>94105</zip>
<country>US</country>
</shipping_address>
<shipping_address>
<nickname>Home</nickname>
<first_name>Verena</first_name>
<last_name>Example</last_name>
<phone>555-867-5309</phone>
<email>verena@example.com</email>
<address1>123 Fourth St.</address1>
<address2>Apt. 101</address2>
<city>San Francisco</city>
<state>CA</state>
<zip>94105</zip>
<country>US</country>
</shipping_address>
</shipping_addresses>
</account> This is an example of the request. In the response, it will be a tag with a link to the shipping addresses data, like so: <shipping_addresses href="https://your-subdomain.recurly.com/v2/accounts/1/shipping_addresses"/> So when you create a shipping address, you actually create an array of shipping addresses, and push each // work shipping address
$shad1 = new Recurly_ShippingAddress();
$shad1->nickname = "Work";
$shad1->first_name = "Verena";
$shad1->last_name = "Example";
$shad1->company = "Recurly Inc.";
$shad1->phone = "555-555-5555";
$shad1->email = "verena@example.com";
$shad1->address1 = "123 Main St.";
$shad1->city = "San Francisco";
$shad1->state = "CA";
$shad1->zip = "94110";
$shad1->country = "US";
// home shipping address
$shad2 = new Recurly_ShippingAddress();
$shad2->nickname = "Home";
$shad2->first_name = "Verena";
$shad2->last_name = "Example";
$shad2->phone = "555-555-5555";
$shad2->email = "verena@example.com";
$shad2->address1 = "123 Dolores St.";
$shad2->city = "San Francisco";
$shad2->state = "CA";
$shad2->zip = "94110";
$shad2->country = "US";
$account->shipping_addresses = array($shad1, $shad2); |
I added the above example of |
As per documentation in https://dev.recurly.com/docs/create-an-account
account_acquisition
parameter is missing in writeable attribute array.Additional note: there seems to be a mismatch between the client and the documentation concerning
shipping_address
attribute, not sure which is correct.