Skip to content

Commit

Permalink
Regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed May 17, 2022
1 parent 40b4d40 commit 6c42512
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
18 changes: 18 additions & 0 deletions lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,24 @@ public static function allPaymentMethods($id, $params = null, $opts = null)
return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer the retrieved customer
*/
public function retrievePaymentMethod($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/payment_methods/{payment_method}';
list($response, $opts) = $this->_request('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down
28 changes: 14 additions & 14 deletions lib/Service/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ public function retrieve($id, $params = null, $opts = null)
}

/**
* Retrieves a PaymentMethod object.
* Retrieves a specific customer balance transaction that updated the customer’s <a
* href="/docs/billing/customer/balance">balances</a>.
*
* @param string $parentId
* @param string $id
Expand All @@ -268,45 +269,44 @@ public function retrieve($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer
* @return \Stripe\CustomerBalanceTransaction
*/
public function retrieve($parentId, $id, $params = null, $opts = null)
public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/customers/%s/payment_methods/%s', $parentId, $id), $params, $opts);
return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts);
}

/**
* Retrieves a specific customer balance transaction that updated the customer’s <a
* href="/docs/billing/customer/balance">balances</a>.
* Retrieves a customer’s cash balance.
*
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CustomerBalanceTransaction
* @return \Stripe\CashBalance
*/
public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null)
public function retrieveCashBalance($parentId, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts);
return $this->request('get', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts);
}

/**
* Retrieves a customer’s cash balance.
* Retrieves a PaymentMethod object.
*
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CashBalance
* @return \Stripe\Customer
*/
public function retrieveCashBalance($parentId, $params = null, $opts = null)
public function retrievePaymentMethod($parentId, $id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts);
return $this->request('get', $this->buildPath('/v1/customers/%s/payment_methods/%s', $parentId, $id), $params, $opts);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,9 @@ public function testListSetupIntent()
public function testListSetupAttempt()
{
$this->expectsRequest('get', '/v1/setup_attempts');
$result = $this->client->setupAttempts->all(['limit' => 3]);
$result = $this->client->setupAttempts->all(
['limit' => 3, 'setup_intent' => 'si_xyz']
);
static::assertInstanceOf(\Stripe\Collection::class, $result);
static::assertInstanceOf(\Stripe\SetupAttempt::class, $result->data[0]);
}
Expand Down

0 comments on commit 6c42512

Please sign in to comment.