Skip to content

Commit

Permalink
use assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
janpaepke committed Sep 27, 2024
1 parent d18fa03 commit 9b065b7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/binders/payments/captures/PaymentCapturesBinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export default class PaymentCapturesBinder extends Binder<CaptureData, Capture>
public create(parameters: CreateParameters) {
if (renege(this, this.create, ...arguments)) return;
const { paymentId, ...data } = parameters;
if (!checkId(paymentId, 'payment')) {
throw new ApiError('The payment id is invalid');
}
assertWellFormedId(paymentId, 'payment');
return this.networkClient.post<CaptureData, Capture>(getPathSegments(paymentId), data);
}

Expand Down

0 comments on commit 9b065b7

Please sign in to comment.