Skip to content

Commit

Permalink
Add attribute passing between Customer/SubscriptionPlan and Subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Timon de Groot committed Apr 25, 2019
1 parent 478e442 commit 253a026
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Resource/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ public function update(array $data = []): Customer

/**
* @param int $subscriptionId
* @param array $attributes
* @return Subscription
* @throws ApiException
*/
public function createSubscription(int $subscriptionId): Subscription
public function createSubscription(int $subscriptionId, array $attributes = []): Subscription
{
return $this->client->subscriptions->create($this->id, $subscriptionId);
return $this->client->subscriptions->create($this->id, $subscriptionId, $attributes);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Resource/SubscriptionPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ class SubscriptionPlan extends AbstractResource

/**
* @param int $customerId
* @param array $attributes
* @return Subscription
* @throws \Marissen\eCurring\Exception\ApiException
*/
public function createSubscription(int $customerId): Subscription
public function createSubscription(int $customerId, array $attributes = []): Subscription
{
return $this->client->subscriptions->create($customerId, $this->id);
return $this->client->subscriptions->create($customerId, $this->id, $attributes);
}
}

0 comments on commit 253a026

Please sign in to comment.