/** * Create a custom {@link PaymentIntentParams}. Incorrect attributes may result in errors * when connecting to Stripe's API. * * @return an empty Params object. Call the setter methods on this class to specific values on * the params */ public static PaymentIntentParams createCustomParams() { return new PaymentIntentParams(); }
/** * Create the parameters necessary for retrieving the details of PaymentIntent * * @param clientSecret client secret from the PaymentIntent that is being retrieved * @return params that can be used to retrieve a PaymentIntent */ @NonNull public static PaymentIntentParams createRetrievePaymentIntentParams( @NonNull String clientSecret) { return new PaymentIntentParams().setClientSecret(clientSecret); }
/** * Create the parameters necessary for confirming a PaymentIntent while attaching Source data * * @param sourceParams params for the source that will be attached to this payment intent * @param clientSecret client secret from the PaymentIntent that is to be confirmed * @param returnUrl the URL the customer should be redirected to after the authorization * process * @return params that can be use to confirm a PaymentIntent */ @NonNull public static PaymentIntentParams createConfirmPaymentIntentWithSourceDataParams( @Nullable SourceParams sourceParams, @NonNull String clientSecret, @Nullable String returnUrl) { return new PaymentIntentParams() .setSourceParams(sourceParams) .setClientSecret(clientSecret) .setReturnUrl(returnUrl); }
/** * Create the parameters necessary for confirming a PaymentIntent while attaching a source that * already exits. * * @param sourceId the ID of the source 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 * @return params that can be use to confirm a PaymentIntent */ @NonNull public static PaymentIntentParams createConfirmPaymentIntentWithSourceIdParams( @Nullable String sourceId, @NonNull String clientSecret, @Nullable String returnUrl) { return new PaymentIntentParams() .setSourceId(sourceId) .setClientSecret(clientSecret) .setReturnUrl(returnUrl); }