Skip to content
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

V2 add processing_prepayment_balance_in_cents to Recurly_AccountBalance #691

Merged
merged 1 commit into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Tests/Recurly/AccountBalance_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ public function testGet() {
$this->assertInstanceOf('Recurly_CurrencyList', $balance->balance_in_cents);
$this->assertEquals(2910, $balance->balance_in_cents['USD']->amount_in_cents);
$this->assertEquals(-520, $balance->balance_in_cents['EUR']->amount_in_cents);

$this->assertInstanceOf('Recurly_CurrencyList', $balance->processing_prepayment_balance_in_cents);
$this->assertEquals(-3000, $balance->processing_prepayment_balance_in_cents['USD']->amount_in_cents);
$this->assertEquals(0, $balance->processing_prepayment_balance_in_cents['EUR']->amount_in_cents);
}
}
4 changes: 4 additions & 0 deletions Tests/fixtures/balance/show-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ Content-Type: application/xml; charset=utf-8
<USD type="integer">2910</USD>
<EUR type="integer">-520</EUR>
</balance_in_cents>
<processing_prepayment_balance_in_cents>
<USD type="integer">-3000</USD>
<EUR type="integer">0</EUR>
</processing_prepayment_balance_in_cents>
</account_balance>
3 changes: 3 additions & 0 deletions lib/recurly/account_balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @property Recurly_Stub $account The associated Recurly_Account for this balance.
* @property boolean $past_due The account's past due status.
* @property Recurly_CurrencyList $balance_in_cents The account balance in cents for each currency.
* @property Recurly_CurrencyList $processing_prepayment_balance_in_cents The account processing
* prepayment balance in cents for each currency.
*/
class Recurly_AccountBalance extends Recurly_Resource
{
Expand All @@ -15,6 +17,7 @@ public static function get($accountCode, $client = null) {
function __construct($href = null, $client = null) {
parent::__construct($href, $client);
$this->balance_in_cents = new Recurly_CurrencyList('balance_in_cents');
$this->processing_prepayment_balance_in_cents = new Recurly_CurrencyList('processing_prepayment_balance_in_cents');
}

protected function getNodeName() {
Expand Down
1 change: 1 addition & 0 deletions lib/recurly/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ public function getLinks() {
'plan_code' => 'string',
'plan_codes' => 'array',
'pending_subscription' => 'Recurly_Subscription',
'processing_prepayment_balance_in_cents' => 'Recurly_CurrencyList',
'redemption' => 'Recurly_CouponRedemption',
'redemptions' => 'Recurly_CouponRedemptionList',
'setup_fee_in_cents' => 'Recurly_CurrencyList',
Expand Down