-
Notifications
You must be signed in to change notification settings - Fork 4
Add merchant purchase, merchant session, merchant card and merchant installment #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jonasborges-stark
wants to merge
1
commit into
master
Choose a base branch
from
feature/merchant-purchase
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,171 @@ | ||
| 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; | ||
|
|
||
jonasborges-stark marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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 card; | ||
|
|
||
| public Log(String created, String type, String[] errors, MerchantCard card, String id) { | ||
| super(id); | ||
| this.created = created; | ||
| this.type = type; | ||
| this.errors = errors; | ||
| this.card = card; | ||
| } | ||
|
|
||
|
|
||
| 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.