Skip to content

Commit

Permalink
Merge pull request #611 from stripe/irace-use-id-for-single-positiona…
Browse files Browse the repository at this point in the history
…l-arguments

Use `id` for single positional arguments
  • Loading branch information
irace-stripe authored May 7, 2019
2 parents 48bb048 + 66f7801 commit c88fc91
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 66 deletions.
4 changes: 2 additions & 2 deletions lib/resources/BitcoinReceivers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = StripeResource.extend({

listTransactions: stripeMethod({
method: 'GET',
path: '/{receiverId}/transactions',
urlParams: ['receiverId'],
path: '/{id}/transactions',
urlParams: ['id'],
methodType: 'list',
}),
});
8 changes: 4 additions & 4 deletions lib/resources/Charges.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),

Expand Down
4 changes: 2 additions & 2 deletions lib/resources/CreditNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = StripeResource.extend({

voidCreditNote: stripeMethod({
method: 'POST',
path: '{creditNoteId}/void',
urlParams: ['creditNoteId'],
path: '{id}/void',
urlParams: ['id'],
}),
});
16 changes: 8 additions & 8 deletions lib/resources/Customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports = StripeResource.extend({

_legacyUpdateSubscription: stripeMethod({
method: 'POST',
path: '{customerId}/subscription',
urlParams: ['customerId'],
path: '{id}/subscription',
urlParams: ['id'],
}),

_newstyleUpdateSubscription: stripeMethod({
Expand All @@ -34,8 +34,8 @@ module.exports = StripeResource.extend({

_legacyCancelSubscription: stripeMethod({
method: 'DELETE',
path: '{customerId}/subscription',
urlParams: ['customerId'],
path: '{id}/subscription',
urlParams: ['id'],
}),

_newstyleCancelSubscription: stripeMethod({
Expand All @@ -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',
}),

Expand Down
24 changes: 12 additions & 12 deletions lib/resources/Invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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'],
}),
});
8 changes: 4 additions & 4 deletions lib/resources/Orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
}),
});
12 changes: 6 additions & 6 deletions lib/resources/PaymentIntents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
}),
});
8 changes: 4 additions & 4 deletions lib/resources/PaymentMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
}),
});
8 changes: 4 additions & 4 deletions lib/resources/Payouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),
});
8 changes: 4 additions & 4 deletions lib/resources/Recipients.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),

Expand Down
4 changes: 2 additions & 2 deletions lib/resources/Subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = StripeResource.extend({
*/
deleteDiscount: stripeMethod({
method: 'DELETE',
path: '/{subscriptionId}/discount',
urlParams: ['subscriptionId'],
path: '/{id}/discount',
urlParams: ['id'],
}),
});
4 changes: 2 additions & 2 deletions lib/resources/Topups.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = StripeResource.extend({

cancel: stripeMethod({
method: 'POST',
path: '{topupId}/cancel',
urlParams: ['topupId'],
path: '{id}/cancel',
urlParams: ['id'],
}),
});
20 changes: 10 additions & 10 deletions lib/resources/Transfers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),

Expand All @@ -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',
}),

Expand Down
4 changes: 2 additions & 2 deletions lib/resources/UsageRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = StripeResource.extend({

create: stripeMethod({
method: 'POST',
path: '{subscriptionItem}/usage_records',
urlParams: ['subscriptionItem'],
path: '{id}/usage_records',
urlParams: ['id'],
}),
});

0 comments on commit c88fc91

Please sign in to comment.