-
Notifications
You must be signed in to change notification settings - Fork 22
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 #89 from uphold/support/merchant-destination-trans…
…action-model Add merchant model to transaction destination
- Loading branch information
Showing
6 changed files
with
137 additions
and
3 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 |
---|---|---|
|
@@ -102,6 +102,13 @@ public void createTransactionShouldReturnTheTransaction() throws Exception { | |
"\"currency\": \"BTC\"," + | ||
"\"description\": \"[email protected]\"," + | ||
"\"fee\": \"0.00\"," + | ||
"\"merchant\": {" + | ||
"\"city\": \"foo\"," + | ||
"\"country\": \"bar\"," + | ||
"\"name\": \"foobar\"," + | ||
"\"state\": \"fizbiz\"," + | ||
"\"zipCode\": \"fizbuz\"" + | ||
"}," + | ||
"\"rate\": \"1.00\"," + | ||
"\"type\": \"email\"" + | ||
"}," + | ||
|
@@ -185,6 +192,11 @@ public Promise<Transaction> call(UpholdRestAdapter adapter) { | |
Assert.assertEquals(transaction.getDestination().getCurrency(), "BTC"); | ||
Assert.assertEquals(transaction.getDestination().getDescription(), "[email protected]"); | ||
Assert.assertEquals(transaction.getDestination().getFee(), "0.00"); | ||
Assert.assertEquals(transaction.getDestination().getMerchant().getCity(), "foo"); | ||
Assert.assertEquals(transaction.getDestination().getMerchant().getCountry(), "bar"); | ||
Assert.assertEquals(transaction.getDestination().getMerchant().getName(), "foobar"); | ||
Assert.assertEquals(transaction.getDestination().getMerchant().getState(), "fizbiz"); | ||
Assert.assertEquals(transaction.getDestination().getMerchant().getZipCode(), "fizbuz"); | ||
Assert.assertEquals(transaction.getDestination().getRate(), "1.00"); | ||
Assert.assertEquals(transaction.getDestination().getType(), "email"); | ||
Assert.assertEquals(transaction.getParams().getCurrency(), "BTC"); | ||
|
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
85 changes: 85 additions & 0 deletions
85
src/app/src/main/java/com/uphold/uphold_android_sdk/model/transaction/Merchant.java
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,85 @@ | ||
package com.uphold.uphold_android_sdk.model.transaction; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Merchant model. | ||
*/ | ||
|
||
public class Merchant implements Serializable { | ||
|
||
private final String city; | ||
private final String country; | ||
private final String name; | ||
private final String state; | ||
private final String zipCode; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param city The city of the merchant. | ||
* @param country The country of the merchant. | ||
* @param name The name of the merchant. | ||
* @param state The state of the merchant. | ||
* @param zipCode The zip code of the merchant. | ||
*/ | ||
|
||
public Merchant(String city, String country, String name, String state, String zipCode) { | ||
this.city = city; | ||
this.country = country; | ||
this.name = name; | ||
this.state = state; | ||
this.zipCode = zipCode; | ||
} | ||
|
||
/** | ||
* Gets the city of the merchant. | ||
* | ||
* @return the city of the merchant. | ||
*/ | ||
|
||
public String getCity() { | ||
return city; | ||
} | ||
|
||
/** | ||
* Gets the country of the merchant. | ||
* | ||
* @return the country of the merchant. | ||
*/ | ||
|
||
public String getCountry() { | ||
return country; | ||
} | ||
|
||
/** | ||
* Gets the name of the merchant. | ||
* | ||
* @return the name of the merchant. | ||
*/ | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
/** | ||
* Gets the state of the merchant. | ||
* | ||
* @return the state of the merchant. | ||
*/ | ||
|
||
public String getState() { | ||
return state; | ||
} | ||
|
||
/** | ||
* Gets the zip code of the merchant. | ||
* | ||
* @return the zip code of the merchant. | ||
*/ | ||
|
||
public String getZipCode() { | ||
return zipCode; | ||
} | ||
|
||
} |
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