Skip to content

Commit 73f9337

Browse files
authored
sunset internet banking (#191)
* sunset internet banking REMOVED source types: - `internet_banking_bay` - `internet_banking_bbl` - `internet_banking_ktb` - `internet_banking_scb` * update unit test
1 parent 03222d9 commit 73f9337

8 files changed

Lines changed: 8 additions & 130 deletions

File tree

src/main/java/co/omise/Example.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void chargeWithAuthentication(AuthenticationType authenticationType)
142142

143143
logInfo(
144144
"created charge with %s authentication: %s and auth url: %s ",
145-
authenticationType.getWireValue(),
145+
charge.getAuthenticatedBy(),
146146
charge.getId(),
147147
charge.getAuthorizeUri());
148148
}
@@ -516,7 +516,7 @@ void listLinks() throws IOException, OmiseException, ClientException {
516516

517517
void createSource() throws IOException, OmiseException, ClientException {
518518
Request<Source> request = new Source.CreateRequestBuilder()
519-
.type(SourceType.InternetBankingBay)
519+
.type(SourceType.MobileBankingKbank)
520520
.amount(100000) // 1,000 THB
521521
.currency("thb")
522522
.terminalId("test_term_id")

src/main/java/co/omise/models/SourceType.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ public enum SourceType {
3737
InstallmentUob,
3838
@JsonProperty("installment_ttb")
3939
InstallmentTtb,
40-
@JsonProperty("internet_banking_bay")
41-
InternetBankingBay,
42-
@JsonProperty("internet_banking_bbl")
43-
InternetBankingBbl,
44-
@JsonProperty("internet_banking_ktb")
45-
InternetBankingKtb,
46-
@JsonProperty("internet_banking_scb")
47-
InternetBankingScb,
4840
@JsonProperty("mobile_banking_bay")
4941
MobileBankingBay,
5042
@JsonProperty("mobile_banking_bbl")

src/test/java/co/omise/live/LiveChargeRequestTest.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -84,36 +84,6 @@ public void testLiveCreateCharge() throws IOException, OmiseException {
8484
assertEquals(token.getCard().getLastDigits(), charge.getCard().getLastDigits());
8585
}
8686

87-
@Test
88-
@Ignore("only hit the network when we need to.")
89-
public void testLiveChargeWithInternetBanking() throws IOException, OmiseException {
90-
Request<Source> sourceRequest = new Source.CreateRequestBuilder()
91-
.type(SourceType.InternetBankingBay)
92-
.amount(10000)
93-
.currency("thb")
94-
.build();
95-
96-
Source source = client.sendRequest(sourceRequest);
97-
98-
Request<Charge> createChargeRequest =
99-
new Charge.CreateRequestBuilder()
100-
.source(source.getId())
101-
.amount(10000)
102-
.currency("thb")
103-
.returnUri("http://example.com/orders/345678/complete")
104-
.build();
105-
106-
Charge charge = client.sendRequest(createChargeRequest);
107-
108-
System.out.println("created charge: " + charge.getId());
109-
110-
assertNotNull(charge.getId());
111-
assertEquals(10000, charge.getAmount());
112-
assertEquals("THB", charge.getCurrency());
113-
assertEquals(SourceType.InternetBankingBay, charge.getSource().getType());
114-
assertEquals(FlowType.Redirect, charge.getSource().getFlow());
115-
}
116-
11787
@Test
11888
@Ignore("only hit the network when we need to.")
11989
public void testLiveChargeWithBillPaymentTescoLotus() throws IOException, OmiseException {

src/test/java/co/omise/live/LiveSourceRequestTest.java

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -22,86 +22,6 @@ public void setup() throws Exception {
2222
client = getLiveClient();
2323
}
2424

25-
@Test
26-
@Ignore("only hit the network when we need to.")
27-
public void testLiveSourceInternetBankingBay() throws IOException, OmiseException {
28-
Request<Source> request = new Source.CreateRequestBuilder()
29-
.type(SourceType.InternetBankingBay)
30-
.amount(10000)
31-
.currency("thb")
32-
.build();
33-
34-
Source source = client.sendRequest(request);
35-
36-
System.out.println("created source: " + source.getId());
37-
38-
assertNotNull(source.getId());
39-
assertEquals("internet_banking_bay", source.getType().toString());
40-
assertEquals("redirect", source.getFlow().toString());
41-
assertEquals(10000L, source.getAmount());
42-
assertEquals("THB", source.getCurrency());
43-
}
44-
45-
@Test
46-
@Ignore("only hit the network when we need to.")
47-
public void testLiveSourceInternetBankingKtb() throws IOException, OmiseException {
48-
Request<Source> request = new Source.CreateRequestBuilder()
49-
.type(SourceType.InternetBankingKtb)
50-
.amount(10000)
51-
.currency("thb")
52-
.build();
53-
54-
Source source = client.sendRequest(request);
55-
56-
System.out.println("created source: " + source.getId());
57-
58-
assertNotNull(source.getId());
59-
assertEquals("internet_banking_ktb", source.getType().toString());
60-
assertEquals("redirect", source.getFlow().toString());
61-
assertEquals(10000L, source.getAmount());
62-
assertEquals("THB", source.getCurrency());
63-
}
64-
65-
@Test
66-
@Ignore("only hit the network when we need to.")
67-
public void testLiveSourceInternetBankingScb() throws IOException, OmiseException {
68-
Request<Source> request = new Source.CreateRequestBuilder()
69-
.type(SourceType.InternetBankingScb)
70-
.amount(10000)
71-
.currency("thb")
72-
.build();
73-
74-
Source source = client.sendRequest(request);
75-
76-
System.out.println("created source: " + source.getId());
77-
78-
assertNotNull(source.getId());
79-
assertEquals("internet_banking_scb", source.getType().toString());
80-
assertEquals("redirect", source.getFlow().toString());
81-
assertEquals(10000L, source.getAmount());
82-
assertEquals("THB", source.getCurrency());
83-
}
84-
85-
@Test
86-
@Ignore("only hit the network when we need to.")
87-
public void testLiveSourceInternetBankingBbl() throws IOException, OmiseException {
88-
Request<Source> request = new Source.CreateRequestBuilder()
89-
.type(SourceType.InternetBankingBbl)
90-
.amount(10000)
91-
.currency("thb")
92-
.build();
93-
94-
Source source = client.sendRequest(request);
95-
96-
System.out.println("created source: " + source.getId());
97-
98-
assertNotNull(source.getId());
99-
assertEquals("internet_banking_bbl", source.getType().toString());
100-
assertEquals("redirect", source.getFlow().toString());
101-
assertEquals(10000L, source.getAmount());
102-
assertEquals("THB", source.getCurrency());
103-
}
104-
10525
@Test
10626
@Ignore("only hit the network when we need to.")
10727
public void testLiveSourceBillPayment() throws IOException, OmiseException {

src/test/java/co/omise/models/SourceTypeTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ public class SourceTypeTest {
88

99
@Test
1010
public void checkStringValue() {
11-
assertEquals("internet_banking_bay", SourceType.InternetBankingBay.toString());
12-
assertEquals("internet_banking_ktb", SourceType.InternetBankingKtb.toString());
13-
assertEquals("internet_banking_bbl", SourceType.InternetBankingBbl.toString());
14-
assertEquals("internet_banking_scb", SourceType.InternetBankingScb.toString());
1511
assertEquals("installment_uob", SourceType.InstallmentUob.toString());
1612
assertEquals("installment_ttb", SourceType.InstallmentTtb.toString());
1713
assertEquals("mobile_banking_bay", SourceType.MobileBankingBay.toString());

src/test/java/co/omise/requests/ChargeRequestTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void testCreateChargeFromSource() throws IOException, OmiseException {
110110

111111
assertEquals(CHARGE_ID, charge.getId());
112112
assertEquals("src_test_5929c3tjts3omoi7ti2", charge.getSource().getId());
113-
assertEquals(SourceType.InternetBankingScb, charge.getSource().getType());
113+
assertEquals(SourceType.MobileBankingScb, charge.getSource().getType());
114114
assertEquals(Barcode.class, charge.getSource().getScannableCode().getClass());
115115
assertEquals(100000L, charge.getAmount());
116116
}

src/test/resources/testdata/fixtures/api.omise.co/charges-post.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
"created_at": "2020-03-30T05:01:03Z"
7676
}
7777
},
78-
"type": "internet_banking_scb",
79-
"flow": "redirect",
78+
"type": "mobile_banking_scb",
79+
"flow": "app_redirect",
8080
"amount": 100000,
8181
"currency": "thb"
8282
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"object": "source",
33
"id": "src_test_5929c3tjts3omoi7ti2",
4-
"type": "internet_banking_scb",
5-
"flow": "redirect",
4+
"type": "mobile_banking_scb",
5+
"flow": "app_redirect",
66
"amount": 100000,
77
"currency": "thb"
8-
}
8+
}

0 commit comments

Comments
 (0)