Skip to content

Commit

Permalink
Remove endpoint aliases.
Browse files Browse the repository at this point in the history
These endpoint aliases were deprecated in #234. The first version to include this deprecation is 3.6.0, released on 10 February 2022.

In the era of TypeScript, I feel the confusion caused by having two (or sometimes three) separate functions in the type definition outweighs the backwards compatibility. Consumers of an API expect every part of it to be significant.
  • Loading branch information
Pimm committed May 25, 2023
1 parent 45895af commit f718c94
Show file tree
Hide file tree
Showing 38 changed files with 71 additions and 505 deletions.
21 changes: 0 additions & 21 deletions src/binders/chargebacks/ChargebacksBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,6 @@ export default class ChargebacksBinder extends InnerBinder<ChargebackData, Charg
super();
}

/**
* Retrieve all chargebacks filed for your payments.
*
* The results are paginated. See pagination for more information.
*
* @since 2.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/chargebacks-api/list-chargebacks
*/
public all: ChargebacksBinder['page'] = this.page;
/**
* Retrieve all chargebacks filed for your payments.
*
* The results are paginated. See pagination for more information.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/chargebacks-api/list-chargebacks
*/
public list: ChargebacksBinder['page'] = this.page;

/**
* Retrieve all chargebacks filed for your payments.
*
Expand Down
29 changes: 0 additions & 29 deletions src/binders/customers/CustomersBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,6 @@ export default class CustomersBinder extends Binder<CustomerData, Customer> {
super();
}

/**
* Retrieve all customers created.
*
* The results are paginated. See pagination for more information.
*
* @since 2.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/customers-api/list-customers
*/
public all: CustomersBinder['page'] = this.page;
/**
* Retrieve all customers created.
*
* The results are paginated. See pagination for more information.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/customers-api/list-customers
*/
public list: CustomersBinder['page'] = this.page;
/**
* Delete a customer. All mandates and subscriptions created for this customer will be canceled as well.
*
* @since 2.0.0
* @deprecated Use `delete` instead.
* @see https://docs.mollie.com/reference/v2/customers-api/delete-customer
*/
public cancel: CustomersBinder['delete'] = this.delete;

/**
* Creates a simple minimal representation of a customer in the Mollie API to use for the [Mollie Checkout](https://www.mollie.com/products/checkout) and Recurring features. These customers will
* appear in your [Mollie Dashboard](https://www.mollie.com/dashboard) where you can manage their details, and also see their payments and subscriptions.
Expand Down
37 changes: 0 additions & 37 deletions src/binders/customers/mandates/CustomerMandatesBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,6 @@ export default class CustomerMandatesBinder extends InnerBinder<MandateData, Man
super();
}

/**
* Retrieve all mandates for the given `customerId`, ordered from newest to oldest.
*
* The results are paginated. See pagination for more information.
*
* @since 1.2.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/mandates-api/list-mandates
*/
public all: CustomerMandatesBinder['page'] = this.page;
/**
* Retrieve all mandates for the given `customerId`, ordered from newest to oldest.
*
* The results are paginated. See pagination for more information.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/mandates-api/list-mandates
*/
public list: CustomerMandatesBinder['page'] = this.page;
/**
* Revoke a customer's mandate. You will no longer be able to charge the consumer's bank account or credit card with this mandate and all connected subscriptions will be canceled.
*
* @since 1.3.2
* @deprecated Use `revoke` instead.
* @see https://docs.mollie.com/reference/v2/mandates-api/revoke-mandate
*/
public cancel: CustomerMandatesBinder['revoke'] = this.revoke;
/**
* Revoke a customer's mandate. You will no longer be able to charge the consumer's bank account or credit card with this mandate and all connected subscriptions will be canceled.
*
* @since 2.0.0
* @deprecated Use `revoke` instead.
* @see https://docs.mollie.com/reference/v2/mandates-api/revoke-mandate
*/
public delete: CustomerMandatesBinder['revoke'] = this.revoke;

/**
* Create a mandate for a specific customer. Mandates allow you to charge a customer's credit card, PayPal account or bank account recurrently.
*
Expand Down
17 changes: 0 additions & 17 deletions src/binders/customers/payments/CustomerPaymentsBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,6 @@ export default class CustomerPaymentsBinder extends InnerBinder<PaymentData, Pay
super();
}

/**
* Retrieve all Payments linked to the Customer.
*
* @since 1.1.1
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/customers-api/list-customer-payments
*/
public all: CustomerPaymentsBinder['page'] = this.page;
/**
* Retrieve all Payments linked to the Customer.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/customers-api/list-customer-payments
*/
public list: CustomerPaymentsBinder['page'] = this.page;

