-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add merchant purchase, merchant session, merchant card and merchant i…
…nstallment
- Loading branch information
1 parent
85c4356
commit e5ea358
Showing
13 changed files
with
1,622 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,170 @@ | ||
package com.starkbank; | ||
|
||
import com.starkbank.utils.Generator; | ||
import com.starkbank.utils.Resource; | ||
import com.starkbank.utils.Rest; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class MerchantCard extends Resource { | ||
|
||
/** | ||
# MerchantCard object | ||
Check out our API Documentation at https://starkbank.com/docs/api#merchant-card | ||
**/ | ||
|
||
static ClassData data = new ClassData(MerchantCard.class, "MerchantCard"); | ||
|
||
public String ending; | ||
public String fundingType; | ||
public String holderName; | ||
public String network; | ||
public String status; | ||
public List<String> tags; | ||
public String expiration; | ||
public String created; | ||
public String updated; | ||
|
||
public MerchantCard(String id, String ending, String fundingType, String holderName, String network, String status, List<String> tags, String expiration, String created, String updated) { | ||
super(id); | ||
this.ending = ending; | ||
this.fundingType = fundingType; | ||
this.holderName = holderName; | ||
this.network = network; | ||
this.status = status; | ||
this.tags = tags; | ||
this.expiration = expiration; | ||
this.created = created; | ||
this.updated = updated; | ||
} | ||
|
||
public static Generator<MerchantCard> query(Map<String, Object> params, User user) throws Exception { | ||
return Rest.getStream(data, params, user); | ||
} | ||
|
||
public static Generator<MerchantCard> query(Map<String, Object> params) throws Exception { | ||
return MerchantCard.query(params, null); | ||
} | ||
|
||
public static Generator<MerchantCard> query() throws Exception { | ||
return Rest.getStream(data, new HashMap<>(), null); | ||
} | ||
|
||
public static MerchantCard get(String id, User user) throws Exception { | ||
return Rest.getId(data, id, user); | ||
} | ||
|
||
public static MerchantCard get(String id) throws Exception { | ||
return MerchantCard.get(id, null); | ||
} | ||
|
||
public static MerchantCard.Page page(Map<String, Object> params) throws Exception { | ||
return page(params, null); | ||
} | ||
|
||
public static MerchantCard.Page page(User user) throws Exception { | ||
return page(new HashMap<>(), user); | ||
} | ||
|
||
public static MerchantCard.Page page() throws Exception { | ||
return page(new HashMap<>(), null); | ||
} | ||
|
||
|
||
public static MerchantCard.Page page(Map<String, Object> params, User user) throws Exception { | ||
com.starkcore.utils.Page page = Rest.getPage(data, params, user); | ||
List<MerchantCard> MerchantCards = new ArrayList<>(); | ||
for (com.starkcore.utils.SubResource MerchantCard: page.entities) { | ||
MerchantCards.add((MerchantCard) MerchantCard); | ||
} | ||
return new MerchantCard.Page(MerchantCards, page.cursor); | ||
} | ||
|
||
public final static class Page { | ||
public List<MerchantCard> merchantCards; | ||
public String cursor; | ||
|
||
public Page(List<MerchantCard> merchantCards, String cursor) { | ||
this.merchantCards = merchantCards; | ||
this.cursor = cursor; | ||
} | ||
} | ||
|
||
public final static class Log extends Resource { | ||
static ClassData data = new ClassData(MerchantCard.Log.class, "MerchantCardLog"); | ||
|
||
public String created; | ||
public String type; | ||
public String[] errors; | ||
public MerchantCard merchantCard; | ||
|
||
public Log(String created, String type, String[] errors, MerchantCard merchantCard, String id) { | ||
super(id); | ||
this.created = created; | ||
this.type = type; | ||
this.errors = errors; | ||
this.merchantCard = merchantCard; | ||
} | ||
|
||
|
||
public static MerchantCard.Log get(String id) throws Exception { | ||
return MerchantCard.Log.get(id, null); | ||
} | ||
|
||
public static MerchantCard.Log get(String id, User user) throws Exception { | ||
return Rest.getId(data, id, user); | ||
} | ||
|
||
public static Generator<MerchantCard.Log> query(Map<String, Object> params) throws Exception { | ||
return MerchantCard.Log.query(params, null); | ||
} | ||
|
||
public static Generator<MerchantCard.Log> query(User user) throws Exception { | ||
return MerchantCard.Log.query(new HashMap<>(), user); | ||
} | ||
|
||
public static Generator<MerchantCard.Log> query() throws Exception { | ||
return MerchantCard.Log.query(new HashMap<>(), null); | ||
} | ||
|
||
public static Generator<MerchantCard.Log> query(Map<String, Object> params, User user) throws Exception { | ||
return Rest.getStream(data, params, user); | ||
} | ||
|
||
public final static class Page { | ||
public List<MerchantCard.Log> logs; | ||
public String cursor; | ||
|
||
public Page(List<MerchantCard.Log> logs, String cursor) { | ||
this.logs = logs; | ||
this.cursor = cursor; | ||
} | ||
} | ||
|
||
public static MerchantCard.Log.Page page(Map<String, Object> params) throws Exception { | ||
return MerchantCard.Log.page(params, null); | ||
} | ||
|
||
public static MerchantCard.Log.Page page(User user) throws Exception { | ||
return MerchantCard.Log.page(new HashMap<>(), user); | ||
} | ||
|
||
public static MerchantCard.Log.Page page() throws Exception { | ||
return MerchantCard.Log.page(new HashMap<>(), null); | ||
} | ||
|
||
public static MerchantCard.Log.Page page(Map<String, Object> params, User user) throws Exception { | ||
com.starkcore.utils.Page page = Rest.getPage(data, params, user); | ||
List<MerchantCard.Log> logs = new ArrayList<>(); | ||
for (com.starkcore.utils.SubResource log: page.entities) { | ||
logs.add((MerchantCard.Log) log); | ||
} | ||
return new MerchantCard.Log.Page(logs, page.cursor); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.