Refactor billing code and add error monitoring
Refactored the code that retrieves the billing customer id by renaming the function getBillingCustomerId to getCustomerId. Also, bolstered error handling: implemented exception capture in particular scenarios across multiple files. If an error occurs, it's now captured and reported to the configured provider.
This commit is contained in:
@@ -87,12 +87,12 @@ class AccountsApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* @name getBillingCustomerId
|
||||
* @name getCustomerId
|
||||
* Get the billing customer ID for the given user.
|
||||
* If the user does not have a billing customer ID, it will return null.
|
||||
* @param accountId
|
||||
*/
|
||||
async getBillingCustomerId(accountId: string) {
|
||||
async getCustomerId(accountId: string) {
|
||||
const response = await this.client
|
||||
.from('billing_customers')
|
||||
.select('customer_id')
|
||||
|
||||
Reference in New Issue
Block a user