/**
* Creates a payment for the customer.
*
Expand Down
25 changes: 0 additions & 25 deletions src/binders/customers/subscriptions/CustomerSubscriptionsBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,6 @@ export default class CustomerSubscriptionsBinder extends InnerBinder<Subscriptio
super();
}

/**
* A subscription can be canceled any time by calling `DELETE` on the resource endpoint.
*
* @since 1.3.2
* @deprecated Use `cancel` instead.
* @see https://docs.mollie.com/reference/v2/subscriptions-api/cancel-subscription
*/
public delete: CustomerSubscriptionsBinder['cancel'] = this.cancel;
/**
* Retrieve all subscriptions of a customer.
*
* @since 1.3.2
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/subscriptions-api/list-subscriptions
*/
public all: CustomerSubscriptionsBinder['page'] = this.page;
/**
* Retrieve all subscriptions of a customer.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/subscriptions-api/list-subscriptions
*/
public list: CustomerSubscriptionsBinder['page'] = this.page;

/**
* With subscriptions, you can schedule recurring payments to take place at regular intervals.
*
Expand Down
37 changes: 0 additions & 37 deletions src/binders/methods/MethodsBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,6 @@ export default class MethodsBinder extends Binder<MethodData, Method> {
super();
}

/**
* Retrieve all enabled payment methods. The results are not paginated.
*
* - For test mode, payment methods are returned that are enabled in the Dashboard (or the activation is pending).
* - For live mode, payment methods are returned that have been activated on your account and have been enabled in the Dashboard.
*
* New payment methods can be activated via the Enable payment method endpoint in the Profiles API.
*
* When using the `first` sequence type, methods will be returned if they can be used as a first payment in a recurring sequence and if they are enabled in the Dashboard.
*
* When using the `recurring` sequence type, payment methods that can be used for recurring payments or subscriptions will be returned. Enabling / disabling methods in the dashboard does not affect
* how they can be used for recurring payments.
*
* @since 2.0.0
* @deprecated Use `list` instead.
* @see https://docs.mollie.com/reference/v2/methods-api/list-methods
*/
public all: MethodsBinder['list'] = this.list;
/**
* Retrieve all enabled payment methods. The results are not paginated.
*
* - For test mode, payment methods are returned that are enabled in the Dashboard (or the activation is pending).
* - For live mode, payment methods are returned that have been activated on your account and have been enabled in the Dashboard.
*
* New payment methods can be activated via the Enable payment method endpoint in the Profiles API.
*
* When using the `first` sequence type, methods will be returned if they can be used as a first payment in a recurring sequence and if they are enabled in the Dashboard.
*
* When using the `recurring` sequence type, payment methods that can be used for recurring payments or subscriptions will be returned. Enabling / disabling methods in the dashboard does not affect
* how they can be used for recurring payments.
*
* @since 3.0.0
* @deprecated Use `list` instead.
* @see https://docs.mollie.com/reference/v2/methods-api/list-methods
*/
public page: MethodsBinder['list'] = this.list;

/**
* Retrieve a single method by its ID. Note that if a method is not available on the website profile a status `404 Not found` is returned. When the method is not enabled, a status `403 Forbidden` is
* returned. You can enable payments methods via the Enable payment method endpoint in the Profiles API, or via your [Mollie Dashboard](https://www.mollie.com/dashboard).
Expand Down
41 changes: 0 additions & 41 deletions src/binders/orders/OrdersBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,47 +38,6 @@ export default class OrdersBinder extends Binder<OrderData, Order> {
super();
}

/**
* The order can only be canceled while:
*
* - the order doesn't have any open payments except for the methods `banktransfer`, `directdebit`, `klarnapaylater`, `klarnapaynow`, and `klarnasliceit`.
* - the order's `status` field is either `created`, `authorized` or `shipping`[1].
*
* 1. In case of `created`, all order lines will be canceled and the new order status will be `canceled`.
* 2. In case of `authorized`, the authorization will be released, all order lines will be canceled and the new order status will be `canceled`.
* 3. In case of `shipping`, any order lines that are still `authorized` will be canceled and order lines that are `shipping` will be completed. The new order status will be `completed`.
*
* For more information about the status transitions, check our order status changes guide.
*
* [1] If the order status is `shipping`, some order lines can have the status `paid` if the order was paid using a payment method that does not support authorizations (such as iDEAL) and the order
* lines are not shipped yet. In this case, the order cannot be canceled. You should create refunds for these order lines instead.
*
* @since 3.0.0
* @deprecated Use `cancel` instead.
* @see https://docs.mollie.com/reference/v2/orders-api/cancel-order
*/
public delete: OrdersBinder['cancel'] = this.cancel;
/**
* Retrieve all orders.
*
* The results are paginated. See pagination for more information.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/orders-api/list-orders
*/
public all: OrdersBinder['page'] = this.page;
/**
* Retrieve all orders.
*
* The results are paginated. See pagination for more information.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/orders-api/list-orders
*/
public list: OrdersBinder['page'] = this.page;

