Skip to content

Commit

Permalink
fix(payments): update payments urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabrielpanga committed Nov 17, 2023
1 parent ba30215 commit 4598417
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,15 @@ export class PluggyClient extends BaseApi {
* @returns {PaymentRequest} PaymentRequest object
*/
async createPaymentRequest(paymentRequest: CreatePaymentRequest): Promise<PaymentRequest> {
return this.createPostRequest(`payment-requests`, null, paymentRequest)
return this.createPostRequest(`payments/requests`, null, paymentRequest)
}

/**
* Fetch a single payment request
* @returns {PaymentRequest} PaymentRequest object
*/
async fetchPaymentRequest(id: string): Promise<PaymentRequest> {
return this.createGetRequest(`payment-requests/${id}`)
return this.createGetRequest(`payments/requests/${id}`)
}

/**
Expand All @@ -417,30 +417,30 @@ export class PluggyClient extends BaseApi {
async fetchPaymentRequests(
options: PaymentRequestsFilters = {}
): Promise<PageResponse<PaymentRequest>> {
return this.createGetRequest('payment-requests', { ...options })
return this.createGetRequest('payments/requests', { ...options })
}

/**
* Delete a payment request
*/
async deletePaymentRequest(id: string): Promise<void> {
await this.createDeleteRequest(`payment-requests/${id}`)
await this.createDeleteRequest(`payments/requests/${id}`)
}

/**
* Creates a payment intent
* @returns {PaymentIntent} PaymentIntent object
*/
async createPaymentIntent(paymentIntent: CreatePaymentIntent): Promise<PaymentIntent> {
return this.createPostRequest(`payment-intents`, null, paymentIntent)
return this.createPostRequest(`payments/intents`, null, paymentIntent)
}

/**
* Fetch a single payment intent
* @returns {PaymentIntent} PaymentIntent object
*/
async fetchPaymentIntent(id: string): Promise<PaymentIntent> {
return this.createGetRequest(`payment-intents/${id}`)
return this.createGetRequest(`payments/intents/${id}`)
}

/**
Expand All @@ -450,6 +450,6 @@ export class PluggyClient extends BaseApi {
async fetchPaymentIntents(
options: PaymentIntentsFilters = {}
): Promise<PageResponse<PaymentIntent>> {
return this.createGetRequest('payment-intents', { ...options })
return this.createGetRequest('payments/intents', { ...options })
}
}

0 comments on commit 4598417

Please sign in to comment.