diff --git a/lib/AlipayAccount.php b/lib/AlipayAccount.php index a79705fa4..fbb13103b 100644 --- a/lib/AlipayAccount.php +++ b/lib/AlipayAccount.php @@ -47,8 +47,9 @@ public function instanceUrl() */ public static function retrieve($_id, $_opts = null) { - $msg = "Alipay accounts cannot be accessed without a customer ID. " . - "Retrieve an Alipay account using \$customer->sources->retrieve('alipay_account_id') instead."; + $msg = "Alipay accounts cannot be retrieved without a customer ID. " . + "Retrieve an Alipay account using `Customer::retrieveSource(" . + "'customer_id', 'alipay_account_id')`."; throw new Error\InvalidRequest($msg, null); } @@ -64,8 +65,9 @@ public static function retrieve($_id, $_opts = null) */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Alipay accounts cannot be accessed without a customer ID. " . - "Call save() on \$customer->sources->retrieve('alipay_account_id') instead."; + $msg = "Alipay accounts cannot be updated without a customer ID. " . + "Update an Alipay account using `Customer::updateSource(" . + "'customer_id', 'alipay_account_id', \$updateParams)`."; throw new Error\InvalidRequest($msg, null); } } diff --git a/lib/BankAccount.php b/lib/BankAccount.php index a77f3054b..ca019c2c7 100644 --- a/lib/BankAccount.php +++ b/lib/BankAccount.php @@ -71,9 +71,11 @@ public function instanceUrl() */ public static function retrieve($_id, $_opts = null) { - $msg = "Bank accounts cannot be accessed without a customer ID or account ID. " . - "Retrieve a bank account using \$customer->sources->retrieve('bank_account_id') or " . - "\$account->external_accounts->retrieve('bank_account_id') instead."; + $msg = "Bank accounts cannot be retrieved without a customer ID or " . + "an account ID. Retrieve a bank account using " . + "`Customer::retrieveSource('customer_id', " . + "'bank_account_id')` or `Account::retrieveExternalAccount(" . + "'account_id', 'bank_account_id')`."; throw new Error\InvalidRequest($msg, null); } @@ -86,9 +88,11 @@ public static function retrieve($_id, $_opts = null) */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Bank accounts cannot be accessed without a customer ID or account ID. " . - "Call save() on \$customer->sources->retrieve('bank_account_id') or " . - "\$account->external_accounts->retrieve('bank_account_id') instead."; + $msg = "Bank accounts cannot be updated without a customer ID or an " . + "account ID. Update a bank account using " . + "`Customer::updateSource('customer_id', 'bank_account_id', " . + "\$updateParams)` or `Account::updateExternalAccount(" . + "'account_id', 'bank_account_id', \$updateParams)`."; throw new Error\InvalidRequest($msg, null); } diff --git a/lib/Capability.php b/lib/Capability.php index aabf54b1f..5cb224f9e 100644 --- a/lib/Capability.php +++ b/lib/Capability.php @@ -61,8 +61,9 @@ public function instanceUrl() */ public static function retrieve($_id, $_opts = null) { - $msg = "Capabilities cannot be accessed without an account ID. " . - "Retrieve a Capability using \$account->retrieveCapability('acap_123') instead."; + $msg = "Capabilities cannot be retrieved without an account ID. " . + "Retrieve a capability using `Account::retrieveCapability(" . + "'account_id', 'capability_id')`."; throw new Error\InvalidRequest($msg, null); } @@ -75,8 +76,9 @@ public static function retrieve($_id, $_opts = null) */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Capabilities cannot be accessed without an account ID. " . - "Update a Capability using \$account->updateCapability('acap_123') instead."; + $msg = "Capabilities cannot be updated without an account ID. " . + "Update a capability using `Account::updateCapability(" . + "'account_id', 'capability_id', \$updateParams)`."; throw new Error\InvalidRequest($msg, null); } } diff --git a/lib/Card.php b/lib/Card.php index 51eb5add1..98dc70596 100644 --- a/lib/Card.php +++ b/lib/Card.php @@ -104,10 +104,10 @@ public function instanceUrl() */ public static function retrieve($_id, $_opts = null) { - $msg = "Cards cannot be accessed without a customer, recipient or account ID. " . - "Retrieve a card using \$customer->sources->retrieve('card_id'), " . - "\$recipient->cards->retrieve('card_id'), or " . - "\$account->external_accounts->retrieve('card_id') instead."; + $msg = "Cards cannot be retrieved without a customer ID or an " . + "account ID. Retrieve a card using " . + "`Customer::retrieveSource('customer_id', 'card_id')` or " . + "`Account::retrieveExternalAccount('account_id', 'card_id')`."; throw new Error\InvalidRequest($msg, null); } @@ -120,10 +120,11 @@ public static function retrieve($_id, $_opts = null) */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Cards cannot be accessed without a customer, recipient or account ID. " . - "Call save() on \$customer->sources->retrieve('card_id'), " . - "\$recipient->cards->retrieve('card_id'), or " . - "\$account->external_accounts->retrieve('card_id') instead."; + $msg = "Cards cannot be updated without a customer ID or an " . + "account ID. Update a card using " . + "`Customer::updateSource('customer_id', 'card_id', " . + "\$updateParams)` or `Account::updateExternalAccount(" . + "'account_id', 'card_id', \$updateParams)`."; throw new Error\InvalidRequest($msg, null); } } diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php index 06cafcd45..df1f87902 100644 --- a/lib/CustomerBalanceTransaction.php +++ b/lib/CustomerBalanceTransaction.php @@ -67,8 +67,10 @@ public function instanceUrl() */ public static function retrieve($_id, $_opts = null) { - $msg = "Customer Balance Transactions cannot be accessed without a customer ID. " . - "Retrieve a balance transaction using Customer::retrieveBalanceTransaction('cus_123', 'cbtxn_123') instead."; + $msg = "Customer Balance Transactions cannot be retrieved without a " . + "customer ID. Retrieve a Customer Balance Transaction using " . + "`Customer::retrieveBalanceTransaction('customer_id', " . + "'balance_transaction_id')`."; throw new Error\InvalidRequest($msg, null); } @@ -81,8 +83,10 @@ public static function retrieve($_id, $_opts = null) */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Customer Balance Transactions cannot be accessed without a customer ID. " . - "Update a balance transaction using Customer::updateBalanceTransaction('cus_123', 'cbtxn_123', \$params) instead."; + $msg = "Customer Balance Transactions cannot be updated without a " . + "customer ID. Update a Customer Balance Transaction using " . + "`Customer::updateBalanceTransaction('customer_id', " . + "'balance_transaction_id', \$updateParams)`."; throw new Error\InvalidRequest($msg, null); } } diff --git a/lib/Person.php b/lib/Person.php index 5540f7c5f..52f920a8e 100644 --- a/lib/Person.php +++ b/lib/Person.php @@ -86,8 +86,9 @@ public function instanceUrl() */ public static function retrieve($_id, $_opts = null) { - $msg = "Persons cannot be accessed without an account ID. " . - "Retrieve a Person using \$account->retrievePerson('person_id') instead."; + $msg = "Persons cannot be retrieved without an account ID. Retrieve " . + "a person using `Account::retrievePerson('account_id', " . + "'person_id')`."; throw new Error\InvalidRequest($msg, null); } @@ -100,8 +101,9 @@ public static function retrieve($_id, $_opts = null) */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Persons cannot be accessed without an account ID. " . - "Retrieve a Person using \$account->retrievePerson('person_id') instead."; + $msg = "Persons cannot be updated without an account ID. Update " . + "a person using `Account::updatePerson('account_id', " . + "'person_id', \$updateParams)`."; throw new Error\InvalidRequest($msg, null); } } diff --git a/lib/TaxId.php b/lib/TaxId.php index 8d607132e..892954e55 100644 --- a/lib/TaxId.php +++ b/lib/TaxId.php @@ -73,8 +73,9 @@ public function instanceUrl() */ public static function retrieve($_id, $_opts = null) { - $msg = "Tax Ids cannot be accessed without a customer ID. " . - "Retrieve a Tax Id using Customer::retrieveTaxId('tax_id') instead."; + $msg = "Tax IDs cannot be retrieved without a customer ID. Retrieve " . + "a tax ID using `Customer::retrieveTaxId('customer_id', " . + "'tax_id_id')`."; throw new Error\InvalidRequest($msg, null); } }