/**
* Using the Orders API is the preferred approach when integrating the Mollie API into e-commerce applications such as webshops. If you want to use *Klarna Pay now*, *Klarna Pay later*, *Klarna
* Slice it*, *in3* or *Vouchers*, using the Orders API is mandatory.
Expand Down
22 changes: 0 additions & 22 deletions src/binders/orders/orderlines/OrderLinesBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,6 @@ export default class OrderLinesBinder extends InnerBinder<OrderData, Order> {
super();
}

/**
* This endpoint can be used to cancel one or more order lines that were previously authorized using a Klarna payment method. Use the Cancel order endpoint if you want to cancel the entire order or
* the remainder of the order.
*
* Canceling or partially canceling an order line will immediately release the authorization held for that amount. Your customer will be able to see the updated order in his portal / app. Any
* canceled lines will be removed from the customer's point of view, but will remain visible in the Mollie Dashboard.
*
* You should cancel an order line if you do not intend to (fully) ship it.
*
* An order line can only be canceled while its `status` field is either `authorized` or `shipping`. If you cancel an `authorized` order line, the new order line status will be `canceled`. Canceling
* a `shipping` order line will result in a `completed` order line status.
*
* If the order line is `paid` or already `completed`, you should create a refund using the Create order refund endpoint instead.
*
* For more information about the status transitions, check our order status changes guide.
*
* @since 3.0.0
* @deprecated Use `cancel` instead.
* @see https://docs.mollie.com/reference/v2/orders-api/cancel-order-lines
*/
public delete: OrderLinesBinder['cancel'] = this.cancel;

/**
* This endpoint can be used to update an order line. Only the lines that belong to an order with status `created`, `pending` or `authorized` can be updated.
*
Expand Down
17 changes: 0 additions & 17 deletions src/binders/orders/shipments/OrderShipmentsBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@ export default class OrderShipmentsBinder extends InnerBinder<ShipmentData, Ship
super();
}

/**
* Retrieve all shipments for an order.
*
* @since 3.0.0
* @deprecated Use `list` instead.
* @see https://docs.mollie.com/reference/v2/shipments-api/list-shipments
*/
public all: OrderShipmentsBinder['list'] = this.list;
/**
* Retrieve all shipments for an order.
*
* @since 3.0.0
* @deprecated Use `list` instead.
* @see https://docs.mollie.com/reference/v2/shipments-api/list-shipments
*/
public page: OrderShipmentsBinder['list'] = this.list;

/**
* Create a shipment for specific order lines of an order.
*
Expand Down
32 changes: 0 additions & 32 deletions src/binders/payments/PaymentsBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,6 @@ export default class PaymentsBinder extends Binder<PaymentData, Payment> {
super();
}

/**
* Retrieve all payments created with the current website profile, ordered from newest to oldest.
*
* The results are paginated. See pagination for more information.
*
* @since 2.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/payments-api/list-payments
*/
public all: PaymentsBinder['page'] = this.page;
/**
* Retrieve all payments created with the current website profile, ordered from newest to oldest.
*
* The results are paginated. See pagination for more information.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/payments-api/list-payments
*/
public list: PaymentsBinder['page'] = this.page;
/**
* Some payment methods can be canceled by the merchant for a certain amount of time, usually until the next business day. Or as long as the payment status is `open`. Payments may be canceled
* manually from the Mollie Dashboard, or programmatically by using this endpoint.
*
* The `isCancelable` property on the Payment object will indicate if the payment can be canceled.
*
* @since 2.0.0
* @deprecated Use `cancel` instead.
* @see https://docs.mollie.com/reference/v2/payments-api/cancel-payment
*/
public delete: PaymentsBinder['cancel'] = this.cancel;

/**
* Payment creation is elemental to the Mollie API: this is where most payment implementations start off.
*
Expand Down
23 changes: 0 additions & 23 deletions src/binders/payments/captures/PaymentCapturesBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,6 @@ export default class PaymentCapturesBinder extends InnerBinder<CaptureData, Capt
super();
}

/**
* Retrieve all captures for a certain payment.
*
* Captures are used for payments that have the *authorize-then-capture* flow. The only payment methods at the moment that have this flow are *Klarna Pay now*, *Klarna Pay later* and *Klarna Slice
* it*.
*
* @since 1.1.1
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/captures-api/list-captures
*/
public all: PaymentCapturesBinder['page'] = this.page;
/**
* Retrieve all captures for a certain payment.
*
* Captures are used for payments that have the *authorize-then-capture* flow. The only payment methods at the moment that have this flow are *Klarna Pay now*, *Klarna Pay later* and *Klarna Slice
* it*.
*
* @since 3.0.0
* @deprecated Use `page` instead.
* @see https://docs.mollie.com/reference/v2/captures-api/list-captures
*/
public list: PaymentCapturesBinder['page'] = this.page;

/**
* Retrieve a single capture by its ID. Note the original payment's ID is needed as well.
*
Expand Down
Loading

0 comments on commit f718c94

Please sign in to comment.