diff --git a/pokepaylib/build.gradle b/pokepaylib/build.gradle index c64552b..497a267 100644 --- a/pokepaylib/build.gradle +++ b/pokepaylib/build.gradle @@ -16,7 +16,7 @@ android { minSdkVersion 26 targetSdkVersion 32 versionCode 0 - versionName "2.0.15" + versionName "2.0.16" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -66,7 +66,7 @@ uploadArchives { repositories { mavenDeployer { repository url: "file://${repo.absolutePath}" - pom.version = '2.0.15' // version + pom.version = '2.0.16' // version beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") { diff --git a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/ExternalServiceAPI/Veritrans/GetVeritransToken.java b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/ExternalServiceAPI/Veritrans/GetVeritransToken.java index 05d4a13..3b7cee1 100644 --- a/pokepaylib/src/main/java/jp/pokepay/pokepaylib/ExternalServiceAPI/Veritrans/GetVeritransToken.java +++ b/pokepaylib/src/main/java/jp/pokepay/pokepaylib/ExternalServiceAPI/Veritrans/GetVeritransToken.java @@ -22,12 +22,15 @@ public class GetVeritransToken extends ExternalServiceRequest { public String securityCode; @NonNull public String tokenApiKey; + @NonNull + public String cardholderName; - public GetVeritransToken(@NonNull String cardNumber, @NonNull String cardExpiryDate, @NonNull String securityCode, @NonNull String tokenApiKey) { + public GetVeritransToken(@NonNull String cardNumber, @NonNull String cardExpiryDate, @NonNull String securityCode, @NonNull String tokenApiKey, @NonNull String cardholderName) { this.cardNumber = cardNumber; this.cardExpiryDate = cardExpiryDate; this.securityCode = securityCode; this.tokenApiKey = tokenApiKey; + this.cardholderName = cardholderName; } protected final String path() { @@ -45,6 +48,7 @@ protected final Map parameters() { put("card_expire", cardExpiryDate); put("security_code", securityCode); put("token_api_key", tokenApiKey); + put("cardholder_name", cardholderName); }}; } diff --git a/pokepaylib/src/test/java/jp/pokepay/pokepaylib/CreateCreditCardTest.java b/pokepaylib/src/test/java/jp/pokepay/pokepaylib/CreateCreditCardTest.java index 8ad4727..134db8f 100644 --- a/pokepaylib/src/test/java/jp/pokepay/pokepaylib/CreateCreditCardTest.java +++ b/pokepaylib/src/test/java/jp/pokepay/pokepaylib/CreateCreditCardTest.java @@ -20,7 +20,7 @@ private String fetchVeritransMdkToken() { final String testTokenApiKey = "9ad14759-7082-457e-a874-864c78edc05a"; try { - VeritransToken response = new GetVeritransToken(testCardNumber, "12/23", "123", testTokenApiKey).send(); + VeritransToken response = new GetVeritransToken(testCardNumber, "12/23", "123", testTokenApiKey, "FOO BAR").send(); return response.token; } catch (Exception e) { fail(); diff --git a/pokepaylib/src/test/java/jp/pokepay/pokepaylib/GetVeritransTokenTest.java b/pokepaylib/src/test/java/jp/pokepay/pokepaylib/GetVeritransTokenTest.java index e5d6b7e..94047c0 100644 --- a/pokepaylib/src/test/java/jp/pokepay/pokepaylib/GetVeritransTokenTest.java +++ b/pokepaylib/src/test/java/jp/pokepay/pokepaylib/GetVeritransTokenTest.java @@ -16,7 +16,7 @@ public class GetVeritransTokenTest { @Test public void MDKTokenCanGet() throws ProcessingError { try { - new GetVeritransToken(testCardNumber, "12/23", "123", testTokenApiKey).send(); + new GetVeritransToken(testCardNumber, "12/23", "123", testTokenApiKey, "FOO BAR").send(); } catch (ExternalServiceRequestError e) { fail(e.toString()); } @@ -25,7 +25,7 @@ public void MDKTokenCanGet() throws ProcessingError { @Test public void ThrowErrorIfdExpireDateIsInvalid() throws ProcessingError, ExternalServiceRequestError { try { - new GetVeritransToken(testCardNumber, "1223", "123", testTokenApiKey).send(); + new GetVeritransToken(testCardNumber, "1223", "123", testTokenApiKey, "FOO BAR").send(); fail(); } catch (VeritransRequestError e) { assertEquals("failure", e.error.status); diff --git a/sample/src/main/java/jp/pokepay/pokepay/CreditCardActivity.java b/sample/src/main/java/jp/pokepay/pokepay/CreditCardActivity.java index 47ebe9d..7c33e11 100644 --- a/sample/src/main/java/jp/pokepay/pokepay/CreditCardActivity.java +++ b/sample/src/main/java/jp/pokepay/pokepay/CreditCardActivity.java @@ -26,6 +26,7 @@ public class CreditCardActivity extends AppCompatActivity { final String accountId = "7a226542-feb2-4614-9e87-907745ff5342"; final String accessToken = "55nF6HJRyGCHgvEQZP7Pd5K33ggX-C5ZH_q3eqqe5Cg1dGeV_G2-CZ0rmChJ1OcN"; final String tokenApiKey = "9ad14759-7082-457e-a874-864c78edc05a"; + final String cardholderName = "FOO BAR"; final int json = 1; final int html = 2; @@ -48,9 +49,9 @@ public class CreditCardActivity extends AppCompatActivity { return true; }); - private String fetchVeritransMdkToken(String cardNumber, String cardExpireDate, String securityCode, String tokenApiKey) { + private String fetchVeritransMdkToken(String cardNumber, String cardExpireDate, String securityCode, String tokenApiKey, String cardholderName) { try { - VeritransToken response = new GetVeritransToken(cardNumber, cardExpireDate, securityCode, tokenApiKey).send(); + VeritransToken response = new GetVeritransToken(cardNumber, cardExpireDate, securityCode, tokenApiKey, cardholderName).send(); return response.token; } catch (Exception e) { throw new RuntimeException(e); @@ -89,7 +90,8 @@ protected void onCreate(Bundle savedInstanceState) { final String cardNumber = "4111111111111111"; final String cardExpireDate = "12/23"; final String securityCode = "123"; - final String token = fetchVeritransMdkToken(cardNumber, cardExpireDate, securityCode, tokenApiKey); + final String cardholderName = "FOO BAR"; + final String token = fetchVeritransMdkToken(cardNumber, cardExpireDate, securityCode, tokenApiKey, cardholderName); final CreditCard response; try { @@ -110,7 +112,8 @@ protected void onCreate(Bundle savedInstanceState) { final String cardNumber = "4111111111111111"; final String cardExpireDate = "12/28"; final String securityCode = "123"; - final String token = fetchVeritransMdkToken(cardNumber, cardExpireDate, securityCode, tokenApiKey); + final String cardholderName = "FOO BAR"; + final String token = fetchVeritransMdkToken(cardNumber, cardExpireDate, securityCode, tokenApiKey, cardholderName); final int amount = 42; final String text;