Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename methods to include params #609

Merged
merged 2 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void retrievePaymentIntent(final String clientSecret) {
@Override
public PaymentIntent call() throws Exception {
PaymentIntentParams paymentIntentParams =
PaymentIntentParams.createRetrievePaymentIntent(clientSecret);
PaymentIntentParams.createRetrievePaymentIntentParams(clientSecret);
return mStripe.retrievePaymentIntentSynchronous(
paymentIntentParams,
PaymentConfiguration.getInstance().getPublishableKey());
Expand Down Expand Up @@ -207,7 +207,7 @@ void confirmPaymentIntent(final String clientSecret, Card card) {
@Override
public PaymentIntent call() throws Exception {
PaymentIntentParams paymentIntentParams =
PaymentIntentParams.createConfirmPaymentIntentWithSourceData(
PaymentIntentParams.createConfirmPaymentIntentWithSourceDataParams(
sourceParams,
clientSecret,
RETURN_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static PaymentIntentParams createCustomParams() {
* @return params that can be use to confirm a PaymentIntent
*/
@NonNull
public static PaymentIntentParams createConfirmPaymentIntentWithSourceData(
public static PaymentIntentParams createConfirmPaymentIntentWithSourceDataParams(
@Nullable SourceParams sourceParams,
@NonNull String clientSecret,
@Nullable String returnUrl) {
Expand All @@ -65,7 +65,7 @@ public static PaymentIntentParams createConfirmPaymentIntentWithSourceData(
* @return params that can be use to confirm a PaymentIntent
*/
@NonNull
public static PaymentIntentParams createConfirmPaymentIntentWithSourceId(
public static PaymentIntentParams createConfirmPaymentIntentWithSourceIdParams(
@Nullable String sourceId,
@NonNull String clientSecret,
@Nullable String returnUrl) {
Expand All @@ -82,7 +82,7 @@ public static PaymentIntentParams createConfirmPaymentIntentWithSourceId(
* @return params that can be used to retrieve a PaymentIntent
*/
@NonNull
public static PaymentIntentParams createRetrievePaymentIntent(
public static PaymentIntentParams createRetrievePaymentIntentParams(
@NonNull String clientSecret) {
return new PaymentIntentParams().setClientSecret(clientSecret);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void disabled_confirmPaymentIntent_withSourceData_canSuccessfulConfirm()
try {

Card card = new Card("4242424242424242", 1, 2050, "123");
PaymentIntentParams paymentIntentParams = PaymentIntentParams.createConfirmPaymentIntentWithSourceData(
PaymentIntentParams paymentIntentParams = PaymentIntentParams.createConfirmPaymentIntentWithSourceDataParams(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth renaming the test case method names to include the Params word?

SourceParams.createCardParams(card),
clientSecret,
null
Expand All @@ -300,7 +300,7 @@ public void disabled_confirmPaymentIntent_withSourceId_canSuccessfulConfirm() {
String publicKey = "put a public key that matches the private key here";
String sourceId = "id of the source created on the backend";
try {
PaymentIntentParams paymentIntentParams = PaymentIntentParams.createConfirmPaymentIntentWithSourceId(
PaymentIntentParams paymentIntentParams = PaymentIntentParams.createConfirmPaymentIntentWithSourceIdParams(
sourceId,
clientSecret,
null
Expand All @@ -326,7 +326,7 @@ public void disabled_confirmRetrieve_withSourceId_canSuccessfulRetrieve() {
String publicKey = "put a public key that matches the private key here";
try {

PaymentIntentParams paymentIntentParams = PaymentIntentParams.createRetrievePaymentIntent(
PaymentIntentParams paymentIntentParams = PaymentIntentParams.createRetrievePaymentIntentParams(
clientSecret
);
PaymentIntent paymentIntent = StripeApiHandler.retrievePaymentIntent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class PaymentIntentParamsTest {
@Test
public void createConfirmPaymentIntentWithSourceData_withAllFields_hasExpectedFields() {
SourceParams sourceParams = SourceParams.createCardParams(FULL_FIELDS_VISA_CARD);
PaymentIntentParams params = PaymentIntentParams.createConfirmPaymentIntentWithSourceData(
PaymentIntentParams params = PaymentIntentParams.createConfirmPaymentIntentWithSourceDataParams(
sourceParams,
TEST_CLIENT_SECRET,
TEST_RETURN_URL);
Expand All @@ -50,7 +50,7 @@ public void createConfirmPaymentIntentWithSourceData_withAllFields_hasExpectedFi

@Test
public void createConfirmPaymentIntentWithSourceId_withAllFields_hasExpectedFields() {
PaymentIntentParams params = PaymentIntentParams.createConfirmPaymentIntentWithSourceId(
PaymentIntentParams params = PaymentIntentParams.createConfirmPaymentIntentWithSourceIdParams(
TEST_SOURCE_ID,
TEST_CLIENT_SECRET,
TEST_RETURN_URL);
Expand All @@ -62,7 +62,7 @@ public void createConfirmPaymentIntentWithSourceId_withAllFields_hasExpectedFiel

@Test
public void createRetrievePaymentIntentWithSourceId_hasExpectedFields() {
PaymentIntentParams params = PaymentIntentParams.createRetrievePaymentIntent(
PaymentIntentParams params = PaymentIntentParams.createRetrievePaymentIntentParams(
TEST_CLIENT_SECRET);

Assert.assertEquals(TEST_CLIENT_SECRET, params.getClientSecret());
Expand Down Expand Up @@ -91,7 +91,7 @@ public void createCustomParam_toParamMap_createsExpectedMap() {

@Test
public void toParamMap_whenExtraParamsProvided_createsExpectedMap() {
PaymentIntentParams paymentIntentParams = PaymentIntentParams.createRetrievePaymentIntent(
PaymentIntentParams paymentIntentParams = PaymentIntentParams.createRetrievePaymentIntentParams(
TEST_CLIENT_SECRET);
Map<String, Object> extraParams = new HashMap<>();
String extraParamKey1 = "extra_param_key_1";
Expand Down