Skip to content

Commit

Permalink
small fix in plan
Browse files Browse the repository at this point in the history
  • Loading branch information
dara committed Nov 17, 2014
1 parent 73566d3 commit 61bcb9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/RebillyLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public function __construct($id = null)
*/
public function create()
{
$data = isset($this->name) ? $this->name : null;
$data['name'] = isset($this->name) ? $this->name : null;

return $this->sendPostRequest($data, get_class());
return $this->sendPostRequest(json_encode($data), get_class());
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/RebillyPlanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ protected function _after()
public function testCreate()
{
$plan = new RebillyPlan();
$plan->name = '5 days trial';
$plan->isActive = true;
$plan->name = '5 days trial';
$plan->currency = 'USD';
$plan->description = 'free 5 days trial';
$plan->expireTime = '2014-12-12 12:00:00';
$plan->recurringAmount = '10.00';
$plan->recurringPeriodUnit = 'monthly';
$plan->recurringPeriodLength = '1';
$plan->trialPeriodUnit = 'daily';
$plan->trialPeriodLength = '5';
$plan->trialAmount = '0.00';
$plan->setupAmount = '10.00';
$plan->expireTime = '2014-12-12 12:00:00';

$this->assertEquals(
'{"name":"5 days trial","isActive":true,"currency":"USD","description":"free 5 days trial","expireTime":"2014-12-12 12:00:00","setupAmount":"10.00","recurringAmount":"10.00","recurringPeriodUnit":"monthly","recurringPeriodLength":"1","trialAmount":"0.00","trialPeriodUnit":"daily","trialPeriodLength":"5"}',
'{"isActive":true,"name":"5 days trial","currency":"USD","description":"free 5 days trial","recurringAmount":"10.00","recurringPeriodUnit":"monthly","recurringPeriodLength":"1","trialAmount":"0.00","trialPeriodUnit":"daily","trialPeriodLength":"5","setupAmount":"10.00","expireTime":"2014-12-12 12:00:00"}',
stripcslashes($plan->buildRequest($plan))
);
}
Expand Down

0 comments on commit 61bcb9c

Please sign in to comment.