/** * Create a custom {@link SourceParams} object. Incorrect attributes may result in errors * when connecting to Stripe's API. * * @return an empty {@link SourceParams} object. */ @NonNull public static SourceParams createCustomParams() { return new SourceParams(); }
/** * Create parameters needed to make a Visa Checkout source. * * @param callId The payment request ID (callId) from the Visa Checkout SDK. * @return a {@link SourceParams} object that can be used to create a Visa Checkout Card Source. * * @see <a href="https://stripe.com/docs/visa-checkout">https://stripe.com/docs/visa-checkout</a> * @see <a href="https://developer.visa.com/capabilities/visa_checkout/docs">https://developer.visa.com/capabilities/visa_checkout/docs</a> */ @NonNull public static SourceParams createVisaCheckoutParams(@NonNull String callId) { return new SourceParams() .setType(Source.CARD) .setApiParameterMap( createSimpleMap(VISA_CHECKOUT, createSimpleMap(CALL_ID, callId))); }
/** * Create parameters needed to make a Masterpass source * * @param transactionId The transaction ID from the Masterpass SDK. * @param cartID A unique string that you generate to identify the purchase when creating a cart * for checkout in the Masterpass SDK. * * @return a {@link SourceParams} object that can be used to create a Masterpass Card Source. * * @see <a href="https://stripe.com/docs/masterpass">https://stripe.com/docs/masterpass</a> * @see <a href="https://developer.mastercard.com/product/masterpass">https://developer.mastercard.com/product/masterpass</a> * @see <a href="https://developer.mastercard.com/page/masterpass-merchant-mobile-checkout-sdk-for-android-v2">https://developer.mastercard.com/page/masterpass-merchant-mobile-checkout-sdk-for-android-v2</a> */ @NonNull public static SourceParams createMasterpassParams( @NonNull String transactionId, @NonNull String cartID) { final Map<String, Object> map = createSimpleMap(TRANSACTION_ID, transactionId); map.put(CART_ID, cartID); return new SourceParams() .setType(Source.CARD) .setApiParameterMap(createSimpleMap(MASTERPASS, map)); }
@Nullable String statementDescriptor, @Nullable String bank) { final SourceParams params = new SourceParams() .setType(Source.IDEAL) .setCurrency(Source.EURO)
/** * Create parameters necessary to create a 3D Secure source. * * @param amount A positive integer in the smallest currency unit representing the amount to * charge the customer (e.g., 1099 for a €10.99 payment). * @param currency The currency the payment is being created in (e.g., eur). * @param returnUrl The URL the customer should be redirected to after the verification process. * @param cardID The ID of the card source. * @return a {@link SourceParams} object that can be used to create a 3D Secure source * * @see <a href="https://stripe.com/docs/sources/three-d-secure">https://stripe.com/docs/sources/three-d-secure</a> */ @NonNull public static SourceParams createThreeDSecureParams( @IntRange(from = 0) long amount, @NonNull String currency, @NonNull String returnUrl, @NonNull String cardID) { final SourceParams params = new SourceParams() .setType(Source.THREE_D_SECURE) .setCurrency(currency) .setAmount(amount) .setRedirect(createSimpleMap(FIELD_RETURN_URL, returnUrl)); params.setApiParameterMap(createSimpleMap(FIELD_CARD, cardID)); return params; }
@NonNull @Size(2) String country, @Nullable String statementDescriptor) { final SourceParams params = new SourceParams() .setType(Source.SOFORT) .setCurrency(Source.EURO)
@Nullable String email, @NonNull String returnUrl) { final SourceParams params = new SourceParams() .setType(Source.ALIPAY) .setCurrency(currency)
@NonNull String email, @NonNull String returnUrl) { final SourceParams params = new SourceParams() .setAmount(amount) .setType(Source.P24)
@Nullable String postalCode, @Nullable @Size(2) String country) { final SourceParams params = new SourceParams() .setType(Source.SEPA_DEBIT) .setCurrency(Source.EURO);
final SourceParams params = new SourceParams().setType(Source.CARD);
/** * Create parameters necessary to create a Multibanco source. * * @param amount A positive integer in the smallest currency unit representing the amount to * charge the customer (e.g., 1099 for a €10.99 payment). * @param returnUrl The URL the customer should be redirected to after the authorization * process. * @param email The full email address of the customer. * @return a {@link SourceParams} object that can be used to create a Multibanco source * * @see <a href="https://stripe.com/docs/sources/multibanco">https://stripe.com/docs/sources/multibanco</a> */ @NonNull public static SourceParams createMultibancoParams( @IntRange(from = 0) long amount, @NonNull String returnUrl, @NonNull String email) { return new SourceParams() .setType(Source.MULTIBANCO) .setCurrency(Source.EURO) .setAmount(amount) .setRedirect(createSimpleMap(FIELD_RETURN_URL, returnUrl)) .setOwner(createSimpleMap(FIELD_EMAIL, email)); }
@Nullable String email, @NonNull String returnUrl) { final SourceParams params = new SourceParams() .setType(Source.ALIPAY) .setCurrency(currency)
@NonNull String returnUrl, @Nullable String statementDescriptor) { final SourceParams params = new SourceParams() .setType(Source.EPS) .setCurrency(Source.EURO)
@NonNull String returnUrl, @Nullable String statementDescriptor) { final SourceParams params = new SourceParams() .setType(Source.GIROPAY) .setCurrency(Source.EURO)
@Nullable String statementDescriptor, @Nullable String preferredLanguage) { final SourceParams params = new SourceParams() .setType(Source.BANCONTACT) .setCurrency(Source.EURO)