Skip to content

Commit 6188384

Browse files
author
serverpod_cloud
committed
feat(console): 1ed6505aba217e5c6577ce5a4554f2238ea8f9d9
1 parent 78bd21a commit 6188384

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

ground_control_client/lib/src/protocol/client.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,21 @@ class EndpointBilling extends _i1.EndpointRef {
436436
/// Returns `true` if a payment method is required, `false` otherwise.
437437
_i2.Future<bool> isPaymentMethodRequired() =>
438438
caller.callServerEndpoint<bool>('billing', 'isPaymentMethodRequired', {});
439+
440+
/// Sets the default payment method for the authenticated user.
441+
///
442+
/// This endpoint sets the specified payment method as the default for the user's
443+
/// payment customer. The endpoint validates that:
444+
/// - The payment method belongs to the user
445+
///
446+
/// [paymentMethodId] The ID of the payment method to set as default.
447+
///
448+
/// Throws [NotFoundException] if the user is not found or has no payment customer.
449+
/// Throws [InvalidValueServerException] if the payment method doesn't belong to the user.
450+
_i2.Future<void> setDefaultPaymentMethod({required String paymentMethodId}) =>
451+
caller.callServerEndpoint<void>('billing', 'setDefaultPaymentMethod', {
452+
'paymentMethodId': paymentMethodId,
453+
});
439454
}
440455

441456
/// {@category Endpoint}

0 commit comments

Comments
 (0)