From e7d0b8deb46dca8bc5749446fdaf53636f4abb22 Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Tue, 7 May 2019 15:42:46 -0400 Subject: [PATCH 1/2] Use 'id' for all single identifier positional arguments --- lib/resources/BitcoinReceivers.js | 4 ++-- lib/resources/Charges.js | 8 ++++---- lib/resources/CreditNotes.js | 4 ++-- lib/resources/Customers.js | 16 ++++++++-------- lib/resources/Invoices.js | 24 ++++++++++++------------ lib/resources/Orders.js | 8 ++++---- lib/resources/PaymentIntents.js | 12 ++++++------ lib/resources/PaymentMethods.js | 8 ++++---- lib/resources/Payouts.js | 8 ++++---- lib/resources/Recipients.js | 8 ++++---- lib/resources/Subscriptions.js | 4 ++-- lib/resources/Topups.js | 4 ++-- lib/resources/Transfers.js | 22 +++++++++++----------- lib/resources/UsageRecords.js | 4 ++-- 14 files changed, 67 insertions(+), 67 deletions(-) diff --git a/lib/resources/BitcoinReceivers.js b/lib/resources/BitcoinReceivers.js index 600e7ed7b4..5e430d3632 100644 --- a/lib/resources/BitcoinReceivers.js +++ b/lib/resources/BitcoinReceivers.js @@ -10,8 +10,8 @@ module.exports = StripeResource.extend({ listTransactions: stripeMethod({ method: 'GET', - path: '/{receiverId}/transactions', - urlParams: ['receiverId'], + path: '/{id}/transactions', + urlParams: ['id'], methodType: 'list', }), }); diff --git a/lib/resources/Charges.js b/lib/resources/Charges.js index ebcfeb1fb0..8f326b7a44 100644 --- a/lib/resources/Charges.js +++ b/lib/resources/Charges.js @@ -45,14 +45,14 @@ module.exports = StripeResource.extend({ */ createRefund: stripeMethod({ method: 'POST', - path: '/{chargeId}/refunds', - urlParams: ['chargeId'], + path: '/{id}/refunds', + urlParams: ['id'], }), listRefunds: stripeMethod({ method: 'GET', - path: '/{chargeId}/refunds', - urlParams: ['chargeId'], + path: '/{id}/refunds', + urlParams: ['id'], methodType: 'list', }), diff --git a/lib/resources/CreditNotes.js b/lib/resources/CreditNotes.js index 6043c04b41..ba7d15f45c 100644 --- a/lib/resources/CreditNotes.js +++ b/lib/resources/CreditNotes.js @@ -9,7 +9,7 @@ module.exports = StripeResource.extend({ voidCreditNote: stripeMethod({ method: 'POST', - path: '{creditNoteId}/void', - urlParams: ['creditNoteId'], + path: '{id}/void', + urlParams: ['id'], }), }); diff --git a/lib/resources/Customers.js b/lib/resources/Customers.js index cdfa6e9e04..cddad251fb 100644 --- a/lib/resources/Customers.js +++ b/lib/resources/Customers.js @@ -22,8 +22,8 @@ module.exports = StripeResource.extend({ _legacyUpdateSubscription: stripeMethod({ method: 'POST', - path: '{customerId}/subscription', - urlParams: ['customerId'], + path: '{id}/subscription', + urlParams: ['id'], }), _newstyleUpdateSubscription: stripeMethod({ @@ -34,8 +34,8 @@ module.exports = StripeResource.extend({ _legacyCancelSubscription: stripeMethod({ method: 'DELETE', - path: '{customerId}/subscription', - urlParams: ['customerId'], + path: '{id}/subscription', + urlParams: ['id'], }), _newstyleCancelSubscription: stripeMethod({ @@ -46,14 +46,14 @@ module.exports = StripeResource.extend({ createSubscription: stripeMethod({ method: 'POST', - path: '/{customerId}/subscriptions', - urlParams: ['customerId'], + path: '/{id}/subscriptions', + urlParams: ['id'], }), listSubscriptions: stripeMethod({ method: 'GET', - path: '/{customerId}/subscriptions', - urlParams: ['customerId'], + path: '/{id}/subscriptions', + urlParams: ['id'], methodType: 'list', }), diff --git a/lib/resources/Invoices.js b/lib/resources/Invoices.js index a6e21c7f8b..bb4ed6ba01 100644 --- a/lib/resources/Invoices.js +++ b/lib/resources/Invoices.js @@ -10,26 +10,26 @@ module.exports = StripeResource.extend({ finalizeInvoice: stripeMethod({ method: 'POST', - path: '{invoiceId}/finalize', - urlParams: ['invoiceId'], + path: '{id}/finalize', + urlParams: ['id'], }), markUncollectible: stripeMethod({ method: 'POST', - path: '{invoiceId}/mark_uncollectible', - urlParams: ['invoiceId'], + path: '{id}/mark_uncollectible', + urlParams: ['id'], }), pay: stripeMethod({ method: 'POST', - path: '{invoiceId}/pay', - urlParams: ['invoiceId'], + path: '{id}/pay', + urlParams: ['id'], }), retrieveLines: stripeMethod({ method: 'GET', - path: '{invoiceId}/lines', - urlParams: ['invoiceId'], + path: '{id}/lines', + urlParams: ['id'], }), retrieveUpcoming: stripeMethod({ @@ -88,13 +88,13 @@ module.exports = StripeResource.extend({ sendInvoice: stripeMethod({ method: 'POST', - path: '{invoiceId}/send', - urlParams: ['invoiceId'], + path: '{id}/send', + urlParams: ['id'], }), voidInvoice: stripeMethod({ method: 'POST', - path: '{invoiceId}/void', - urlParams: ['invoiceId'], + path: '{id}/void', + urlParams: ['id'], }), }); diff --git a/lib/resources/Orders.js b/lib/resources/Orders.js index 58e420ec3e..c59ea450aa 100644 --- a/lib/resources/Orders.js +++ b/lib/resources/Orders.js @@ -10,13 +10,13 @@ module.exports = StripeResource.extend({ pay: stripeMethod({ method: 'POST', - path: '/{orderId}/pay', - urlParams: ['orderId'], + path: '/{id}/pay', + urlParams: ['id'], }), returnOrder: stripeMethod({ method: 'POST', - path: '/{orderId}/returns', - urlParams: ['orderId'], + path: '/{id}/returns', + urlParams: ['id'], }), }); diff --git a/lib/resources/PaymentIntents.js b/lib/resources/PaymentIntents.js index 70a90ab5d0..86128201da 100644 --- a/lib/resources/PaymentIntents.js +++ b/lib/resources/PaymentIntents.js @@ -9,19 +9,19 @@ module.exports = StripeResource.extend({ cancel: stripeMethod({ method: 'POST', - path: '{paymentIntentId}/cancel', - urlParams: ['paymentIntentId'], + path: '{id}/cancel', + urlParams: ['id'], }), capture: stripeMethod({ method: 'POST', - path: '{paymentIntentId}/capture', - urlParams: ['paymentIntentId'], + path: '{id}/capture', + urlParams: ['id'], }), confirm: stripeMethod({ method: 'POST', - path: '{paymentIntentId}/confirm', - urlParams: ['paymentIntentId'], + path: '{id}/confirm', + urlParams: ['id'], }), }); diff --git a/lib/resources/PaymentMethods.js b/lib/resources/PaymentMethods.js index 4b8601aa25..55c1495e32 100644 --- a/lib/resources/PaymentMethods.js +++ b/lib/resources/PaymentMethods.js @@ -9,13 +9,13 @@ module.exports = StripeResource.extend({ attach: stripeMethod({ method: 'POST', - path: '{paymentMethodId}/attach', - urlParams: ['paymentMethodId'], + path: '{id}/attach', + urlParams: ['id'], }), detach: stripeMethod({ method: 'POST', - path: '{paymentMethodId}/detach', - urlParams: ['paymentMethodId'], + path: '{id}/detach', + urlParams: ['id'], }), }); diff --git a/lib/resources/Payouts.js b/lib/resources/Payouts.js index ec1d8afd35..9c41679c12 100644 --- a/lib/resources/Payouts.js +++ b/lib/resources/Payouts.js @@ -17,14 +17,14 @@ module.exports = StripeResource.extend({ cancel: stripeMethod({ method: 'POST', - path: '{payoutId}/cancel', - urlParams: ['payoutId'], + path: '{id}/cancel', + urlParams: ['id'], }), listTransactions: stripeMethod({ method: 'GET', - path: '{payoutId}/transactions', - urlParams: ['payoutId'], + path: '{id}/transactions', + urlParams: ['id'], methodType: 'list', }), }); diff --git a/lib/resources/Recipients.js b/lib/resources/Recipients.js index 9fce05a6b2..69e7b92255 100644 --- a/lib/resources/Recipients.js +++ b/lib/resources/Recipients.js @@ -17,14 +17,14 @@ module.exports = StripeResource.extend({ createCard: stripeMethod({ method: 'POST', - path: '/{recipientId}/cards', - urlParams: ['recipientId'], + path: '/{id}/cards', + urlParams: ['id'], }), listCards: stripeMethod({ method: 'GET', - path: '/{recipientId}/cards', - urlParams: ['recipientId'], + path: '/{id}/cards', + urlParams: ['id'], methodType: 'list', }), diff --git a/lib/resources/Subscriptions.js b/lib/resources/Subscriptions.js index 6006a4ad62..4deb1b9262 100644 --- a/lib/resources/Subscriptions.js +++ b/lib/resources/Subscriptions.js @@ -12,7 +12,7 @@ module.exports = StripeResource.extend({ */ deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{subscriptionId}/discount', - urlParams: ['subscriptionId'], + path: '/{id}/discount', + urlParams: ['id'], }), }); diff --git a/lib/resources/Topups.js b/lib/resources/Topups.js index bdbf04a9e1..41d755b48b 100644 --- a/lib/resources/Topups.js +++ b/lib/resources/Topups.js @@ -16,7 +16,7 @@ module.exports = StripeResource.extend({ cancel: stripeMethod({ method: 'POST', - path: '{topupId}/cancel', - urlParams: ['topupId'], + path: '{id}/cancel', + urlParams: ['id'], }), }); diff --git a/lib/resources/Transfers.js b/lib/resources/Transfers.js index 36a210b9c8..a3d87987ff 100644 --- a/lib/resources/Transfers.js +++ b/lib/resources/Transfers.js @@ -1,4 +1,4 @@ -'use strict'; +id'use strict'; var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method; @@ -17,20 +17,20 @@ module.exports = StripeResource.extend({ reverse: stripeMethod({ method: 'POST', - path: '/{transferId}/reversals', - urlParams: ['transferId'], + path: '/{id}/reversals', + urlParams: ['id'], }), cancel: stripeMethod({ method: 'POST', - path: '{transferId}/cancel', - urlParams: ['transferId'], + path: '{id}/cancel', + urlParams: ['id'], }), listTransactions: stripeMethod({ method: 'GET', - path: '{transferId}/transactions', - urlParams: ['transferId'], + path: '{id}/transactions', + urlParams: ['id'], methodType: 'list', }), @@ -39,14 +39,14 @@ module.exports = StripeResource.extend({ */ createReversal: stripeMethod({ method: 'POST', - path: '/{transferId}/reversals', - urlParams: ['transferId'], + path: '/{id}/reversals', + urlParams: ['id'], }), listReversals: stripeMethod({ method: 'GET', - path: '/{transferId}/reversals', - urlParams: ['transferId'], + path: '/{id}/reversals', + urlParams: ['id'], methodType: 'list', }), diff --git a/lib/resources/UsageRecords.js b/lib/resources/UsageRecords.js index fb4eb1436a..697539aa14 100644 --- a/lib/resources/UsageRecords.js +++ b/lib/resources/UsageRecords.js @@ -8,7 +8,7 @@ module.exports = StripeResource.extend({ create: stripeMethod({ method: 'POST', - path: '{subscriptionItem}/usage_records', - urlParams: ['subscriptionItem'], + path: '{id}/usage_records', + urlParams: ['id'], }), }); From 66f7801e4a2bcbb4e4f612eee62679af63f3076e Mon Sep 17 00:00:00 2001 From: Bryan Irace Date: Tue, 7 May 2019 15:48:04 -0400 Subject: [PATCH 2/2] Fix typo --- lib/resources/Transfers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/resources/Transfers.js b/lib/resources/Transfers.js index a3d87987ff..04f4dc2386 100644 --- a/lib/resources/Transfers.js +++ b/lib/resources/Transfers.js @@ -1,4 +1,4 @@ -id'use strict'; +'use strict'; var StripeResource = require('../StripeResource'); var stripeMethod = StripeResource.method;