-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from omise/add-fpx-source-type-for-v3
Add FPX to the list of source types for V3.x
- Loading branch information
Showing
9 changed files
with
138 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package co.omise.models; | ||
|
||
public class Bank { | ||
private String code; | ||
private String name; | ||
private boolean active; | ||
|
||
public String getCode() { | ||
return this.code; | ||
} | ||
|
||
public void setCode(String code) { | ||
this.code = code; | ||
} | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public boolean isActive() { | ||
return this.active; | ||
} | ||
|
||
public void setActive(boolean active) { | ||
this.active = active; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,4 +214,28 @@ public void testLiveSourceZeroInterestInstallments() throws IOException, OmiseEx | |
assertEquals("THB", source.getCurrency()); | ||
assertTrue(source.isZeroInterestInstallments()); | ||
} | ||
|
||
@Test | ||
@Ignore("only hit the network when we need to.") | ||
public void testLiveSourceFpx() throws IOException, OmiseException { | ||
Request<Source> request = new Source.CreateRequestBuilder() | ||
.type(SourceType.Fpx) | ||
.amount(10000) | ||
.currency("myr") | ||
.bank("cimb") | ||
.email("[email protected]") | ||
.build(); | ||
|
||
Source source = client.sendRequest(request); | ||
|
||
System.out.println("created source: " + source.getId()); | ||
|
||
assertNotNull(source.getId()); | ||
assertEquals("fpx", source.getType().toString()); | ||
assertEquals("redirect", source.getFlow().toString()); | ||
assertEquals(10000L, source.getAmount()); | ||
assertEquals("MYR", source.getCurrency()); | ||
assertEquals("cimb", source.getBank()); | ||
assertEquals("[email protected]", source.getEmail()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,8 @@ | |
8, | ||
9, | ||
10 | ||
] | ||
], | ||
"banks": [] | ||
} | ||
], | ||
"zero_interest_installments": false | ||
|