@NonNull
    public static PaymentIntentParams createConfirmPaymentIntentWithPaymentMethodId(
            @Nullable String paymentMethodId,
            @NonNull String clientSecret,
            @NonNull String returnUrl,
            boolean savePaymentMethod) {
        return new PaymentIntentParams()
                .setPaymentMethodId(paymentMethodId)
                .setClientSecret(clientSecret)
                .setReturnUrl(returnUrl)
                .setSavePaymentMethod(savePaymentMethod);
    }
@ NonNull public static PaymentIntentParams createConfirmPaymentIntentWithPaymentMethodId ( @ Nullable String paymentMethodId , @ NonNull String clientSecret , @ NonNull String returnUrl , boolean savePaymentMethod ) { return new PaymentIntentParams ( ) . setPaymentMethodId ( paymentMethodId ) . setClientSecret ( clientSecret ) . setReturnUrl ( returnUrl ) . setSavePaymentMethod ( savePaymentMethod ) ; }
Create the parameters necessary for confirming a PaymentIntent while attaching a
PaymentMethod that already exits.

@param paymentMethodId the ID of the PaymentMethod that is being attached to the
PaymentIntent being confirmed
@param clientSecret client secret from the PaymentIntent being confirmed
@param returnUrl the URL the customer should be redirected to after the authorization
process
@param savePaymentMethod Set to {@code true} to save this PaymentIntent’s payment method to
the associated Customer, if the payment method is not already
attached. This parameter only applies to the payment method passed
in the same request or the current payment method attached to the
PaymentIntent and must be specified again if a new payment method is
added.
@return params that can be use to confirm a PaymentIntent