-
Notifications
You must be signed in to change notification settings - Fork 18
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
PWN-8895, PWN-8776 - striga. payment api #1878
PWN-8895, PWN-8776 - striga. payment api #1878
Conversation
…ture/PWN-8895-striga-payment-api
import org.p2p.wallet.striga.kyc.StrigaKycModule | ||
|
||
object StrigaModule : InjectionModule { | ||
|
||
override fun create() = module { | ||
includes( | ||
StrigaSignupModule.create(), | ||
StrigaKycModule.create() | ||
StrigaKycModule.create(), | ||
StrigaWalletModule.create() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
such a good name, man! thanks
...src/main/java/org/p2p/wallet/striga/wallet/api/request/StrigaAddWhitelistedAddressRequest.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/p2p/wallet/striga/wallet/api/response/StrigaEnrichFiatAccountResponse.kt
Outdated
Show resolved
Hide resolved
val feeEstimate: FeeEstimate, | ||
) { | ||
|
||
class Transaction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TransactionRequest
StrigaTransactionRequest
just Transaction can be too ambiguous imho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it to TransactionResponse, because it's hard to get confused as it's a subclass. You can't just use the type TransactionResponse, you need to first specify the parent class as StrigaInitOnchainWithdrawalResponse.TransactionResponse
suspend fun getFiatAccountDetails( | ||
accountId: StrigaAccountId, | ||
): StrigaDataLayerResult<StrigaFiatAccountDetails> { | ||
return repository.getFiatAccountDetails(userIdProvider.getUserIdOrThrow(), accountId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can insert StrigaUserIdProvider inside the repo and catch error there so there are no unexpected throws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialy I had made this way, but changed my mind and moved userIdProvider to interactor. I can move it back.
app/src/main/java/org/p2p/wallet/striga/wallet/models/StrigaWhitelistedAddressItem.kt
Show resolved
Hide resolved
import kotlinx.parcelize.Parcelize | ||
|
||
/** | ||
* @param value The ID of an account. Format example: 01c1f4e73d8b2587921c74e98951add0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a Hex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a sort of UUID but without hyphens
app/src/main/java/org/p2p/wallet/striga/wallet/repository/StrigaWalletRemoteRepository.kt
Outdated
Show resolved
Hide resolved
* Error codes that might be returned by striga: | ||
* [org.p2p.wallet.striga.model.StrigaApiErrorCode.USER_LIMIT_EXCEEDED] - amount is too big | ||
* [org.p2p.wallet.striga.model.StrigaApiErrorCode.BELOW_MINIMUM_AMOUNT] - amount is too small | ||
* [org.p2p.wallet.striga.model.StrigaApiErrorCode.INVALID_DESTINATION] - addressId is invalid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather rename error codes instead of supporting this doc
USER_LIMIT_EXCEEDED -> TOO_LARGE_AMOUNT
BELOW_MINIMUM_AMOUNT -> TOO_MIN_AMOUNT
INVALID_DESTINATION -> INVALID_ADDRESS_ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First 2 - ok, but third might be ambigous, 'cause striga already has code 41006 Invalid address
and I don't know in what cases we could get it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, i've renamed this way:
TOO_LARGE_AMOUNT
TOO_SMALL_AMOUNT
INVALID_DESTINATION_ADDRESS (kept "destination" to avoid confusion)
|
||
assertTrue(result is StrigaDataLayerResult.Success) | ||
result as StrigaDataLayerResult.Success<StrigaFiatAccountDetails> | ||
assertEquals("EUR", result.value.currency) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use mockito-kotlin assertions
…ture/PWN-8895-striga-payment-api
…org/key-app-android into feature/PWN-8895-striga-payment-api � Conflicts: � app/src/main/java/org/p2p/wallet/striga/wallet/api/StrigaWalletApi.kt � app/src/main/java/org/p2p/wallet/striga/wallet/repository/StrigaWalletRemoteRepository.kt � app/src/main/java/org/p2p/wallet/striga/wallet/repository/StrigaWalletRepository.kt � app/src/test/java/org/p2p/wallet/striga/wallet/repository/StrigaWalletRepositoryEnrichAccountTest.kt
…ture/PWN-8895-striga-payment-api
* PWN-8904 - Striga API. get_estimated_fees * PWN-8904 - comment fixes * PWN-8904 - change base url * PWN-8904 - add StrigaUserWalletsMapper to koin * PWN-8904 - add ending slashes to new striga urls --------- Co-authored-by: Eduard Maximovich <[email protected]>
…ture/PWN-8895-striga-payment-api
Jira Ticket
https://p2pvalidator.atlassian.net/browse/PWN-8895
https://p2pvalidator.atlassian.net/browse/PWN-8776
Description of Work