diff --git a/src/main/java/co/omise/Example.java b/src/main/java/co/omise/Example.java index db847970..5a4952ef 100644 --- a/src/main/java/co/omise/Example.java +++ b/src/main/java/co/omise/Example.java @@ -142,7 +142,7 @@ void chargeWithAuthentication(AuthenticationType authenticationType) logInfo( "created charge with %s authentication: %s and auth url: %s ", - authenticationType.getWireValue(), + charge.getAuthenticatedBy(), charge.getId(), charge.getAuthorizeUri()); } @@ -516,7 +516,7 @@ void listLinks() throws IOException, OmiseException, ClientException { void createSource() throws IOException, OmiseException, ClientException { Request request = new Source.CreateRequestBuilder() - .type(SourceType.InternetBankingBay) + .type(SourceType.MobileBankingKbank) .amount(100000) // 1,000 THB .currency("thb") .terminalId("test_term_id") diff --git a/src/main/java/co/omise/models/SourceType.java b/src/main/java/co/omise/models/SourceType.java index 087e60b3..0ef09349 100644 --- a/src/main/java/co/omise/models/SourceType.java +++ b/src/main/java/co/omise/models/SourceType.java @@ -37,14 +37,6 @@ public enum SourceType { InstallmentUob, @JsonProperty("installment_ttb") InstallmentTtb, - @JsonProperty("internet_banking_bay") - InternetBankingBay, - @JsonProperty("internet_banking_bbl") - InternetBankingBbl, - @JsonProperty("internet_banking_ktb") - InternetBankingKtb, - @JsonProperty("internet_banking_scb") - InternetBankingScb, @JsonProperty("mobile_banking_bay") MobileBankingBay, @JsonProperty("mobile_banking_bbl") diff --git a/src/test/java/co/omise/live/LiveChargeRequestTest.java b/src/test/java/co/omise/live/LiveChargeRequestTest.java index ab5c4d07..e3595a5d 100644 --- a/src/test/java/co/omise/live/LiveChargeRequestTest.java +++ b/src/test/java/co/omise/live/LiveChargeRequestTest.java @@ -84,36 +84,6 @@ public void testLiveCreateCharge() throws IOException, OmiseException { assertEquals(token.getCard().getLastDigits(), charge.getCard().getLastDigits()); } - @Test - @Ignore("only hit the network when we need to.") - public void testLiveChargeWithInternetBanking() throws IOException, OmiseException { - Request sourceRequest = new Source.CreateRequestBuilder() - .type(SourceType.InternetBankingBay) - .amount(10000) - .currency("thb") - .build(); - - Source source = client.sendRequest(sourceRequest); - - Request createChargeRequest = - new Charge.CreateRequestBuilder() - .source(source.getId()) - .amount(10000) - .currency("thb") - .returnUri("http://example.com/orders/345678/complete") - .build(); - - Charge charge = client.sendRequest(createChargeRequest); - - System.out.println("created charge: " + charge.getId()); - - assertNotNull(charge.getId()); - assertEquals(10000, charge.getAmount()); - assertEquals("THB", charge.getCurrency()); - assertEquals(SourceType.InternetBankingBay, charge.getSource().getType()); - assertEquals(FlowType.Redirect, charge.getSource().getFlow()); - } - @Test @Ignore("only hit the network when we need to.") public void testLiveChargeWithBillPaymentTescoLotus() throws IOException, OmiseException { diff --git a/src/test/java/co/omise/live/LiveSourceRequestTest.java b/src/test/java/co/omise/live/LiveSourceRequestTest.java index 2596da7c..26f3e041 100644 --- a/src/test/java/co/omise/live/LiveSourceRequestTest.java +++ b/src/test/java/co/omise/live/LiveSourceRequestTest.java @@ -22,86 +22,6 @@ public void setup() throws Exception { client = getLiveClient(); } - @Test - @Ignore("only hit the network when we need to.") - public void testLiveSourceInternetBankingBay() throws IOException, OmiseException { - Request request = new Source.CreateRequestBuilder() - .type(SourceType.InternetBankingBay) - .amount(10000) - .currency("thb") - .build(); - - Source source = client.sendRequest(request); - - System.out.println("created source: " + source.getId()); - - assertNotNull(source.getId()); - assertEquals("internet_banking_bay", source.getType().toString()); - assertEquals("redirect", source.getFlow().toString()); - assertEquals(10000L, source.getAmount()); - assertEquals("THB", source.getCurrency()); - } - - @Test - @Ignore("only hit the network when we need to.") - public void testLiveSourceInternetBankingKtb() throws IOException, OmiseException { - Request request = new Source.CreateRequestBuilder() - .type(SourceType.InternetBankingKtb) - .amount(10000) - .currency("thb") - .build(); - - Source source = client.sendRequest(request); - - System.out.println("created source: " + source.getId()); - - assertNotNull(source.getId()); - assertEquals("internet_banking_ktb", source.getType().toString()); - assertEquals("redirect", source.getFlow().toString()); - assertEquals(10000L, source.getAmount()); - assertEquals("THB", source.getCurrency()); - } - - @Test - @Ignore("only hit the network when we need to.") - public void testLiveSourceInternetBankingScb() throws IOException, OmiseException { - Request request = new Source.CreateRequestBuilder() - .type(SourceType.InternetBankingScb) - .amount(10000) - .currency("thb") - .build(); - - Source source = client.sendRequest(request); - - System.out.println("created source: " + source.getId()); - - assertNotNull(source.getId()); - assertEquals("internet_banking_scb", source.getType().toString()); - assertEquals("redirect", source.getFlow().toString()); - assertEquals(10000L, source.getAmount()); - assertEquals("THB", source.getCurrency()); - } - - @Test - @Ignore("only hit the network when we need to.") - public void testLiveSourceInternetBankingBbl() throws IOException, OmiseException { - Request request = new Source.CreateRequestBuilder() - .type(SourceType.InternetBankingBbl) - .amount(10000) - .currency("thb") - .build(); - - Source source = client.sendRequest(request); - - System.out.println("created source: " + source.getId()); - - assertNotNull(source.getId()); - assertEquals("internet_banking_bbl", source.getType().toString()); - assertEquals("redirect", source.getFlow().toString()); - assertEquals(10000L, source.getAmount()); - assertEquals("THB", source.getCurrency()); - } - @Test @Ignore("only hit the network when we need to.") public void testLiveSourceBillPayment() throws IOException, OmiseException { diff --git a/src/test/java/co/omise/models/SourceTypeTest.java b/src/test/java/co/omise/models/SourceTypeTest.java index bcf4b3b6..fd324b20 100644 --- a/src/test/java/co/omise/models/SourceTypeTest.java +++ b/src/test/java/co/omise/models/SourceTypeTest.java @@ -8,10 +8,6 @@ public class SourceTypeTest { @Test public void checkStringValue() { - assertEquals("internet_banking_bay", SourceType.InternetBankingBay.toString()); - assertEquals("internet_banking_ktb", SourceType.InternetBankingKtb.toString()); - assertEquals("internet_banking_bbl", SourceType.InternetBankingBbl.toString()); - assertEquals("internet_banking_scb", SourceType.InternetBankingScb.toString()); assertEquals("installment_uob", SourceType.InstallmentUob.toString()); assertEquals("installment_ttb", SourceType.InstallmentTtb.toString()); assertEquals("mobile_banking_bay", SourceType.MobileBankingBay.toString()); diff --git a/src/test/java/co/omise/requests/ChargeRequestTest.java b/src/test/java/co/omise/requests/ChargeRequestTest.java index 19575faa..6244a392 100644 --- a/src/test/java/co/omise/requests/ChargeRequestTest.java +++ b/src/test/java/co/omise/requests/ChargeRequestTest.java @@ -110,7 +110,7 @@ public void testCreateChargeFromSource() throws IOException, OmiseException { assertEquals(CHARGE_ID, charge.getId()); assertEquals("src_test_5929c3tjts3omoi7ti2", charge.getSource().getId()); - assertEquals(SourceType.InternetBankingScb, charge.getSource().getType()); + assertEquals(SourceType.MobileBankingScb, charge.getSource().getType()); assertEquals(Barcode.class, charge.getSource().getScannableCode().getClass()); assertEquals(100000L, charge.getAmount()); } diff --git a/src/test/resources/testdata/fixtures/api.omise.co/charges-post.json b/src/test/resources/testdata/fixtures/api.omise.co/charges-post.json index 8fdf2df8..de7bf815 100644 --- a/src/test/resources/testdata/fixtures/api.omise.co/charges-post.json +++ b/src/test/resources/testdata/fixtures/api.omise.co/charges-post.json @@ -75,8 +75,8 @@ "created_at": "2020-03-30T05:01:03Z" } }, - "type": "internet_banking_scb", - "flow": "redirect", + "type": "mobile_banking_scb", + "flow": "app_redirect", "amount": 100000, "currency": "thb" } diff --git a/src/test/resources/testdata/objects/source_object.json b/src/test/resources/testdata/objects/source_object.json index 5cdf730a..fa21498f 100644 --- a/src/test/resources/testdata/objects/source_object.json +++ b/src/test/resources/testdata/objects/source_object.json @@ -1,8 +1,8 @@ { "object": "source", "id": "src_test_5929c3tjts3omoi7ti2", - "type": "internet_banking_scb", - "flow": "redirect", + "type": "mobile_banking_scb", + "flow": "app_redirect", "amount": 100000, "currency": "thb" -} \ No newline at end of file +}