From 62d9941f8e02bb6beae6777b68abbadcfd56171e Mon Sep 17 00:00:00 2001 From: Joey Dong Date: Thu, 7 Jun 2018 16:34:04 -0700 Subject: [PATCH] Update SourceParams function docs to mirror site --- .../stripe/android/model/SourceParams.java | 143 ++++++++++++------ 1 file changed, 94 insertions(+), 49 deletions(-) diff --git a/stripe/src/main/java/com/stripe/android/model/SourceParams.java b/stripe/src/main/java/com/stripe/android/model/SourceParams.java index 3c8261129f5..13a254e173f 100644 --- a/stripe/src/main/java/com/stripe/android/model/SourceParams.java +++ b/stripe/src/main/java/com/stripe/android/model/SourceParams.java @@ -105,13 +105,18 @@ public static SourceParams createP24Params( } /** - * Create parameters used to generate a reusable Alipay source. + * Create parameters necessary for creating a reusable Alipay source. * - * @param currency the currency code that this source will be charged in - * @param name the user's name - * @param email the user's email - * @param returnUrl a url used to reopen the application + * @param currency The currency of the payment. Must be the default currency for your country. + * Can be aud, cad, eur, gbp, hkd, jpy, nzd, sgd, or usd. Users in Denmark, + * Norway, Sweden, or Switzerland must use eur. + * @param name The name of the account holder (optional). + * @param email The email address of the account holder (optional). + * @param returnUrl The URL the customer should be redirected to after the authorization + * process. * @return a {@link SourceParams} that can be used to create an Alipay reusable source + * + * @see https://stripe.com/docs/sources/alipay */ public static SourceParams createAlipayReusableParams( @NonNull String currency, @@ -136,14 +141,20 @@ public static SourceParams createAlipayReusableParams( } /** - * Create a source to be used with the Alipay SDK for single-use payments. + * Create parameters necessary for creating a single use Alipay source. * - * @param amount the amount of the purchase - * @param currency the currency code of the purchase - * @param name the user's name - * @param email the user's email - * @param returnUrl the return url to reopen the activity + * @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 of the payment. Must be the default currency for your country. + * Can be aud, cad, eur, gbp, hkd, jpy, nzd, sgd, or usd. Users in Denmark, + * Norway, Sweden, or Switzerland must use eur. + * @param name The name of the account holder (optional). + * @param email The email address of the account holder (optional). + * @param returnUrl The URL the customer should be redirected to after the authorization + * process. * @return a {@link SourceParams} that can be used to create an Alipay single-use source + * + * @see https://stripe.com/docs/sources/alipay */ @NonNull public static SourceParams createAlipaySingleUseParams( @@ -170,13 +181,18 @@ public static SourceParams createAlipaySingleUseParams( } /** - * Create a set of parameters used for a Bancontact source. + * Create parameters necessary for creating a Bancontact source. * - * @param amount amount to be charged - * @param name account owner name - * @param returnUrl a URL redirect - * @param statementDescriptor a description of the transaction to put on the customer statement + * @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). The charge amount must be + * at least €1 or its equivalent in the given currency. + * @param name The full name of the account holder. + * @param returnUrl The URL the customer should be redirected to after the authorization + * process. + * @param statementDescriptor A custom statement descriptor for the payment (optional). * @return a {@link SourceParams} object that can be used to create a Bancontact source + * + * @see https://stripe.com/docs/sources/bancontact */ @NonNull public static SourceParams createBancontactParams( @@ -212,10 +228,12 @@ public static SourceParams createCustomParams() { } /** - * Create a set of parameters for a credit card source. + * Create parameters necessary for creating a card source. * - * @param card a {@link Card} object containing the details necessary for the source - * @return a {@link SourceParams} object that can be used to create a card source + * @param card A {@link Card} object containing the details necessary for the source. + * @return a {@link SourceParams} object that can be used to create a card source. + * + * @see https://stripe.com/docs/sources/cards */ @NonNull public static SourceParams createCardParams(@NonNull Card card) { @@ -292,11 +310,15 @@ public static SourceParams createEPSParams( /** * Create parameters necessary for creating a Giropay source * - * @param amount amount of the transaction - * @param name source owner name - * @param returnUrl redirect URL - * @param statementDescriptor a description of the transaction + * @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 name The full name of the account holder. + * @param returnUrl The URL the customer should be redirected to after the authorization + * process. + * @param statementDescriptor A custom statement descriptor for the payment (optional). * @return a {@link SourceParams} object that can be used to create a Giropay source + * + * @see https://stripe.com/docs/sources/giropay */ @NonNull public static SourceParams createGiropayParams( @@ -321,14 +343,18 @@ public static SourceParams createGiropayParams( } /** - * Create parameters needed to make an iDEAL source. + * Create parameters necessary for creating an iDEAL source. * - * @param amount amount of the transaction - * @param name owner name - * @param returnUrl redirect URL - * @param statementDescriptor a description of the transaction - * @param bank bank id for the iDEAL 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 name The full name of the account holder (optional). + * @param returnUrl The URL the customer should be redirected to after the authorization + * process. + * @param statementDescriptor A custom statement descriptor for the payment (optional). + * @param bank The customer’s bank (optional). * @return a {@link SourceParams} object that can be used to create an iDEAL source + * + * @see https://stripe.com/docs/sources/ideal */ @NonNull public static SourceParams createIdealParams( @@ -398,13 +424,16 @@ public static SourceParams createSepaDebitParams( /** * Create parameters necessary to create a SEPA debit source * - * @param name owner name - * @param iban bank IBAN - * @param addressLine1 1-line address of the owner - * @param city city of source owner's address - * @param postalCode postal code for source owner's address - * @param country country code for source owner's address + * @param name The full name of the account holder. + * @param iban The IBAN number for the bank account that you wish to debit. + * @param email The full email address of the owner (optional). + * @param addressLine1 The first line of the owner's address (optional). + * @param city The city of the owner's address. + * @param postalCode The postal code of the owner's address. + * @param country The ISO-3166 2-letter country code of the owner's address. * @return a {@link SourceParams} object that can be used to create a SEPA debit source + * + * @see https://stripe.com/docs/sources/sepa-debit */ @NonNull public static SourceParams createSepaDebitParams( @@ -435,13 +464,17 @@ public static SourceParams createSepaDebitParams( } /** - * Create parameters needed to make a SOFORT source. + * Create parameters necessary to create a SOFORT source. * - * @param amount the amount of the transaction - * @param returnUrl the redirect URL - * @param country the country code for the source - * @param statementDescriptor a description of the transaction + * @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 country The ISO-3166 2-letter country code of the customer’s bank. + * @param statementDescriptor A custom statement descriptor for the payment (optional). * @return a {@link SourceParams} object that can be used to create a SOFORT source + * + * @see https://stripe.com/docs/sources/sofort */ @NonNull public static SourceParams createSofortParams( @@ -466,13 +499,16 @@ public static SourceParams createSofortParams( } /** - * Create parameters needed to make a 3D-Secure source. + * Create parameters necessary to create a 3D Secure source. * - * @param amount amount of the transaction - * @param currency currency code for the transaction - * @param returnUrl the redirect url - * @param cardID the ID from the card source object used to create this 3DS source - * @return a {@link SourceParams} object that can be used 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 https://stripe.com/docs/sources/three-d-secure */ @NonNull public static SourceParams createThreeDSecureParams( @@ -492,8 +528,11 @@ public static SourceParams createThreeDSecureParams( /** * Create parameters needed to make a Visa Checkout source. * - * @param callId the ID from the Visa Checkout SDK + * @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 https://stripe.com/docs/visa-checkout + * @see https://developer.visa.com/capabilities/visa_checkout/docs */ public static SourceParams createVisaCheckoutParams(@NonNull String callId) { SourceParams params = new SourceParams().setType(Source.CARD); @@ -505,10 +544,16 @@ public static SourceParams createVisaCheckoutParams(@NonNull String callId) { /** * Create parameters needed to make a Masterpass source - * @param transactionId the ID from the Masterpass SDK - * @param cartID the cart ID provided when creating a cart for checkout in the Masterpass SDK + * + * @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 https://stripe.com/docs/masterpass + * @see https://developer.mastercard.com/product/masterpass + * @see https://developer.mastercard.com/page/masterpass-merchant-mobile-checkout-sdk-for-android-v2 */ public static SourceParams createMasterpassParams( @NonNull String transactionId,