-
Notifications
You must be signed in to change notification settings - Fork 9
HW-51227: Core Paypal Account #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
66ba8f8
HW-51227: PayPalAccount
vshcherbyna-epam bad9f75
HW-51226. PayPalAccount update (#1)
azakrevska-epam 296bb3b
HW-51227. PayPal Account Creation (#2)
azakrevska-epam 6733ab0
HW-51321: Get paypal account (#3)
vshcherbyna-epam 22e89d1
Adding required properties to pom file
fmattos-hw c31df58
Version update and exempt maven local publish task from signing
fmattos-hw eddeb7f
add PayPal get test to Hyperwallet test suite
fmattos-hw f2beb6d
HW-51228. PayPal Account Deactivation (#4)
azakrevska-epam 082b87e
Feature/hw 51228 deactivate pay pal account (#16)
fmattos-hw e6e0f1b
HW-51229: List PayPal accounts (#5)
vshcherbyna-epam 0b21b83
add getters, fix tests
vshcherbyna-epam e10fd64
Minor edits
skoong 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
187 changes: 168 additions & 19 deletions
187
core/src/main/java/com/hyperwallet/android/Hyperwallet.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
70 changes: 70 additions & 0 deletions
70
core/src/main/java/com/hyperwallet/android/model/HyperwalletPayPalAccountPagination.java
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,70 @@ | ||
| /* | ||
| * Copyright 2018 Hyperwallet | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
| * documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | ||
| * to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
| * the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
| * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| */ | ||
| package com.hyperwallet.android.model; | ||
|
|
||
| import static com.hyperwallet.android.model.HyperwalletTransferMethod.TransferMethodTypes.PAYPAL_ACCOUNT; | ||
|
|
||
| import androidx.annotation.NonNull; | ||
|
|
||
| import com.hyperwallet.android.util.DateUtil; | ||
|
|
||
| import java.util.Date; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Represents the PayPal Account pagination fields | ||
| */ | ||
| public class HyperwalletPayPalAccountPagination extends HyperwalletTransferMethodPagination { | ||
|
|
||
| protected static final String TRANSFER_METHOD_CREATE_ON = "createdOn"; | ||
|
|
||
| private Date mCreatedOn; | ||
|
|
||
| /** | ||
| * Constructs the default implementation of the PayPal Account pagination. | ||
| */ | ||
| public HyperwalletPayPalAccountPagination() { | ||
| super(); | ||
| setType(PAYPAL_ACCOUNT); | ||
| } | ||
|
|
||
| /** | ||
| * Constructs the PayPal Account pagination based in the preview request with extra parameters. | ||
| * | ||
| * @param urlQueryMap the map with properties to build the pagination | ||
| */ | ||
| public HyperwalletPayPalAccountPagination(Map<String, String> urlQueryMap) { | ||
| super(urlQueryMap); | ||
| mCreatedOn = getDateValueBy(urlQueryMap, TRANSFER_METHOD_CREATE_ON); | ||
| setType(PAYPAL_ACCOUNT); | ||
| } | ||
|
|
||
| public Date getCreatedOn() { | ||
| return mCreatedOn; | ||
| } | ||
|
|
||
| @NonNull | ||
| @Override | ||
| public Map<String, String> buildQuery() { | ||
| Map<String, String> query = super.buildQuery(); | ||
| if (mCreatedOn != null) { | ||
| query.put(TRANSFER_METHOD_CREATE_ON, DateUtil.toDateTimeFormat(mCreatedOn)); | ||
| } | ||
| return query; | ||
| } | ||
| } |
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
110 changes: 110 additions & 0 deletions
110
core/src/main/java/com/hyperwallet/android/model/PayPalAccount.java
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,110 @@ | ||
| /* | ||
| * Copyright 2018 Hyperwallet | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
| * documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | ||
| * to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
| * the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
| * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| */ | ||
|
|
||
| package com.hyperwallet.android.model; | ||
|
|
||
| import static com.hyperwallet.android.model.HyperwalletTransferMethod.TransferMethodFields.EMAIL; | ||
| import static com.hyperwallet.android.model.HyperwalletTransferMethod.TransferMethodFields.TRANSFER_METHOD_COUNTRY; | ||
| import static com.hyperwallet.android.model.HyperwalletTransferMethod.TransferMethodFields.TRANSFER_METHOD_CURRENCY; | ||
|
|
||
| import androidx.annotation.NonNull; | ||
| import androidx.annotation.Nullable; | ||
|
|
||
| import org.json.JSONException; | ||
| import org.json.JSONObject; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Represents the PayPal Account fields. | ||
| */ | ||
|
|
||
| public class PayPalAccount extends HyperwalletTransferMethod { | ||
|
|
||
| /** | ||
| * Constructor to build PayPal Account, based on json object | ||
| */ | ||
| public PayPalAccount(@NonNull JSONObject jsonObject) throws JSONException { | ||
| super(jsonObject); | ||
| } | ||
|
|
||
| private PayPalAccount(@NonNull Map<String, Object> fields) { | ||
| super(); | ||
| setFields(fields); | ||
| } | ||
|
|
||
| @Nullable | ||
| public String getCountry() { | ||
| return getField(TRANSFER_METHOD_COUNTRY); | ||
| } | ||
|
|
||
| @Nullable | ||
| public String getCurrency() { | ||
| return getField(TRANSFER_METHOD_CURRENCY); | ||
| } | ||
|
|
||
| @Nullable | ||
| public String getEmail() { | ||
| return getField(EMAIL); | ||
| } | ||
|
|
||
| public static class Builder { | ||
| private Map<String, Object> mFields; | ||
|
|
||
| public Builder() { | ||
| mFields = new HashMap<>(); | ||
| mFields.put(TransferMethodFields.TYPE, TransferMethodTypes.PAYPAL_ACCOUNT); | ||
| } | ||
|
|
||
| public Builder(@NonNull String transferMethodCountry, | ||
| @NonNull String transferMethodCurrency, | ||
| @NonNull String email) { | ||
|
|
||
| mFields = new HashMap<>(); | ||
| mFields.put(TransferMethodFields.TYPE, TransferMethodTypes.PAYPAL_ACCOUNT); | ||
| mFields.put(TRANSFER_METHOD_CURRENCY, transferMethodCurrency); | ||
| mFields.put(TRANSFER_METHOD_COUNTRY, transferMethodCountry); | ||
| mFields.put(TransferMethodFields.EMAIL, email); | ||
| } | ||
|
|
||
| public Builder email(String email) { | ||
| mFields.put(TransferMethodFields.EMAIL, email); | ||
| return this; | ||
| } | ||
|
|
||
| public Builder token(@NonNull String token) { | ||
| mFields.put(TransferMethodFields.TOKEN, token); | ||
| return this; | ||
| } | ||
|
|
||
| public Builder transferMethodCountry(@NonNull String transferMethodCountry) { | ||
| mFields.put(TRANSFER_METHOD_COUNTRY, transferMethodCountry); | ||
| return this; | ||
| } | ||
|
|
||
| public Builder transferMethodCurrency(@NonNull String transferMethodCurrency) { | ||
| mFields.put(TRANSFER_METHOD_CURRENCY, transferMethodCurrency); | ||
| return this; | ||
| } | ||
|
|
||
| public PayPalAccount build() { | ||
| return new PayPalAccount(mFields); | ||
| } | ||
| } | ||
vshcherbyna-epam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
46 changes: 46 additions & 0 deletions
46
core/src/main/java/com/hyperwallet/android/model/PayPalAccountPagination.java
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,46 @@ | ||
| /* | ||
| * Copyright 2018 Hyperwallet | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
| * documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | ||
| * to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in all copies or substantial portions of | ||
| * the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
| * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| */ | ||
| package com.hyperwallet.android.model; | ||
|
|
||
| import static com.hyperwallet.android.model.HyperwalletTransferMethod.TransferMethodTypes.PAYPAL_ACCOUNT; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Represents the PayPal Account pagination fields | ||
| */ | ||
| public class PayPalAccountPagination extends HyperwalletTransferMethodPagination { | ||
|
|
||
| /** | ||
| * Constructs the default implementation of the PayPal Account pagination. | ||
| */ | ||
| public PayPalAccountPagination() { | ||
| super(); | ||
| setType(PAYPAL_ACCOUNT); | ||
| } | ||
|
|
||
| /** | ||
| * Constructs the PayPal Account pagination based in the preview request with extra parameters. | ||
| * | ||
| * @param urlQueryMap the map with properties to build the pagination | ||
| */ | ||
| public PayPalAccountPagination(Map<String, String> urlQueryMap) { | ||
| super(urlQueryMap); | ||
| setType(PAYPAL_ACCOUNT); | ||
| } | ||
| } |
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.