├── .github └── workflows │ ├── build_gradle.yaml │ └── deploy.yaml ├── .gitignore ├── .utility ├── initiate-publish.sh └── secring.gpg.enc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src ├── main ├── java │ └── com │ │ └── mangopay │ │ ├── MangoPayApi.java │ │ ├── core │ │ ├── APIs │ │ │ ├── ApiBase.java │ │ │ ├── BankingAliasApi.java │ │ │ ├── CardApi.java │ │ │ ├── CardPreAuthorizationApi.java │ │ │ ├── CardRegistrationApi.java │ │ │ ├── ClientApi.java │ │ │ ├── ConversionsApi.java │ │ │ ├── DepositApi.java │ │ │ ├── DisputeApi.java │ │ │ ├── EventApi.java │ │ │ ├── HookApi.java │ │ │ ├── IdempotencyApi.java │ │ │ ├── IdentityVerificationApi.java │ │ │ ├── KycDocumentApi.java │ │ │ ├── MandateApi.java │ │ │ ├── OAuthApi.java │ │ │ ├── PayInApi.java │ │ │ ├── PayOutApi.java │ │ │ ├── RecipientApi.java │ │ │ ├── RefundApi.java │ │ │ ├── RegulatoryApi.java │ │ │ ├── ReportApi.java │ │ │ ├── ReportV2Api.java │ │ │ ├── RepudiationApi.java │ │ │ ├── SettlementApi.java │ │ │ ├── TransferApi.java │ │ │ ├── UboDeclarationApi.java │ │ │ ├── UserApi.java │ │ │ ├── VirtualAccountApi.java │ │ │ ├── WalletApi.java │ │ │ └── implementation │ │ │ │ ├── BankingAliasApiImpl.java │ │ │ │ ├── CardApiImpl.java │ │ │ │ ├── CardPreAuthorizationApiImpl.java │ │ │ │ ├── CardRegistrationApiImpl.java │ │ │ │ ├── ClientApiImpl.java │ │ │ │ ├── ConversionsApiImpl.java │ │ │ │ ├── DepositApiImpl.java │ │ │ │ ├── DisputeApiImpl.java │ │ │ │ ├── EventApiImpl.java │ │ │ │ ├── HookApiImpl.java │ │ │ │ ├── IdempotencyApiImpl.java │ │ │ │ ├── IdentityVerificationApiImpl.java │ │ │ │ ├── KycDocumentApiImpl.java │ │ │ │ ├── MandateApiImpl.java │ │ │ │ ├── OAuthApiImpl.java │ │ │ │ ├── PayInApiImpl.java │ │ │ │ ├── PayOutApiImpl.java │ │ │ │ ├── RecipientApiImpl.java │ │ │ │ ├── RefundApiImpl.java │ │ │ │ ├── RegulatoryApiImpl.java │ │ │ │ ├── ReportApiImpl.java │ │ │ │ ├── ReportV2ApiImpl.java │ │ │ │ ├── RepudiationApiImpl.java │ │ │ │ ├── SettlementApiImpl.java │ │ │ │ ├── TransferApiImpl.java │ │ │ │ ├── UboDeclarationApiImpl.java │ │ │ │ ├── UserApiImpl.java │ │ │ │ ├── VirtualAccountApiImpl.java │ │ │ │ └── WalletApiImpl.java │ │ ├── Address.java │ │ ├── AuthenticationHelper.java │ │ ├── AuthenticationType.java │ │ ├── AuthorizationTokenManager.java │ │ ├── Base64Encoder.java │ │ ├── Billing.java │ │ ├── CardInfo.java │ │ ├── Check.java │ │ ├── CheckData.java │ │ ├── Configuration.java │ │ ├── DeclaredUbo.java │ │ ├── DefaultStorageStrategy.java │ │ ├── DisputeReason.java │ │ ├── DocumentPageConsult.java │ │ ├── Dto.java │ │ ├── EntityBase.java │ │ ├── FileStorageStrategy.java │ │ ├── FilterBankingAlias.java │ │ ├── FilterDisputeDocuments.java │ │ ├── FilterDisputes.java │ │ ├── FilterEvents.java │ │ ├── FilterKycDocuments.java │ │ ├── FilterMandates.java │ │ ├── FilterPreAuthorizations.java │ │ ├── FilterRecipients.java │ │ ├── FilterReports.java │ │ ├── FilterReportsList.java │ │ ├── FilterReportsListV2.java │ │ ├── FilterTransactions.java │ │ ├── FilterWallets.java │ │ ├── LegalRepresentative.java │ │ ├── LineItem.java │ │ ├── Money.java │ │ ├── NoUpdate.java │ │ ├── OAuthToken.java │ │ ├── ObjectTool.java │ │ ├── Pagination.java │ │ ├── PlatformCategorization.java │ │ ├── RefundReason.java │ │ ├── ReportFilters.java │ │ ├── ResponseException.java │ │ ├── RestTool.java │ │ ├── SecurityInfo.java │ │ ├── Shipping.java │ │ ├── ShippingAddress.java │ │ ├── Sorting.java │ │ ├── UrlTool.java │ │ ├── deserializer │ │ │ ├── BankAccountDeserializer.java │ │ │ ├── BankingAliasDeserializer.java │ │ │ ├── CardInfoTypeDeserializer.java │ │ │ ├── PayInDeserializer.java │ │ │ ├── PayOutDeserializer.java │ │ │ ├── RecurringPayInDeserializer.java │ │ │ ├── TransferDeserializer.java │ │ │ └── UserDeserializer.java │ │ ├── enumerations │ │ │ ├── AVSResult.java │ │ │ ├── BankAccountType.java │ │ │ ├── BankingAliasType.java │ │ │ ├── BusinessType.java │ │ │ ├── CardInfoType.java │ │ │ ├── CardType.java │ │ │ ├── CountryIso.java │ │ │ ├── CultureCode.java │ │ │ ├── CurrencyIso.java │ │ │ ├── DeclaredUboStatus.java │ │ │ ├── DepositAccountType.java │ │ │ ├── DepositStatus.java │ │ │ ├── DirectDebitType.java │ │ │ ├── DisputeDocumentStatus.java │ │ │ ├── DisputeDocumentType.java │ │ │ ├── DisputeReasonType.java │ │ │ ├── DisputeStatus.java │ │ │ ├── DisputeType.java │ │ │ ├── DownloadReportFormat.java │ │ │ ├── EventType.java │ │ │ ├── FundsType.java │ │ │ ├── HookStatus.java │ │ │ ├── InitialTransactionType.java │ │ │ ├── KycDocumentType.java │ │ │ ├── KycLevel.java │ │ │ ├── KycStatus.java │ │ │ ├── LegalPersonType.java │ │ │ ├── MandateExecutionType.java │ │ │ ├── MandateScheme.java │ │ │ ├── MandateStatus.java │ │ │ ├── MandateType.java │ │ │ ├── NaturalUserCapacity.java │ │ │ ├── PayInExecutionType.java │ │ │ ├── PayInPaymentType.java │ │ │ ├── PayInReferences.java │ │ │ ├── PayOutPaymentType.java │ │ │ ├── PaymentStatus.java │ │ │ ├── PayoutMode.java │ │ │ ├── PersonType.java │ │ │ ├── PreAuthorizationExecutionType.java │ │ │ ├── PreAuthorizationStatus.java │ │ │ ├── RecurringPayInRegistrationPaymentType.java │ │ │ ├── RefundReasonType.java │ │ │ ├── ReportStatus.java │ │ │ ├── ReportType.java │ │ │ ├── RequestType.java │ │ │ ├── Sector.java │ │ │ ├── SecureMode.java │ │ │ ├── ShippingPreference.java │ │ │ ├── SortDirection.java │ │ │ ├── TransactionNature.java │ │ │ ├── TransactionStatus.java │ │ │ ├── TransactionType.java │ │ │ ├── UboDeclarationRefusedReasonType.java │ │ │ ├── UboDeclarationStatus.java │ │ │ ├── UboRefusedReasonType.java │ │ │ ├── UserCategory.java │ │ │ └── Validity.java │ │ ├── interfaces │ │ │ ├── BankAccountDetails.java │ │ │ ├── BankingAliasDetails.java │ │ │ ├── PayInExecutionDetails.java │ │ │ ├── PayInPaymentDetails.java │ │ │ ├── PayInTransactionDetails.java │ │ │ ├── PayOutPaymentDetails.java │ │ │ └── StorageStrategy.java │ │ └── serializer │ │ │ ├── BankAccountSerializer.java │ │ │ ├── CardInfoTypeSerializer.java │ │ │ ├── CreateConversionQuoteSerializer.java │ │ │ ├── PayInSerializer.java │ │ │ ├── PayOutSerializer.java │ │ │ ├── SerializedTransaction.java │ │ │ ├── TransferSerializer.java │ │ │ └── UserSerializer.java │ │ └── entities │ │ ├── BankAccount.java │ │ ├── BankingAlias.java │ │ ├── BinData.java │ │ ├── Birthplace.java │ │ ├── Card.java │ │ ├── CardPreAuthorization.java │ │ ├── CardPreAuthorizedDepositPayIn.java │ │ ├── CardRegistration.java │ │ ├── CardValidation.java │ │ ├── Client.java │ │ ├── ClientBankWireDirect.java │ │ ├── ClientLogo.java │ │ ├── Conversion.java │ │ ├── ConversionQuote.java │ │ ├── ConversionRate.java │ │ ├── CountryAuthorization.java │ │ ├── CreateConversionQuote.java │ │ ├── CreateInstantConversion.java │ │ ├── CreateQuotedConversion.java │ │ ├── CreateRecurringPayment.java │ │ ├── CurrentState.java │ │ ├── DebitedBankAccount.java │ │ ├── Deposit.java │ │ ├── Dispute.java │ │ ├── DisputeDocument.java │ │ ├── DisputePage.java │ │ ├── EMoney.java │ │ ├── Event.java │ │ ├── Hook.java │ │ ├── IdempotencyResponse.java │ │ ├── IdentityVerification.java │ │ ├── KycDocument.java │ │ ├── KycPage.java │ │ ├── Mandate.java │ │ ├── PayIn.java │ │ ├── PayOut.java │ │ ├── PayOutEligibility.java │ │ ├── PayOutEligibilityResult.java │ │ ├── PaymentMethodMetadata.java │ │ ├── RateLimit.java │ │ ├── Recipient.java │ │ ├── RecurringPayIn.java │ │ ├── RecurringPayInCIT.java │ │ ├── RecurringPayInMIT.java │ │ ├── RecurringPayPalPayInCIT.java │ │ ├── RecurringPayPalPayInMIT.java │ │ ├── RecurringPayment.java │ │ ├── RecurringPaymentExtended.java │ │ ├── RecurringPaymentUpdate.java │ │ ├── Refund.java │ │ ├── Report.java │ │ ├── ReportRequest.java │ │ ├── Repudiation.java │ │ ├── SettlementTransfer.java │ │ ├── Transaction.java │ │ ├── Transfer.java │ │ ├── Ubo.java │ │ ├── UboDeclaration.java │ │ ├── User.java │ │ ├── UserBlockStatus.java │ │ ├── UserLegal.java │ │ ├── UserLegalSca.java │ │ ├── UserNatural.java │ │ ├── UserNaturalSca.java │ │ ├── VirtualAccount.java │ │ ├── Wallet.java │ │ └── subentities │ │ ├── BankAccountDetailsCA.java │ │ ├── BankAccountDetailsGB.java │ │ ├── BankAccountDetailsIBAN.java │ │ ├── BankAccountDetailsOTHER.java │ │ ├── BankAccountDetailsUS.java │ │ ├── BankingAliasDetailsIBAN.java │ │ ├── BrowserInfo.java │ │ ├── BusinessRecipient.java │ │ ├── BusinessRecipientPropertySchema.java │ │ ├── CompanyNumberValidation.java │ │ ├── CountryAuthorizationData.java │ │ ├── CreateCardPreAuthorizedDepositPayIn.java │ │ ├── CreateDeposit.java │ │ ├── CreateReport.java │ │ ├── FallbackReason.java │ │ ├── IndividualRecipient.java │ │ ├── IndividualRecipientPropertySchema.java │ │ ├── InstantPayout.java │ │ ├── InternationalAccount.java │ │ ├── InternationalAccountDetails.java │ │ ├── LocalAccount.java │ │ ├── LocalAccountDetails.java │ │ ├── PayInExecutionDetailsBankingAlias.java │ │ ├── PayInExecutionDetailsDirect.java │ │ ├── PayInExecutionDetailsWeb.java │ │ ├── PayInPaymentDetailsApplePay.java │ │ ├── PayInPaymentDetailsBancontact.java │ │ ├── PayInPaymentDetailsBankWire.java │ │ ├── PayInPaymentDetailsBlik.java │ │ ├── PayInPaymentDetailsCard.java │ │ ├── PayInPaymentDetailsDirectDebit.java │ │ ├── PayInPaymentDetailsGiropay.java │ │ ├── PayInPaymentDetailsGooglePay.java │ │ ├── PayInPaymentDetailsGooglePayV2.java │ │ ├── PayInPaymentDetailsIdeal.java │ │ ├── PayInPaymentDetailsKlarna.java │ │ ├── PayInPaymentDetailsMbway.java │ │ ├── PayInPaymentDetailsMultibanco.java │ │ ├── PayInPaymentDetailsPayByBank.java │ │ ├── PayInPaymentDetailsPayPal.java │ │ ├── PayInPaymentDetailsPayconiq.java │ │ ├── PayInPaymentDetailsPreAuthorized.java │ │ ├── PayInPaymentDetailsSatispay.java │ │ ├── PayInPaymentDetailsSwish.java │ │ ├── PayInPaymentDetailsTwint.java │ │ ├── PayInTemplateURLOptions.java │ │ ├── PayInTransactionDetailsBankWire.java │ │ ├── PayOutPaymentDetailsBankWire.java │ │ ├── PayOutPaymentRef.java │ │ ├── PayPalWebTracking.java │ │ ├── PayinsLinked.java │ │ ├── PaymentData.java │ │ ├── PayoutMethods.java │ │ ├── PendingUserAction.java │ │ ├── RecipientAddressPropertySchema.java │ │ ├── RecipientPropertySchema.java │ │ ├── RecipientSchema.java │ │ ├── ReportColumn.java │ │ ├── ScopeBlocked.java │ │ ├── UpdateDeposit.java │ │ ├── UserDataFormatValidation.java │ │ ├── UserEnrollmentResult.java │ │ ├── UserRecipients.java │ │ ├── VirtualAccountAddress.java │ │ ├── VirtualAccountAvailabilities.java │ │ ├── VirtualAccountAvailability.java │ │ └── VirtualAccountCapabilities.java └── resources │ └── com │ └── mangopay │ └── core │ └── mangopay.properties └── test ├── java └── com │ └── mangopay │ ├── MangoPayApiTest.java │ ├── core │ ├── BankingAliasApiImplTest.java │ ├── BaseTest.java │ ├── CardApiImplTest.java │ ├── CardPreAuthorizationApiImplTest.java │ ├── CardRegistrationApiImplTest.java │ ├── ClientApiImplTest.java │ ├── ConfigurationsTest.java │ ├── ConversionsImplTest.java │ ├── DefaultStorageStrategyForTests.java │ ├── DepositApiImplTest.java │ ├── DisputeApiImplTest.java │ ├── EventApiImplTest.java │ ├── HookApiImplTest.java │ ├── IdempotencyApiImplTest.java │ ├── IdentityVerificationApiImplTest.java │ ├── KycDocumentApiImplTest.java │ ├── MandateApiImplTest.java │ ├── ObjectToolTest.java │ ├── PayInApiImplTest.java │ ├── PayOutApiImplTest.java │ ├── RecipientApiImplTest.java │ ├── RefundApiImplTest.java │ ├── RegulatoryApiImplTest.java │ ├── ReportApiImplTest.java │ ├── ReportV2ApiImplTest.java │ ├── RepudiationApiImplTest.java │ ├── SettlementApiImplTest.java │ ├── TokensTest.java │ ├── TransferApiImplTest.java │ ├── UboDeclarationApiImplTest.java │ ├── UserApiImplTest.java │ ├── VirtualAccountApiImplTest.java │ └── WalletApiImplTest.java │ └── entities │ ├── GsonTest.java │ ├── RateLimitTest.java │ ├── TransactionTest.java │ └── subentities │ ├── PayInExecutionDetailsDirectTest.java │ ├── PayInPaymentDetailsCardTest.java │ └── PayOutPaymentDetailsBankWireTest.java └── resources └── com └── mangopay └── core └── TestKycPageFile.png /.github/workflows/build_gradle.yaml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Gradle 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle 3 | 4 | name: mangopay2-java-sdk-ci 5 | 6 | on: 7 | push: 8 | branches: 9 | # push on master branch 10 | - master 11 | 12 | pull_request: 13 | branches: [ master ] 14 | 15 | jobs: 16 | build: 17 | 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Set up JDK 11 23 | uses: actions/setup-java@v4 24 | with: 25 | java-version: '11' 26 | distribution: 'adopt' 27 | - name: Grant execute permission for gradlew 28 | run: chmod +x gradlew 29 | - name: Build with Gradle 30 | run: ./gradlew build 31 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yaml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Gradle 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle 3 | 4 | name: mangopay2-java-sdk-cd 5 | 6 | on: 7 | push: 8 | tags: 9 | # It pushes any tags that contain a v. ex: v1.16.1 10 | - '*' 11 | jobs: 12 | publish: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Decode secring.gpg 17 | run: | 18 | mkdir -p .gnupg/ 19 | chmod 700 .gnupg 20 | echo "${{secrets.SIGNING_SECRET_KEY_RING_FILE}}" > .gnupg/secring.gpg.b64 21 | base64 -d .gnupg/secring.gpg.b64 > .gnupg/secring.gpg 22 | - name: Set up Java 23 | uses: actions/setup-java@v4 24 | with: 25 | java-version: '8' 26 | distribution: 'adopt' 27 | - name: Validate Gradle wrapper 28 | uses: gradle/actions/wrapper-validation@v4 29 | - name: Install Java 30 | run: | 31 | sudo apt update 32 | sudo apt install openjdk-8-jdk 33 | export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 34 | echo $JAVA_HOME 35 | export PATH=$PATH:$JAVA_HOME/bin 36 | echo $PATH 37 | java -version 38 | - name: Give permissions to file 39 | run: chmod +x .utility/initiate-publish.sh 40 | - name: Publish 41 | run: ./.utility/initiate-publish.sh 42 | env: 43 | SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} 44 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 45 | MAVEN_PASSWORD: ${{ secrets.PASSWORD }} 46 | - name: Close and publish 47 | run: ./gradlew closeAndReleaseRepository -PnexusUsername=${{ secrets.MAVEN_USERNAME }} -PnexusPassword=${{ secrets.PASSWORD }} 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### NetBeans ### 2 | nbproject/ 3 | build/ 4 | nbbuild/ 5 | dist/ 6 | nbdist/ 7 | nbactions.xml 8 | .nb-gradle/ 9 | 10 | 11 | ### Intelij ### 12 | .idea 13 | 14 | ### Gradle ### 15 | .gradle 16 | /target/ 17 | *.iml 18 | *.gpg 19 | 20 | ### Eclipse ### 21 | .classpath 22 | .project 23 | .settings 24 | out 25 | bin -------------------------------------------------------------------------------- /.utility/initiate-publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script initiates the Gradle publishing task when pushes to master occur. 3 | # NOTE: Travis-CI can only publish SNAPSHOT versions. To release a version, you need 4 | # to use the internal ReadyTalk Jenkins job. 5 | 6 | echo -e "Starting publish to Sonatype...\n" 7 | 8 | ./gradlew publish -PnexusUsername="${MAVEN_USERNAME}" -PnexusPassword="${MAVEN_PASSWORD}" -Psigning.keyId=610AABD3 -Psigning.password="${SIGNING_PASSWORD}" -Psigning.secretKeyRingFile=.gnupg/secring.gpg 9 | 10 | -------------------------------------------------------------------------------- /.utility/secring.gpg.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mangopay/mangopay2-java-sdk/991f35519e3a2e3c685e287ea22c7489e3d1ece0/.utility/secring.gpg.enc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mangopay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mangopay/mangopay2-java-sdk/991f35519e3a2e3c685e287ea22c7489e3d1ece0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'youri' at '4/2/16 1:46 PM' with Gradle 2.12 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.12/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'mangopay2-java-sdk' 20 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/CardPreAuthorizationApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.Pagination; 4 | import com.mangopay.entities.CardPreAuthorization; 5 | import com.mangopay.entities.Transaction; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by thepa on 18-Jan-17. 11 | */ 12 | public interface CardPreAuthorizationApi { 13 | 14 | /** 15 | * Creates new pre-authorization object. 16 | * 17 | * @param cardPreAuthorization PreAuthorization object to be created. 18 | * @return Card pre-authorization instance returned from API. 19 | * @throws Exception 20 | */ 21 | CardPreAuthorization create(CardPreAuthorization cardPreAuthorization) throws Exception; 22 | 23 | /** 24 | * Creates new pre-authorization object. 25 | * 26 | * @param idempotencyKey idempotency key for this request. 27 | * @param cardPreAuthorization PreAuthorization object to be created. 28 | * @return Card pre-authorization instance returned from API. 29 | * @throws Exception 30 | */ 31 | CardPreAuthorization create(String idempotencyKey, CardPreAuthorization cardPreAuthorization) throws Exception; 32 | 33 | /** 34 | * Gets pre-authorization object. 35 | * 36 | * @param cardPreAuthorizationId PreAuthorization identifier. 37 | * @return Card pre-authorization instance returned from API. 38 | * @throws Exception 39 | */ 40 | CardPreAuthorization get(String cardPreAuthorizationId) throws Exception; 41 | 42 | /** 43 | * Updates pre-authorization object. 44 | * 45 | * @param cardPreAuthorization PreAuthorization object to be updated. 46 | * @return Card pre-authorization instance returned from API. 47 | * @throws Exception 48 | */ 49 | CardPreAuthorization update(CardPreAuthorization cardPreAuthorization) throws Exception; 50 | 51 | List getTransactions(String cardPreAuthorizationId, Pagination pagination) throws Exception; 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/CardRegistrationApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.entities.CardRegistration; 4 | 5 | /** 6 | * Created by thepa on 18-Jan-17. 7 | */ 8 | public interface CardRegistrationApi { 9 | /** 10 | * Creates new card registration. 11 | * @param cardRegistration Card registration object to create. 12 | * @return Card registration instance returned from API. 13 | * @throws Exception 14 | */ 15 | CardRegistration create(CardRegistration cardRegistration) throws Exception; 16 | 17 | /** 18 | * Creates new card registration. 19 | * @param idempotencyKey idempotency key for this request. 20 | * @param cardRegistration Card registration object to create. 21 | * @return Card registration instance returned from API. 22 | * @throws Exception 23 | */ 24 | CardRegistration create(String idempotencyKey, CardRegistration cardRegistration) throws Exception; 25 | 26 | /** 27 | * Gets card registration. 28 | * @param cardRegistrationId Card Registration identifier. 29 | * @return Card registration instance returned from API. 30 | * @throws Exception 31 | */ 32 | CardRegistration get(String cardRegistrationId) throws Exception; 33 | 34 | /** 35 | * Updates card registration. 36 | * @param cardRegistration Card registration object to be updated. 37 | * @return Card registration instance returned from API. 38 | * @throws Exception 39 | */ 40 | CardRegistration update(CardRegistration cardRegistration) throws Exception; 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/EventApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.FilterEvents; 4 | import com.mangopay.core.Pagination; 5 | import com.mangopay.core.Sorting; 6 | import com.mangopay.entities.Event; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by thepa on 18-Jan-17. 12 | */ 13 | public interface EventApi { 14 | /** 15 | * Gets the events. 16 | * @param filter Filters for events. 17 | * @param pagination Pagination. 18 | * @return List of events matching passed filter criteria. 19 | * @throws Exception 20 | */ 21 | List get(FilterEvents filter, Pagination pagination, Sorting sorting) throws Exception; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/HookApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.Pagination; 4 | import com.mangopay.core.Sorting; 5 | import com.mangopay.entities.Hook; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by thepa on 18-Jan-17. 11 | */ 12 | public interface HookApi { 13 | /** 14 | * Creates new hook. 15 | * @param hook Hook instance to be created. 16 | * @return Hook instance returned from API. 17 | * @throws Exception 18 | */ 19 | Hook create(Hook hook) throws Exception; 20 | 21 | /** 22 | * Creates new hook. 23 | * @param idempotencyKey idempotency key for this request. 24 | * @param hook Hook instance to be created. 25 | * @return Hook instance returned from API. 26 | * @throws Exception 27 | */ 28 | Hook create(String idempotencyKey, Hook hook) throws Exception; 29 | 30 | /** 31 | * Gets hook. 32 | * @param hookId Hook identifier. 33 | * @return Hook instance returned from API. 34 | * @throws Exception 35 | */ 36 | Hook get(String hookId) throws Exception; 37 | 38 | /** 39 | * Saves hook. 40 | * @param hook Hook instance to be saved. 41 | * @return Hook instance returned from API. 42 | * @throws Exception 43 | */ 44 | Hook update(Hook hook) throws Exception; 45 | 46 | /** 47 | * Gets all hooks. 48 | * @param pagination Pagination. 49 | * @return List of Hook instances returned from API. 50 | * @throws Exception 51 | */ 52 | List getAll(Pagination pagination, Sorting sorting) throws Exception; 53 | 54 | /** 55 | * Gets all hooks. 56 | * @return List of Hook instances returned from API. 57 | * @throws Exception 58 | */ 59 | List getAll() throws Exception; 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/IdempotencyApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.entities.IdempotencyResponse; 4 | 5 | /** 6 | * Created by thepa on 18-Jan-17. 7 | */ 8 | public interface IdempotencyApi { 9 | /** 10 | * Gets idempotency response. 11 | * 12 | * @param idempotencyKey idempotency key. 13 | * @return idempotency response instance returned from API. 14 | * @throws Exception 15 | */ 16 | IdempotencyResponse get(String idempotencyKey) throws Exception; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/IdentityVerificationApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.Pagination; 4 | import com.mangopay.entities.IdentityVerification; 5 | 6 | import java.util.List; 7 | 8 | 9 | public interface IdentityVerificationApi { 10 | /** 11 | * Start an identity verification session and get a link for the hosted experience 12 | * 13 | * @param identityVerification The IdentityVerification object. 'ReturnUrl' is required 14 | * @param userId The user id 15 | * @return IdentityVerification instance 16 | */ 17 | IdentityVerification create(IdentityVerification identityVerification, String userId) throws Exception; 18 | 19 | /** 20 | * Start an identity verification session and get a link for the hosted experience 21 | * 22 | * @param identityVerification the IdentityVerification object. 'ReturnUrl' is required 23 | * @param userId the user id 24 | * @param idempotencyKey idempotency key for this request. 25 | * @return IdentityVerification instance 26 | */ 27 | IdentityVerification create(IdentityVerification identityVerification, String userId, String idempotencyKey) throws Exception; 28 | 29 | /** 30 | * See the status and basic details of an identity verification session 31 | * 32 | * @param id The unique identifier of the identity verification session. 33 | * @return IdentityVerification instance 34 | */ 35 | IdentityVerification get(String id) throws Exception; 36 | 37 | /** 38 | * See the status and basic details of an identity verification session 39 | * 40 | * @param userId The unique identifier of the user. 41 | * @return List of IdentityVerifications 42 | */ 43 | List getAll(String userId, Pagination pagination) throws Exception; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/KycDocumentApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.DocumentPageConsult; 4 | import com.mangopay.core.FilterKycDocuments; 5 | import com.mangopay.core.Pagination; 6 | import com.mangopay.core.Sorting; 7 | import com.mangopay.entities.KycDocument; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Created by thepa on 18-Jan-17. 13 | */ 14 | public interface KycDocumentApi { 15 | /** 16 | * Gets all KYC documents. 17 | * @param pagination Pagination object. 18 | * @param sorting Sorting object. 19 | * @return Collection of KycDocuments returned from API. 20 | * @throws Exception 21 | */ 22 | List getAll(Pagination pagination, Sorting sorting) throws Exception; 23 | 24 | List getAll(Pagination pagination, FilterKycDocuments filter, Sorting sorting) throws Exception; 25 | 26 | /** 27 | * Gets KYC document. 28 | * @param kycDocumentId KYC document identifier. 29 | * @return KYC document returned from API. 30 | * @throws Exception 31 | */ 32 | KycDocument getKycDocument(String kycDocumentId) throws Exception; 33 | 34 | /** 35 | * Creates temporary URLs where each page of a KYC document can be viewed. 36 | * 37 | * @param kycDocumentId Identification of the document whose pages to view 38 | * @throws Exception 39 | */ 40 | List createKycDocumentConsult(String kycDocumentId) throws Exception; 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/OAuthApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.OAuthToken; 4 | 5 | /** 6 | * Created by thepa on 18-Jan-17. 7 | */ 8 | public interface OAuthApi { 9 | 10 | /** 11 | * Gets the new token used for requests authentication. 12 | * 13 | * @return OAuth object with token information. 14 | */ 15 | OAuthToken createToken() throws Exception; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/RefundApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.entities.Refund; 4 | 5 | /** 6 | * Created by thepa on 18-Jan-17. 7 | */ 8 | public interface RefundApi { 9 | /** 10 | * Gets refund entity. 11 | * 12 | * @param refundId Refund identifier. 13 | * @return Refund entity instance returned from API. 14 | * @throws Exception 15 | */ 16 | Refund get(String refundId) throws Exception; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/RegulatoryApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.Pagination; 4 | import com.mangopay.core.Sorting; 5 | import com.mangopay.core.enumerations.CountryIso; 6 | import com.mangopay.entities.CountryAuthorization; 7 | 8 | import java.util.List; 9 | 10 | public interface RegulatoryApi { 11 | /** 12 | * View the restrictions for a specific country 13 | */ 14 | CountryAuthorization getCountryAuthorizations(CountryIso countryCode) throws Exception; 15 | 16 | /** 17 | * View the restrictions of all the countries 18 | */ 19 | List getAllCountriesAuthorizations(Pagination pagination, Sorting sorting) throws Exception; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/ReportV2Api.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.FilterReportsListV2; 4 | import com.mangopay.core.Pagination; 5 | import com.mangopay.core.Sorting; 6 | import com.mangopay.entities.Report; 7 | import com.mangopay.entities.subentities.CreateReport; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Report V2 (2025) integration 13 | */ 14 | public interface ReportV2Api { 15 | /** 16 | * Creates new report. 17 | * 18 | * @param report Report details for creation 19 | * @return Newly-created {@link Report} 20 | */ 21 | Report create(CreateReport report) throws Exception; 22 | 23 | /** 24 | * Creates new report. 25 | * 26 | * @param idempotencyKey Idempotency key 27 | * @param report Report details for creation 28 | * @return Newly-created {@link Report} 29 | */ 30 | Report create(String idempotencyKey, CreateReport report) throws Exception; 31 | 32 | /** 33 | * Gets a report by its unique identifier. 34 | * 35 | * @param reportId Unique report identifier 36 | * @return Corresponding {@link Report} 37 | */ 38 | Report get(String reportId) throws Exception; 39 | 40 | /** 41 | * Gets a list of all reports. 42 | * 43 | * @param pagination Pagination object 44 | * @param filters Filtering object 45 | * @param sort Sorting object 46 | * @return List of matching {@link Report}s 47 | * @throws Exception 48 | */ 49 | List getAll(Pagination pagination, FilterReportsListV2 filters, Sorting sort) throws Exception; 50 | 51 | /** 52 | * Gets a list of all reports. 53 | * 54 | * @return List of {@link Report}s 55 | * @throws Exception 56 | */ 57 | List getAll() throws Exception; 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/RepudiationApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.core.Pagination; 4 | import com.mangopay.core.Sorting; 5 | import com.mangopay.entities.Refund; 6 | import com.mangopay.entities.Repudiation; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by cosmin on 17-11-2017. 12 | */ 13 | public interface RepudiationApi { 14 | /** 15 | * Gets repudiation. 16 | * 17 | * @param repudiationId Repudiation identifier. 18 | * @return Repudiation instance returned from API. 19 | * @throws Exception 20 | */ 21 | Repudiation getRepudiation(String repudiationId) throws Exception; 22 | 23 | /** 24 | * Get first page of repudiation's refunds 25 | * 26 | * @param repudiationId Repudiation identifier. 27 | * @return Collection of repudiation refunds 28 | * @throws Exception 29 | */ 30 | List getRefunds(String repudiationId) throws Exception; 31 | 32 | /** 33 | * Get a page of repudiation's refunds 34 | * 35 | * @param repudiationId Repudiation identifier. 36 | * @param pagination Pagination object 37 | * @param sorting Sorting object 38 | * @return Collection of repudiation refunds 39 | * @throws Exception 40 | */ 41 | List getRefunds(String repudiationId, Pagination pagination, Sorting sorting) throws Exception; 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/SettlementApi.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs; 2 | 3 | import com.mangopay.entities.SettlementTransfer; 4 | 5 | public interface SettlementApi { 6 | 7 | /** 8 | * Get settlement transfer entity 9 | * 10 | * @param id settlement identifier 11 | * @return settlement entity returned from API 12 | * @throws Exception 13 | */ 14 | SettlementTransfer get(String id) throws Exception; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/CardRegistrationApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.CardRegistrationApi; 6 | import com.mangopay.entities.CardRegistration; 7 | 8 | /** 9 | * API for card registrations. 10 | */ 11 | public class CardRegistrationApiImpl extends ApiBase implements CardRegistrationApi { 12 | 13 | /** 14 | * Instantiates new ApiCardRegistration object. 15 | * 16 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance 17 | */ 18 | public CardRegistrationApiImpl(MangoPayApi root) { 19 | super(root); 20 | } 21 | 22 | @Override 23 | public CardRegistration create(CardRegistration cardRegistration) throws Exception { 24 | return this.create(null, cardRegistration); 25 | } 26 | 27 | @Override 28 | public CardRegistration create(String idempotencyKey, CardRegistration cardRegistration) throws Exception { 29 | return this.createObject(CardRegistration.class, idempotencyKey, "cardregistration_create", cardRegistration); 30 | } 31 | 32 | @Override 33 | public CardRegistration get(String cardRegistrationId) throws Exception { 34 | return this.getObject(CardRegistration.class, "cardregistration_get", cardRegistrationId); 35 | } 36 | 37 | @Override 38 | public CardRegistration update(CardRegistration cardRegistration) throws Exception { 39 | return this.updateObject(CardRegistration.class, "cardregistration_save", cardRegistration); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/EventApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.EventApi; 6 | import com.mangopay.core.FilterEvents; 7 | import com.mangopay.core.Pagination; 8 | import com.mangopay.core.Sorting; 9 | import com.mangopay.entities.Event; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * API for events. 15 | */ 16 | public class EventApiImpl extends ApiBase implements EventApi { 17 | 18 | /** 19 | * Instantiates new EventApiImpl object. 20 | * 21 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance. 22 | */ 23 | public EventApiImpl(MangoPayApi root) { 24 | super(root); 25 | } 26 | 27 | @Override 28 | public List get(FilterEvents filter, Pagination pagination, Sorting sorting) throws Exception { 29 | return this.getList(Event[].class, Event.class, "events_all", pagination, "", filter.getValues(), sorting); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/HookApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.HookApi; 6 | import com.mangopay.core.Pagination; 7 | import com.mangopay.core.Sorting; 8 | import com.mangopay.entities.Hook; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * API for hooks. 14 | */ 15 | public class HookApiImpl extends ApiBase implements HookApi { 16 | 17 | /** 18 | * Instantiates new HookApiImpl object. 19 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance. 20 | */ 21 | public HookApiImpl(MangoPayApi root) { 22 | super(root); 23 | } 24 | 25 | @Override 26 | public Hook create(Hook hook) throws Exception { 27 | return this.create(null, hook); 28 | } 29 | 30 | @Override 31 | public Hook create(String idempotencyKey, Hook hook) throws Exception { 32 | return this.createObject(Hook.class, idempotencyKey, "hooks_create", hook); 33 | } 34 | 35 | @Override 36 | public Hook get(String hookId) throws Exception { 37 | return this.getObject(Hook.class, "hooks_get", hookId); 38 | } 39 | 40 | @Override 41 | public Hook update(Hook hook) throws Exception { 42 | return this.updateObject(Hook.class, "hooks_save", hook); 43 | } 44 | 45 | @Override 46 | public List getAll(Pagination pagination, Sorting sorting) throws Exception { 47 | return this.getList(Hook[].class, Hook.class, "hooks_all", pagination, sorting); 48 | } 49 | 50 | @Override 51 | public List getAll() throws Exception { 52 | return this.getAll(null, null); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/IdentityVerificationApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.IdentityVerificationApi; 6 | import com.mangopay.core.Pagination; 7 | import com.mangopay.entities.IdentityVerification; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * API for Identity Verification Sessions. 13 | */ 14 | public class IdentityVerificationApiImpl extends ApiBase implements IdentityVerificationApi { 15 | 16 | /** 17 | * Creates new API instance. 18 | * 19 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance. 20 | */ 21 | public IdentityVerificationApiImpl(MangoPayApi root) { 22 | super(root); 23 | } 24 | 25 | @Override 26 | public IdentityVerification create(IdentityVerification identityVerification, String userId) throws Exception { 27 | return create(identityVerification, userId, null); 28 | } 29 | 30 | @Override 31 | public IdentityVerification create(IdentityVerification identityVerification, String userId, String idempotencyKey) throws Exception { 32 | return this.createObject(IdentityVerification.class, idempotencyKey, "identify_verification_create", identityVerification, userId); 33 | } 34 | 35 | @Override 36 | public IdentityVerification get(String id) throws Exception { 37 | return this.getObject(IdentityVerification.class, "identify_verification_get", id); 38 | } 39 | 40 | @Override 41 | public List getAll(String userId, Pagination pagination) throws Exception { 42 | return this.getList(IdentityVerification[].class, IdentityVerification.class, "identify_verification_get_all", pagination, userId); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/KycDocumentApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.KycDocumentApi; 6 | import com.mangopay.core.DocumentPageConsult; 7 | import com.mangopay.core.FilterKycDocuments; 8 | import com.mangopay.core.Pagination; 9 | import com.mangopay.core.Sorting; 10 | import com.mangopay.entities.KycDocument; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * API for KycDocuments. 16 | */ 17 | public class KycDocumentApiImpl extends ApiBase implements KycDocumentApi { 18 | 19 | /** 20 | * Instantiates new KycDocumentApiImpl object. 21 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance 22 | */ 23 | public KycDocumentApiImpl(MangoPayApi root) { 24 | super(root); 25 | } 26 | 27 | @Override 28 | public List getAll(Pagination pagination, Sorting sorting) throws Exception { 29 | return this.getList(KycDocument[].class, KycDocument.class, "kyc_documents_all", pagination, sorting); 30 | } 31 | 32 | @Override 33 | public List getAll(Pagination pagination, FilterKycDocuments filter, Sorting sorting) throws Exception { 34 | return this.getList(KycDocument[].class, KycDocument.class, "kyc_documents_all", pagination, null, null, filter.getValues(), sorting); 35 | } 36 | 37 | @Override 38 | public KycDocument getKycDocument(String kycDocumentId) throws Exception { 39 | return this.getObject(KycDocument.class, "kyc_document_get", kycDocumentId); 40 | } 41 | 42 | @Override 43 | public List createKycDocumentConsult(String kycDocumentId) throws Exception { 44 | return this.getList(DocumentPageConsult[].class, DocumentPageConsult.class, "kyc_document_create_consult", null, kycDocumentId); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/RefundApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.RefundApi; 6 | import com.mangopay.entities.Refund; 7 | 8 | /** 9 | * API for refunds. 10 | */ 11 | public class RefundApiImpl extends ApiBase implements RefundApi { 12 | 13 | /** 14 | * Instantiates new RefundApiImpl object. 15 | * 16 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance. 17 | */ 18 | public RefundApiImpl(MangoPayApi root) { 19 | super(root); 20 | } 21 | 22 | @Override 23 | public Refund get(String refundId) throws Exception { 24 | return this.getObject(Refund.class, "refunds_get", refundId); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/RegulatoryApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.RegulatoryApi; 6 | import com.mangopay.core.Pagination; 7 | import com.mangopay.core.Sorting; 8 | import com.mangopay.core.enumerations.CountryIso; 9 | import com.mangopay.entities.CountryAuthorization; 10 | 11 | import java.util.List; 12 | 13 | public class RegulatoryApiImpl extends ApiBase implements RegulatoryApi { 14 | /** 15 | * Creates new API instance. 16 | * 17 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance. 18 | */ 19 | public RegulatoryApiImpl(MangoPayApi root) { 20 | super(root); 21 | } 22 | 23 | @Override 24 | public CountryAuthorization getCountryAuthorizations(CountryIso countryCode) throws Exception { 25 | return this.getObjectNoClientId(CountryAuthorization.class, "country_authorization_get", countryCode); 26 | } 27 | 28 | @Override 29 | public List getAllCountriesAuthorizations(Pagination pagination, Sorting sorting) throws Exception { 30 | return this.getListNoClientId(CountryAuthorization[].class, CountryAuthorization.class, "country_authorization_all", pagination, sorting); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/ReportV2ApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.ReportV2Api; 6 | import com.mangopay.core.FilterReportsListV2; 7 | import com.mangopay.core.Pagination; 8 | import com.mangopay.core.Sorting; 9 | import com.mangopay.entities.Report; 10 | import com.mangopay.entities.subentities.CreateReport; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * API for reports V2 (2025) 16 | */ 17 | public class ReportV2ApiImpl extends ApiBase implements ReportV2Api { 18 | 19 | public ReportV2ApiImpl(MangoPayApi root) { 20 | super(root); 21 | } 22 | 23 | @Override 24 | public Report create(CreateReport report) throws Exception { 25 | return create(null, report); 26 | } 27 | 28 | @Override 29 | public Report create(String idempotencyKey, CreateReport report) throws Exception { 30 | return this.createObject(Report.class, idempotencyKey, "reports_create", report); 31 | } 32 | 33 | @Override 34 | public Report get(String reportId) throws Exception { 35 | return this.getObject(Report.class, "reports_get_v2", reportId); 36 | } 37 | 38 | @Override 39 | public List getAll(Pagination pagination, FilterReportsListV2 filters, Sorting sort) throws Exception { 40 | if (filters == null) { 41 | filters = new FilterReportsListV2(); 42 | } 43 | return this.getList(Report[].class, Report.class, "reports_get_all_v2", pagination, null, filters.getValues(), sort); 44 | } 45 | 46 | @Override 47 | public List getAll() throws Exception { 48 | return getAll(null, null, null); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/RepudiationApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.RepudiationApi; 6 | import com.mangopay.core.Pagination; 7 | import com.mangopay.core.Sorting; 8 | import com.mangopay.entities.Refund; 9 | import com.mangopay.entities.Repudiation; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Created by cosmin on 17-11-2017. 15 | */ 16 | public class RepudiationApiImpl extends ApiBase implements RepudiationApi { 17 | 18 | /** 19 | * Creates new API instance. 20 | * 21 | * @param root Root/parent instance that holds the OAuthToken and Configuration instance. 22 | */ 23 | public RepudiationApiImpl(MangoPayApi root) { 24 | super(root); 25 | } 26 | 27 | @Override 28 | public Repudiation getRepudiation(String repudiationId) throws Exception { 29 | return this.getObject(Repudiation.class, "disputes_repudiation_get", repudiationId); 30 | } 31 | 32 | @Override 33 | public List getRefunds(String repudiationId) throws Exception { 34 | return this.getRefunds(repudiationId, null, null); 35 | } 36 | 37 | @Override 38 | public List getRefunds(String repudiationId, Pagination pagination, Sorting sorting) throws Exception { 39 | return this.getList(Refund[].class, Refund.class, "repudiation_get_refunds", pagination, repudiationId, sorting); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/APIs/implementation/SettlementApiImpl.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.APIs.implementation; 2 | 3 | import com.mangopay.MangoPayApi; 4 | import com.mangopay.core.APIs.ApiBase; 5 | import com.mangopay.core.APIs.SettlementApi; 6 | import com.mangopay.entities.SettlementTransfer; 7 | 8 | /** 9 | * API for settlements 10 | */ 11 | public class SettlementApiImpl extends ApiBase implements SettlementApi { 12 | 13 | public SettlementApiImpl(MangoPayApi root) { 14 | super(root); 15 | } 16 | 17 | @Override 18 | public SettlementTransfer get(String id) throws Exception { 19 | return this.getObject(SettlementTransfer.class, "settlements_get", id); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/AuthenticationType.java: -------------------------------------------------------------------------------- 1 | //package com.mangopay.core; 2 | // 3 | ///** 4 | // * Authentication types enumeration. 5 | // */ 6 | //public enum AuthenticationType { 7 | // 8 | // /** 9 | // * Basic Access Authentication 10 | // */ 11 | // Basic, 12 | // 13 | // /** 14 | // * OAuth 2.0 : Client Credentials Grant 15 | // */ 16 | // Strong 17 | //} 18 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/Billing.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.lang.reflect.Type; 6 | import java.util.Map; 7 | 8 | public class Billing extends Dto { 9 | 10 | @SerializedName("FirstName") 11 | private String firstName; 12 | 13 | @SerializedName("LastName") 14 | private String lastName; 15 | 16 | @SerializedName("Address") 17 | private Address address; 18 | 19 | public String getFirstName() { 20 | return firstName; 21 | } 22 | 23 | public void setFirstName(String firstName) { 24 | this.firstName = firstName; 25 | } 26 | 27 | public String getLastName() { 28 | return lastName; 29 | } 30 | 31 | public void setLastName(String lastName) { 32 | this.lastName = lastName; 33 | } 34 | 35 | public Address getAddress() { 36 | return address; 37 | } 38 | 39 | public void setAddress(Address address) { 40 | this.address = address; 41 | } 42 | 43 | @Override 44 | public Map getSubObjects() { 45 | 46 | Map result = super.getSubObjects(); 47 | 48 | result.put("Address", Address.class); 49 | 50 | return result; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/CheckData.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class CheckData extends Dto { 6 | 7 | /** 8 | * The type of the data point. 9 | */ 10 | @SerializedName("Type") 11 | private String type; 12 | 13 | /** 14 | * The value of the data point. 15 | */ 16 | @SerializedName("Value") 17 | private String value; 18 | 19 | public String getType() { 20 | return type; 21 | } 22 | 23 | public void setType(String type) { 24 | this.type = type; 25 | } 26 | 27 | public String getValue() { 28 | return value; 29 | } 30 | 31 | public void setValue(String value) { 32 | this.value = value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/DeclaredUbo.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.UboRefusedReasonType; 5 | import com.mangopay.core.enumerations.DeclaredUboStatus; 6 | 7 | /** 8 | * Represents validation status of a user declared as UBO. 9 | */ 10 | public class DeclaredUbo extends Dto { 11 | 12 | /** 13 | * ID of the declared user. 14 | */ 15 | @SerializedName("UserId") 16 | private String userId; 17 | 18 | /** 19 | * Validation status of this declared UBO. 20 | */ 21 | @SerializedName("Status") 22 | private DeclaredUboStatus status; 23 | 24 | /** 25 | * Reason why the declared UBO is not valid. 26 | */ 27 | @SerializedName("RefusedReasonType") 28 | private UboRefusedReasonType refusedReasonType; 29 | 30 | /** 31 | * Message explaining why the UBO is not valid. 32 | */ 33 | @SerializedName("RefusedReasonMessage") 34 | private String refusedReasonMessage; 35 | 36 | public String getUserId() { 37 | return userId; 38 | } 39 | 40 | public void setUserId(String userId) { 41 | this.userId = userId; 42 | } 43 | 44 | public DeclaredUboStatus getStatus() { 45 | return status; 46 | } 47 | 48 | public void setStatus(DeclaredUboStatus status) { 49 | this.status = status; 50 | } 51 | 52 | public UboRefusedReasonType getRefusedReasonType() { 53 | return refusedReasonType; 54 | } 55 | 56 | public void setRefusedReasonType(UboRefusedReasonType refusedReasonType) { 57 | this.refusedReasonType = refusedReasonType; 58 | } 59 | 60 | public String getRefusedReasonMessage() { 61 | return refusedReasonMessage; 62 | } 63 | 64 | public void setRefusedReasonMessage(String refusedReasonMessage) { 65 | this.refusedReasonMessage = refusedReasonMessage; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/DefaultStorageStrategy.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.mangopay.core.interfaces.StorageStrategy; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | /** 8 | * Default token storage strategy implementation. 9 | */ 10 | public class DefaultStorageStrategy implements StorageStrategy { 11 | 12 | private static Map oAuthToken = new HashMap<>(); 13 | 14 | /** 15 | * Gets the currently stored token. 16 | * @param envKey Environment key for token. 17 | * @return Currently stored token instance or null. 18 | */ 19 | @Override 20 | public OAuthToken get(String envKey) { 21 | if (!oAuthToken.containsKey(envKey)) return null; 22 | 23 | return oAuthToken.get(envKey); 24 | } 25 | 26 | /** 27 | * Stores authorization token passed as an argument. 28 | * @param token Token instance to be stored. 29 | * @param envKey Environment key for token. 30 | */ 31 | @Override 32 | public void store(OAuthToken token, String envKey) { 33 | oAuthToken.put(envKey, token); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/DisputeReason.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.DisputeReasonType; 5 | 6 | /** 7 | * Class represents dispute's reason. 8 | */ 9 | public class DisputeReason extends Dto { 10 | 11 | /** 12 | * Dispute's reason type. 13 | */ 14 | @SerializedName("DisputeReasonType") 15 | private DisputeReasonType disputeReasonType; 16 | 17 | /** 18 | * Dispute's reason message. 19 | */ 20 | @SerializedName("DisputeReasonMessage") 21 | private String disputeReasonMessage; 22 | 23 | public DisputeReasonType getDisputeReasonType() { 24 | return disputeReasonType; 25 | } 26 | 27 | public void setDisputeReasonType(DisputeReasonType disputeReasonType) { 28 | this.disputeReasonType = disputeReasonType; 29 | } 30 | 31 | public String getDisputeReasonMessage() { 32 | return disputeReasonMessage; 33 | } 34 | 35 | public void setDisputeReasonMessage(String disputeReasonMessage) { 36 | this.disputeReasonMessage = disputeReasonMessage; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/DocumentPageConsult.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Holds document page viewing data. 7 | */ 8 | public class DocumentPageConsult extends Dto { 9 | 10 | /** 11 | * URL where this document page can be viewed. 12 | */ 13 | @SerializedName("Url") 14 | private String url; 15 | 16 | /** 17 | * Time in millis when the page consult will expire. 18 | */ 19 | @SerializedName("ExpirationDate") 20 | private long expirationDate; 21 | 22 | public String getUrl() { 23 | return url; 24 | } 25 | 26 | public void setUrl(String url) { 27 | this.url = url; 28 | } 29 | 30 | public long getExpirationDate() { 31 | return expirationDate; 32 | } 33 | 34 | public void setExpirationDate(long expirationDate) { 35 | this.expirationDate = expirationDate; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/Dto.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import java.lang.reflect.Type; 4 | import java.util.*; 5 | 6 | /** 7 | * Base abstract class for entities. 8 | */ 9 | public abstract class Dto { 10 | 11 | /** 12 | * Gets map which property is an object and what type of object. 13 | * To be overridden in child class if has any sub objects. 14 | * @return Collection of field name-field type pairs. 15 | */ 16 | public Map getSubObjects() { return new HashMap<>(); } 17 | 18 | /** 19 | * Gets the structure that maps which property depends on other property. 20 | * To be overridden in child class if has any dependent objects. 21 | * @return 22 | */ 23 | public Map>>> getDependentObjects() { return new HashMap<>(); } 24 | 25 | /** 26 | * Gets map of fields and values. 27 | * To be overridden in child class. 28 | * @return Collection of field name-field value pairs. 29 | */ 30 | public Map getValues() { return new HashMap<>(); } 31 | 32 | /** 33 | * Gets the collection of read-only fields names. 34 | * To be overridden in child class. 35 | * @return List of field names. 36 | */ 37 | public ArrayList getReadOnlyProperties() { return new ArrayList<>(); } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/EntityBase.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Base abstract class for entities. Provides common properties. 9 | */ 10 | public abstract class EntityBase extends Dto { 11 | 12 | /** 13 | * Unique identifier. 14 | */ 15 | @SerializedName("Id") 16 | private String id; 17 | 18 | /** 19 | * Custom data. 20 | */ 21 | @SerializedName("Tag") 22 | private String tag; 23 | 24 | /** 25 | * Date of creation (UNIX timestamp). 26 | */ 27 | @SerializedName("CreationDate") 28 | private long creationDate; 29 | 30 | public String getId() { 31 | return id; 32 | } 33 | 34 | public void setId(String id) { 35 | this.id = id; 36 | } 37 | 38 | public String getTag() { 39 | return tag; 40 | } 41 | 42 | public void setTag(String tag) { 43 | this.tag = tag; 44 | } 45 | 46 | public long getCreationDate() { 47 | return creationDate; 48 | } 49 | 50 | public void setCreationDate(long creationDate) { 51 | this.creationDate = creationDate; 52 | } 53 | 54 | /** 55 | * Gets the collection of read-only fields names. 56 | * 57 | * @return List of field names. 58 | */ 59 | @Override 60 | public ArrayList getReadOnlyProperties() { 61 | 62 | ArrayList result = new ArrayList<>(); 63 | 64 | result.add("Id"); 65 | result.add("CreationDate"); 66 | 67 | return result; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterBankingAlias.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * Filter for banking alias list. 8 | */ 9 | public class FilterBankingAlias extends Dto { 10 | 11 | /** 12 | * Return only banking aliases that have creation date BEFORE this date. 13 | */ 14 | public Long BeforeDate; 15 | /** 16 | * Return only banking aliases that have creation date AFTER this date. 17 | */ 18 | public Long AfterDate; 19 | 20 | public Long getBeforeDate() { 21 | return BeforeDate; 22 | } 23 | 24 | public void setBeforeDate(Long beforeDate) { 25 | this.BeforeDate = beforeDate; 26 | } 27 | 28 | public Long getAfterDate() { 29 | return AfterDate; 30 | } 31 | 32 | public void setAfterDate(Long afterDate) { 33 | this.AfterDate = afterDate; 34 | } 35 | 36 | /** 37 | * Gets map of fields and values. 38 | * 39 | * @return Collection of field name-field value pairs. 40 | */ 41 | @Override 42 | public Map getValues() { 43 | HashMap result = new HashMap<>(); 44 | 45 | if (BeforeDate != null) result.put("BeforeDate", Long.toString(BeforeDate)); 46 | if (AfterDate != null) result.put("AfterDate", Long.toString(AfterDate)); 47 | 48 | return result; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterDisputes.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * Filter for disputes list. 10 | */ 11 | public class FilterDisputes extends Dto { 12 | 13 | /** 14 | * Start date in Unix format: return only disputes that have CreationDate BEFORE this date. 15 | */ 16 | @SerializedName("BeforeDate") 17 | private Long beforeDate; 18 | 19 | /** 20 | * End date in Unix format: return only disputes that have CreationDate AFTER this date. 21 | */ 22 | @SerializedName("AfterDate") 23 | private Long afterDate; 24 | 25 | public Long getBeforeDate() { 26 | return beforeDate; 27 | } 28 | 29 | public void setBeforeDate(Long beforeDate) { 30 | this.beforeDate = beforeDate; 31 | } 32 | 33 | public Long getAfterDate() { 34 | return afterDate; 35 | } 36 | 37 | public void setAfterDate(Long afterDate) { 38 | this.afterDate = afterDate; 39 | } 40 | 41 | /** 42 | * Gets map of fields and values. 43 | * 44 | * @return Collection of field name-field value pairs. 45 | */ 46 | @Override 47 | public Map getValues() { 48 | HashMap result = new HashMap<>(); 49 | 50 | if (beforeDate != null) result.put("BeforeDate", Long.toString(beforeDate)); 51 | if (afterDate != null) result.put("AfterDate", Long.toString(afterDate)); 52 | 53 | return result; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterEvents.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.EventType; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * Filter for events list. 11 | */ 12 | public class FilterEvents extends Dto { 13 | 14 | /** 15 | * Type of events. 16 | */ 17 | @SerializedName("Type") 18 | private EventType type; 19 | 20 | /** 21 | * Start date in Unix format. 22 | */ 23 | @SerializedName("BeforeDate") 24 | private Long beforeDate; 25 | 26 | /** 27 | * End date in Unix format. 28 | */ 29 | @SerializedName("AfterDate") 30 | private Long afterDate; 31 | 32 | public EventType getType() { 33 | return type; 34 | } 35 | 36 | public void setType(EventType type) { 37 | this.type = type; 38 | } 39 | 40 | public Long getBeforeDate() { 41 | return beforeDate; 42 | } 43 | 44 | public void setBeforeDate(Long beforeDate) { 45 | this.beforeDate = beforeDate; 46 | } 47 | 48 | public Long getAfterDate() { 49 | return afterDate; 50 | } 51 | 52 | public void setAfterDate(Long afterDate) { 53 | this.afterDate = afterDate; 54 | } 55 | 56 | /** 57 | * Gets map of fields and values. 58 | * 59 | * @return Collection of field name-field value pairs. 60 | */ 61 | @Override 62 | public Map getValues() { 63 | HashMap result = new HashMap<>(); 64 | 65 | if (type != EventType.ALL) { 66 | result.put("eventtype", type.name()); 67 | } 68 | 69 | if (beforeDate != null) result.put("beforeDate", Long.toString(beforeDate)); 70 | if (afterDate != null) result.put("afterDate", Long.toString(afterDate)); 71 | 72 | return result; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterKycDocuments.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.KycDocumentType; 5 | import com.mangopay.core.enumerations.KycStatus; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | /** 11 | * Filter for KYC documents list. 12 | */ 13 | public class FilterKycDocuments { 14 | 15 | @SerializedName("Status") 16 | private KycStatus status; 17 | 18 | @SerializedName("Type") 19 | private KycDocumentType type; 20 | 21 | @SerializedName("BeforeDate") 22 | private Long beforeDate; 23 | 24 | @SerializedName("AfterDate") 25 | public Long afterDate; 26 | 27 | public KycStatus getStatus() { 28 | return status; 29 | } 30 | 31 | public void setStatus(KycStatus status) { 32 | this.status = status; 33 | } 34 | 35 | public KycDocumentType getType() { 36 | return type; 37 | } 38 | 39 | public void setType(KycDocumentType type) { 40 | this.type = type; 41 | } 42 | 43 | public Long getBeforeDate() { 44 | return beforeDate; 45 | } 46 | 47 | public void setBeforeDate(Long beforeDate) { 48 | this.beforeDate = beforeDate; 49 | } 50 | 51 | public Long getAfterDate() { 52 | return afterDate; 53 | } 54 | 55 | public void setAfterDate(Long afterDate) { 56 | this.afterDate = afterDate; 57 | } 58 | 59 | public Map getValues() { 60 | HashMap result = new HashMap(); 61 | 62 | if (status != null && status != KycStatus.NotSpecified) result.put("status", status.toString()); 63 | if (type != null && type != KycDocumentType.NotSpecified) result.put("type", type.toString()); 64 | if (beforeDate != null) result.put("beforedate", beforeDate.toString()); 65 | if (afterDate != null) result.put("afterdate", afterDate.toString()); 66 | 67 | return result; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterMandates.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.MandateStatus; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * Filters for mandates list. 11 | */ 12 | public class FilterMandates extends Dto { 13 | 14 | /** 15 | * Status of mandates. 16 | */ 17 | @SerializedName("Status") 18 | private MandateStatus status; 19 | 20 | /** 21 | * Start date in Unix format. 22 | */ 23 | @SerializedName("BeforeDate") 24 | private Long beforeDate; 25 | 26 | /** 27 | * End date in Unix format. 28 | */ 29 | @SerializedName("AfterDate") 30 | private Long afterDate; 31 | 32 | public MandateStatus getStatus() { 33 | return status; 34 | } 35 | 36 | public void setStatus(MandateStatus status) { 37 | this.status = status; 38 | } 39 | 40 | public Long getBeforeDate() { 41 | return beforeDate; 42 | } 43 | 44 | public void setBeforeDate(Long beforeDate) { 45 | this.beforeDate = beforeDate; 46 | } 47 | 48 | public Long getAfterDate() { 49 | return afterDate; 50 | } 51 | 52 | public void setAfterDate(Long afterDate) { 53 | this.afterDate = afterDate; 54 | } 55 | 56 | /** 57 | * Gets map of fields and values. 58 | * 59 | * @return Collection of field name-field value pairs. 60 | */ 61 | @Override 62 | public Map getValues() { 63 | HashMap result = new HashMap<>(); 64 | 65 | if (status != null && status != MandateStatus.NotSpecified) { 66 | result.put("status", status.name()); 67 | } 68 | 69 | if (beforeDate != null) result.put("beforeDate", Long.toString(beforeDate)); 70 | if (afterDate != null) result.put("afterDate", Long.toString(afterDate)); 71 | 72 | return result; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterRecipients.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * Filter for recipients list. 10 | */ 11 | public class FilterRecipients extends Dto { 12 | 13 | @SerializedName("RecipientScope") 14 | private String recipientScope; 15 | 16 | public String getRecipientScope() { 17 | return recipientScope; 18 | } 19 | 20 | public FilterRecipients setRecipientScope(String recipientScope) { 21 | this.recipientScope = recipientScope; 22 | return this; 23 | } 24 | 25 | /** 26 | * Gets map of fields and values. 27 | * 28 | * @return Collection of field name-field value pairs. 29 | */ 30 | @Override 31 | public Map getValues() { 32 | HashMap result = new HashMap<>(); 33 | if (recipientScope != null) result.put("RecipientScope", recipientScope); 34 | return result; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterReportsList.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * Filter for reports list. 10 | */ 11 | public class FilterReportsList { 12 | 13 | @SerializedName("BeforeDate") 14 | private Long beforeDate; 15 | 16 | @SerializedName("AfterDate") 17 | private Long afterDate; 18 | 19 | public Long getBeforeDate() { 20 | return beforeDate; 21 | } 22 | 23 | public void setBeforeDate(Long beforeDate) { 24 | this.beforeDate = beforeDate; 25 | } 26 | 27 | public Long getAfterDate() { 28 | return afterDate; 29 | } 30 | 31 | public void setAfterDate(Long afterDate) { 32 | this.afterDate = afterDate; 33 | } 34 | 35 | public Map getValues() { 36 | Map result = new HashMap<>(); 37 | 38 | if (beforeDate != null) result.put("BeforeDate", beforeDate.toString()); 39 | if (afterDate != null) result.put("AfterDate", afterDate.toString()); 40 | 41 | return result; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterReportsListV2.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * Filter for reports list V2 (2025) 10 | */ 11 | public class FilterReportsListV2 { 12 | @SerializedName("Status") 13 | private String status; 14 | 15 | @SerializedName("BeforeDate") 16 | private Long beforeDate; 17 | 18 | @SerializedName("AfterDate") 19 | private Long afterDate; 20 | 21 | public Long getBeforeDate() { 22 | return beforeDate; 23 | } 24 | 25 | public void setBeforeDate(Long beforeDate) { 26 | this.beforeDate = beforeDate; 27 | } 28 | 29 | public Long getAfterDate() { 30 | return afterDate; 31 | } 32 | 33 | public void setAfterDate(Long afterDate) { 34 | this.afterDate = afterDate; 35 | } 36 | 37 | public Map getValues() { 38 | Map result = new HashMap<>(); 39 | 40 | if (beforeDate != null) result.put("BeforeDate", beforeDate.toString()); 41 | if (afterDate != null) result.put("AfterDate", afterDate.toString()); 42 | if (status != null) result.put("Status", status); 43 | 44 | return result; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/FilterWallets.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | public class FilterWallets extends Dto { 9 | 10 | /** 11 | * Possible values: USER_NOT_PRESENT, USER_PRESENT 12 | */ 13 | @SerializedName("ScaContext") 14 | private String scaContext; 15 | 16 | public String getScaContext() { 17 | return scaContext; 18 | } 19 | 20 | public FilterWallets setScaContext(String scaContext) { 21 | this.scaContext = scaContext; 22 | return this; 23 | } 24 | 25 | /** 26 | * Gets map of fields and values. 27 | * 28 | * @return Collection of field name-field value pairs. 29 | */ 30 | @Override 31 | public Map getValues() { 32 | HashMap result = new HashMap<>(); 33 | 34 | if (scaContext != null) result.put("ScaContext", scaContext); 35 | 36 | return result; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/Money.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.CurrencyIso; 5 | 6 | /** 7 | * Class represents money value with currency. 8 | */ 9 | public class Money extends Dto { 10 | 11 | /** 12 | * Currency code in ISO 4217 standard. 13 | */ 14 | @SerializedName("Currency") 15 | private CurrencyIso currency; 16 | 17 | /** 18 | * The currency amount of money, in cents 19 | */ 20 | @SerializedName("Amount") 21 | private int amount; 22 | 23 | public Money(CurrencyIso currency, int amount) { 24 | this.currency = currency; 25 | this.amount = amount; 26 | } 27 | 28 | public Money() { 29 | } 30 | 31 | public CurrencyIso getCurrency() { 32 | return currency; 33 | } 34 | 35 | public int getAmount() { 36 | return amount; 37 | } 38 | 39 | public Money setCurrency(CurrencyIso currency) { 40 | this.currency = currency; 41 | return this; 42 | } 43 | 44 | public Money setAmount(int amount) { 45 | this.amount = amount; 46 | return this; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/NoUpdate.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * Marks entity properties that cannot be updated 7 | */ 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.FIELD) 10 | public @interface NoUpdate { } 11 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/ObjectTool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.mangopay.core; 7 | 8 | /** 9 | * 10 | * @author Hector Espert hespert@peertopark.com 11 | */ 12 | public class ObjectTool { 13 | 14 | public static boolean nonNull(Object object) { 15 | return object != null; 16 | } 17 | 18 | public static boolean isNull(Object object) { 19 | return object == null; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/PlatformCategorization.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.BusinessType; 5 | import com.mangopay.core.enumerations.Sector; 6 | 7 | public class PlatformCategorization { 8 | 9 | @SerializedName("BusinessType") 10 | private BusinessType businessType; 11 | @SerializedName("Sector") 12 | private Sector sector; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/RefundReason.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.RefundReasonType; 5 | 6 | /** 7 | * Class represents refund's reason. 8 | */ 9 | public class RefundReason extends Dto { 10 | 11 | /** 12 | * Message. 13 | */ 14 | @SerializedName("RefundReasonMessage") 15 | private String refundReasonMessage; 16 | 17 | /** 18 | * Type of refund reason. 19 | */ 20 | @SerializedName("RefundReasonType") 21 | private RefundReasonType refundReasonType; 22 | 23 | public String getRefundReasonMessage() { 24 | return refundReasonMessage; 25 | } 26 | 27 | public void setRefundReasonMessage(String refundReasonMessage) { 28 | this.refundReasonMessage = refundReasonMessage; 29 | } 30 | 31 | public RefundReasonType getRefundReasonType() { 32 | return refundReasonType; 33 | } 34 | 35 | public void setRefundReasonType(RefundReasonType refundReasonType) { 36 | this.refundReasonType = refundReasonType; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/ReportFilters.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.CurrencyIso; 5 | 6 | /** 7 | * Filter for report V2 (2025) 8 | */ 9 | public class ReportFilters extends Dto { 10 | @SerializedName("Currency") 11 | private CurrencyIso currency; 12 | 13 | @SerializedName("UserId") 14 | private String userId; 15 | 16 | @SerializedName("WalletId") 17 | private String walletId; 18 | 19 | public CurrencyIso getCurrency() { 20 | return currency; 21 | } 22 | 23 | public ReportFilters setCurrency(CurrencyIso currency) { 24 | this.currency = currency; 25 | return this; 26 | } 27 | 28 | public String getUserId() { 29 | return userId; 30 | } 31 | 32 | public ReportFilters setUserId(String userId) { 33 | this.userId = userId; 34 | return this; 35 | } 36 | 37 | public String getWalletId() { 38 | return walletId; 39 | } 40 | 41 | public ReportFilters setWalletId(String walletId) { 42 | this.walletId = walletId; 43 | return this; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/SecurityInfo.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.enumerations.AVSResult; 5 | 6 | public class SecurityInfo extends Dto { 7 | 8 | @SerializedName("AVSResult") 9 | private AVSResult avsResult; 10 | 11 | public AVSResult getAvsResult() { 12 | return avsResult; 13 | } 14 | 15 | public void setAvsResult(AVSResult avsResult) { 16 | this.avsResult = avsResult; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/Shipping.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Address; 5 | import com.mangopay.core.Dto; 6 | 7 | import java.lang.reflect.Type; 8 | import java.util.Map; 9 | 10 | public class Shipping extends Dto { 11 | 12 | /** 13 | * First Name 14 | */ 15 | @SerializedName("FirstName") 16 | private String firstName; 17 | 18 | /** 19 | * Last Name 20 | */ 21 | @SerializedName("LastName") 22 | private String lastName; 23 | 24 | /** 25 | * Address. 26 | */ 27 | @SerializedName("Address") 28 | private Address address; 29 | 30 | public Address getAddress() { 31 | return address; 32 | } 33 | 34 | public void setAddress(Address address) { 35 | this.address = address; 36 | } 37 | 38 | public String getFirstName() { 39 | return firstName; 40 | } 41 | 42 | public String getLastName() { 43 | return lastName; 44 | } 45 | 46 | public void setFirstName(String firstName) { 47 | this.firstName = firstName; 48 | } 49 | 50 | public void setLastName(String lastName) { 51 | this.lastName = lastName; 52 | } 53 | 54 | @Override 55 | public Map getSubObjects() { 56 | 57 | Map result = super.getSubObjects(); 58 | 59 | result.put("Address", Address.class); 60 | 61 | return result; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/ShippingAddress.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.lang.reflect.Type; 6 | import java.util.Map; 7 | 8 | /** 9 | * Models shipping details 10 | */ 11 | public class ShippingAddress extends Dto { 12 | 13 | /** 14 | * Name of the shipping recipient 15 | */ 16 | @SerializedName("RecipientName") 17 | private String recipientName; 18 | 19 | /** 20 | * The shipping address 21 | */ 22 | @SerializedName("Address") 23 | private Address address; 24 | 25 | public String getRecipientName() { 26 | return recipientName; 27 | } 28 | 29 | public void setRecipientName(String recipientName) { 30 | this.recipientName = recipientName; 31 | } 32 | 33 | public Address getAddress() { 34 | return address; 35 | } 36 | 37 | public void setAddress(Address address) { 38 | this.address = address; 39 | } 40 | 41 | @Override 42 | public Map getSubObjects() { 43 | Map subObjects = super.getSubObjects(); 44 | 45 | subObjects.put("Address", Address.class); 46 | 47 | return subObjects; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/Sorting.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.mangopay.core.enumerations.SortDirection; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * Base sorting object. 10 | */ 11 | public class Sorting { 12 | 13 | /** 14 | * Fields separator in sort parameters for URL query. 15 | */ 16 | private final String sortFieldSeparator = "_"; 17 | 18 | /** 19 | * Sort query parameter name. 20 | */ 21 | private final String sortUrlParameterName = "Sort"; 22 | 23 | /** 24 | * Collection of fields to sort by and sort directions. 25 | */ 26 | private Map sortFields; 27 | 28 | /** 29 | * Adds field to sort by. 30 | * 31 | * @param fieldName Property name to sort by. 32 | * @param sortDirection Sort direction. 33 | */ 34 | public void addField(String fieldName, SortDirection sortDirection) { 35 | if (sortFields == null) sortFields = new HashMap<>(); 36 | 37 | sortFields.put(fieldName, sortDirection); 38 | } 39 | 40 | /** 41 | * Gets sort parameters. 42 | * 43 | * @return 44 | */ 45 | public Map getSortParameter() { 46 | 47 | return new HashMap() {{ 48 | put(sortUrlParameterName, getFields()); 49 | }}; 50 | } 51 | 52 | public String getFields() { 53 | String sortValues = ""; 54 | for (Map.Entry entry : sortFields.entrySet()) { 55 | if (!sortValues.equals("")) 56 | sortValues += sortFieldSeparator; 57 | 58 | sortValues += entry.getKey() + ":" + entry.getValue(); 59 | } 60 | 61 | return sortValues; 62 | } 63 | } -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/deserializer/BankingAliasDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.deserializer; 2 | 3 | import com.google.gson.*; 4 | import com.mangopay.core.enumerations.BankingAliasType; 5 | import com.mangopay.entities.BankingAlias; 6 | import com.mangopay.entities.subentities.BankingAliasDetailsIBAN; 7 | 8 | import java.lang.reflect.Type; 9 | 10 | public class BankingAliasDeserializer implements JsonDeserializer { 11 | @Override 12 | public BankingAlias deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 13 | JsonObject jsonObject = json.getAsJsonObject(); 14 | BankingAlias bankingAlias = new Gson().fromJson(jsonObject.toString(), BankingAlias.class); 15 | BankingAliasType type = bankingAlias.getType(); 16 | switch (type){ 17 | case IBAN: 18 | BankingAliasDetailsIBAN bankingAliasDetailsIBAN = new BankingAliasDetailsIBAN(); 19 | bankingAliasDetailsIBAN.setBIC(jsonObject.get("BIC").getAsString()); 20 | bankingAliasDetailsIBAN.setIBAN(jsonObject.get("IBAN").getAsString()); 21 | bankingAlias.setDetails(bankingAliasDetailsIBAN); 22 | break; 23 | } 24 | return bankingAlias; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/deserializer/CardInfoTypeDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.deserializer; 2 | 3 | import com.google.gson.JsonDeserializationContext; 4 | import com.google.gson.JsonDeserializer; 5 | import com.google.gson.JsonElement; 6 | import com.google.gson.JsonParseException; 7 | import com.mangopay.core.enumerations.CardInfoType; 8 | 9 | import java.lang.reflect.Type; 10 | 11 | public class CardInfoTypeDeserializer implements JsonDeserializer { 12 | @Override 13 | public CardInfoType deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 14 | String value = json.getAsString(); 15 | if ("null".equals(value)) { 16 | return null; 17 | } 18 | if ("CHARGE CARD".equals(value)) { 19 | return CardInfoType.CHARGE_CARD; 20 | } 21 | return CardInfoType.valueOf(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/deserializer/TransferDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.deserializer; 2 | 3 | import com.google.gson.*; 4 | import com.mangopay.entities.Transfer; 5 | import com.mangopay.entities.subentities.PendingUserAction; 6 | 7 | import java.lang.reflect.Type; 8 | 9 | public class TransferDeserializer implements JsonDeserializer { 10 | @Override 11 | public Transfer deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 12 | JsonObject jsonObject = json.getAsJsonObject(); 13 | Transfer transfer = new Gson().fromJson(jsonObject.toString(), Transfer.class); 14 | if (jsonObject.has("DebitedWalletId") && !jsonObject.get("DebitedWalletId").isJsonNull()) 15 | transfer.setDebitedWalletId(jsonObject.get("DebitedWalletId").getAsString()); 16 | if (jsonObject.has("CreditedWalletId") && !jsonObject.get("CreditedWalletId").isJsonNull()) 17 | transfer.setCreditedWalletId(jsonObject.get("CreditedWalletId").getAsString()); 18 | if (jsonObject.has("ScaContext") && !jsonObject.get("ScaContext").isJsonNull()) 19 | transfer.setScaContext(jsonObject.get("ScaContext").getAsString()); 20 | if (jsonObject.has("PendingUserAction") && !jsonObject.get("PendingUserAction").isJsonNull()) 21 | transfer.setPendingUserAction((PendingUserAction) context.deserialize(jsonObject.get("PendingUserAction"), PendingUserAction.class)); 22 | return transfer; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/deserializer/UserDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.deserializer; 2 | 3 | import com.google.gson.*; 4 | import com.mangopay.core.enumerations.PersonType; 5 | import com.mangopay.entities.*; 6 | 7 | import java.lang.reflect.Type; 8 | 9 | public class UserDeserializer implements JsonDeserializer { 10 | @Override 11 | public User deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 12 | JsonObject jsonObject = json.getAsJsonObject(); 13 | PersonType type = PersonType.valueOf(jsonObject.get("PersonType").getAsString()); 14 | if (type.equals(PersonType.LEGAL)) { 15 | // if the json has SCA related properties -> deserialize to UserLegalSca 16 | // !!! THIS LOGIC SHOULD NOT BE CHANGED ON API SIDE !!! 17 | if (jsonObject.has("PendingUserAction")) { 18 | return context.deserialize(json, UserLegalSca.class); 19 | } 20 | return context.deserialize(json, UserLegal.class); 21 | } else if (type.equals(PersonType.NATURAL)) { 22 | // if the json has SCA related properties -> deserialize to UserNaturalSca 23 | // !!! THIS LOGIC SHOULD NOT BE CHANGED ON API SIDE !!! 24 | if (jsonObject.has("PendingUserAction")) { 25 | return context.deserialize(json, UserNaturalSca.class); 26 | } 27 | return context.deserialize(json, UserNatural.class); 28 | } else { 29 | throw new IllegalArgumentException("Invalid user JSON:" + json.getAsJsonObject().toString()); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/AVSResult.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | public enum AVSResult { 4 | 5 | FULL_MATCH, ADDRESS_MATCH_ONLY, POSTAL_CODE_MATCH_ONLY, NO_MATCH, NO_CHECK 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/BankAccountType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Bank account type enumeration. 5 | */ 6 | public enum BankAccountType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * IBAN bank account type. 14 | */ 15 | IBAN, 16 | 17 | /** 18 | * GB bank account type. 19 | */ 20 | GB, 21 | 22 | /** 23 | * US bank account type. 24 | */ 25 | US, 26 | 27 | /** 28 | * CA bank account type. 29 | */ 30 | CA, 31 | 32 | /** 33 | * OTHER bank account type. 34 | */ 35 | OTHER 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/BankingAliasType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Banking alias type enumeration. 5 | */ 6 | public enum BankingAliasType { 7 | 8 | /** 9 | * IBAN banking alias type. 10 | */ 11 | IBAN 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/BusinessType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Business type enumeration 5 | */ 6 | public enum BusinessType { 7 | 8 | /** 9 | * Marketplace business type 10 | */ 11 | MARKETPLACE, 12 | /** 13 | * Crowdfunding business type 14 | */ 15 | CROWDFUNDING, 16 | 17 | /** 18 | * Franchise business type 19 | */ 20 | FRANCHISE, 21 | 22 | /** 23 | * Other business type 24 | */ 25 | OTHER 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/CardInfoType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | public enum CardInfoType { 4 | DEBIT, 5 | CREDIT, 6 | CHARGE_CARD 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/CardType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Card type enumeration. 5 | */ 6 | public enum CardType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * CB VISA MASTERCARD card type. 14 | */ 15 | CB_VISA_MASTERCARD, 16 | 17 | /** 18 | * AMEX card type. 19 | */ 20 | AMEX, 21 | 22 | /** 23 | * DINERS card type. 24 | */ 25 | DINERS, 26 | 27 | /** 28 | * MASTERPASS card type. 29 | */ 30 | MASTERPASS, 31 | 32 | /** 33 | * MAESTRO card type. 34 | */ 35 | MAESTRO, 36 | 37 | /** 38 | * P24 (Przelewy24) card type. 39 | */ 40 | P24, 41 | 42 | /** 43 | * IDEAL card type. 44 | */ 45 | IDEAL, 46 | 47 | /** 48 | * BCMC card type. 49 | */ 50 | BCMC 51 | , 52 | 53 | /** 54 | * PAYLIB card type. 55 | */ 56 | PAYLIB 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/CultureCode.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Culture codes enumeration. 5 | */ 6 | public enum CultureCode { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | DE, 13 | EN, 14 | DA, 15 | ES, 16 | ET, 17 | FI, 18 | FR, 19 | EL, 20 | HU, 21 | IT, 22 | NL, 23 | NO, 24 | PL, 25 | PT, 26 | SK, 27 | SV, 28 | CS, 29 | 30 | /* 31 | * Temporary values to be removed in the future 32 | */ 33 | de, 34 | en, 35 | da, 36 | es, 37 | et, 38 | fi, 39 | fr, 40 | el, 41 | hu, 42 | it, 43 | nl, 44 | no, 45 | pl, 46 | pt, 47 | sk, 48 | sv, 49 | cs 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DeclaredUboStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Enumeration of possible statuses of a declared UBO. 5 | */ 6 | public enum DeclaredUboStatus { 7 | 8 | /** 9 | * When declaration of a UBO was created 10 | */ 11 | CREATED, 12 | 13 | /** 14 | * When declaration of a UBO was validated 15 | */ 16 | VALIDATED, 17 | 18 | /** 19 | * When declaration of a UBO was refused 20 | */ 21 | REFUSED 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DepositAccountType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Deposit account type enumeration. 5 | */ 6 | public enum DepositAccountType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * CHECKING deposit account type. 14 | */ 15 | CHECKING, 16 | 17 | /** 18 | * SAVINGS deposit account type. 19 | */ 20 | SAVINGS 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DepositStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Business type enumeration 5 | */ 6 | public enum DepositStatus { 7 | CREATED, 8 | 9 | SUCCEEDED, 10 | 11 | FAILED 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DirectDebitType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Direct debit type enumeration. 5 | */ 6 | public enum DirectDebitType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * SOFORT direct debit type. 14 | */ 15 | SOFORT, 16 | 17 | /** 18 | * ELV direct debit type. 19 | */ 20 | ELV, 21 | 22 | /** 23 | * GIROPAY direct debit type. 24 | */ 25 | GIROPAY 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DisputeDocumentStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Dispute document status enumeration. 5 | */ 6 | public enum DisputeDocumentStatus { 7 | 8 | /** 9 | * CREATED dispute document status. 10 | */ 11 | CREATED, 12 | 13 | /** 14 | * VALIDATION_ASKED dispute document status. 15 | */ 16 | VALIDATION_ASKED, 17 | 18 | /** 19 | * VALIDATED dispute document status. 20 | */ 21 | VALIDATED, 22 | 23 | /** 24 | * REFUSED dispute document status. 25 | */ 26 | REFUSED 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DisputeDocumentType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Dispute document type enumeration. 5 | */ 6 | public enum DisputeDocumentType { 7 | 8 | /** 9 | * DELIVERY_PROOF dispute document type. 10 | */ 11 | DELIVERY_PROOF, 12 | 13 | /** 14 | * INVOICE dispute document type. 15 | */ 16 | INVOICE, 17 | 18 | /** 19 | * REFUND_PROOF dispute document type. 20 | */ 21 | REFUND_PROOF, 22 | 23 | /** 24 | * USER_CORRESPONDANCE dispute document type. 25 | */ 26 | USER_CORRESPONDANCE, 27 | 28 | /** 29 | * USER_ACCEPTANCE_PROOF dispute document type. 30 | */ 31 | USER_ACCEPTANCE_PROOF, 32 | 33 | /** 34 | * PRODUCT_REPLACEMENT_PROOF dispute document type. 35 | */ 36 | PRODUCT_REPLACEMENT_PROOF, 37 | 38 | /** 39 | * OTHER dispute document type. 40 | */ 41 | OTHER 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DisputeStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Dispute status enumeration. 5 | */ 6 | public enum DisputeStatus { 7 | 8 | /** 9 | * CREATED dispute status. 10 | */ 11 | CREATED, 12 | 13 | /** 14 | * PENDING_CLIENT_ACTION dispute status. 15 | */ 16 | PENDING_CLIENT_ACTION, 17 | 18 | /** 19 | * SUBMITTED dispute status. 20 | */ 21 | SUBMITTED, 22 | 23 | /** 24 | * PENDING_BANK_ACTION dispute status. 25 | */ 26 | PENDING_BANK_ACTION, 27 | 28 | /** 29 | * REOPENED_PENDING_CLIENT_ACTION dispute status. 30 | */ 31 | REOPENED_PENDING_CLIENT_ACTION, 32 | 33 | /** 34 | * CLOSED dispute status. 35 | */ 36 | CLOSED 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DisputeType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Dispute types enumeration. 5 | */ 6 | public enum DisputeType { 7 | 8 | /** 9 | * CONTESTABLE dispute type. 10 | */ 11 | CONTESTABLE, 12 | 13 | /** 14 | * NOT_CONTESTABLE dispute type. 15 | */ 16 | NOT_CONTESTABLE, 17 | 18 | /** 19 | * RETRIEVAL dispute type. 20 | */ 21 | RETRIEVAL 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/DownloadReportFormat.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Format of downloaded report. 5 | */ 6 | public enum DownloadReportFormat { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * Comma-separated values. 15 | */ 16 | CSV 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/FundsType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Funds type enumeration. 5 | */ 6 | public enum FundsType { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * Default type. 15 | */ 16 | DEFAULT, 17 | 18 | /** 19 | * Fees type. 20 | */ 21 | FEES, 22 | 23 | /** 24 | * Credit type. 25 | */ 26 | CREDIT 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/HookStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Hook status enumeration. 5 | */ 6 | public enum HookStatus { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /* 13 | * DISABLED hook status. 14 | */ 15 | DISABLED, 16 | 17 | /* 18 | * ENABLED hook status. 19 | */ 20 | ENABLED 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/InitialTransactionType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Initial transaction type enumeration. 5 | */ 6 | public enum InitialTransactionType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * PAYIN transaction type. 14 | */ 15 | PAYIN, 16 | 17 | /** 18 | * TRANSFER transaction type. 19 | */ 20 | TRANSFER, 21 | 22 | /** 23 | * PAYOUT transaction type. 24 | */ 25 | PAYOUT 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/KycDocumentType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * KYC document type enumeration. 5 | */ 6 | public enum KycDocumentType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * Only for natural users. ID of the individual duly empowered to act on 14 | * behalf of the legal entity. 15 | */ 16 | IDENTITY_PROOF, 17 | 18 | /** 19 | * Only for legal users. Extract from the relevant register of commerce 20 | * issued within the last three months. 21 | */ 22 | REGISTRATION_PROOF, 23 | 24 | /** 25 | * Only for legal users. It’s the Statute. Formal memorandum stated by 26 | * the entrepreuneurs, in which the following information is mentioned: 27 | * business name, activity, registered address, shareholding. 28 | */ 29 | ARTICLES_OF_ASSOCIATION, 30 | 31 | /** 32 | * Only for legal users (business company). 33 | */ 34 | SHAREHOLDER_DECLARATION, 35 | 36 | /** 37 | * Only for natural users. 38 | */ 39 | ADDRESS_PROOF 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/KycLevel.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * KYC document level enumeration. 5 | */ 6 | public enum KycLevel { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * LIGHT KYC level. 14 | */ 15 | LIGHT, 16 | 17 | /** 18 | * REGULAR KYC level. 19 | */ 20 | REGULAR 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/KycStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * KYC document status enumeration. 5 | */ 6 | public enum KycStatus { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * CREATED KYC status. 14 | */ 15 | CREATED, 16 | 17 | /** 18 | * VALIDATION ASKED KYC status. 19 | */ 20 | VALIDATION_ASKED, 21 | 22 | /** 23 | * VALIDATED KYC status. 24 | */ 25 | VALIDATED, 26 | 27 | /** 28 | * REFUSED KYC status. 29 | */ 30 | REFUSED, 31 | 32 | /** 33 | * OUT_OF_DATE kyc status 34 | */ 35 | OUT_OF_DATE 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/LegalPersonType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Legal person type enumeration. 5 | */ 6 | public enum LegalPersonType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * BUSINESS legal person type. 14 | */ 15 | BUSINESS, 16 | 17 | /** 18 | * ORGANIZATION legal person type. 19 | */ 20 | ORGANIZATION, 21 | 22 | /** 23 | * SOLETRADER legal person type. 24 | */ 25 | SOLETRADER, 26 | 27 | /** 28 | * PARTNERSHIP legal person type. 29 | */ 30 | PARTNERSHIP 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/MandateExecutionType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Mandate execution type. 5 | */ 6 | public enum MandateExecutionType { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * Web execution type. 15 | */ 16 | WEB 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/MandateScheme.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Scheme of mandate. 5 | */ 6 | public enum MandateScheme { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * SEPA scheme. 15 | */ 16 | SEPA, 17 | 18 | /** 19 | * BACS scheme. 20 | */ 21 | BACS 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/MandateStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Status of mandate. 5 | */ 6 | public enum MandateStatus { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * The mandate has been created. 15 | */ 16 | CREATED, 17 | 18 | /** 19 | * The mandate has been submitted to the banks and you can now do payments with this mandate. 20 | */ 21 | SUBMITTED, 22 | 23 | /** 24 | * The mandate is active and has been accepted by the banks and/or successfully used in a payment. 25 | */ 26 | ACTIVE, 27 | 28 | /** 29 | * The mandate has failed for a variety of reasons and is no longer available for payments. 30 | */ 31 | FAILED, 32 | 33 | /** 34 | * The mandate has expired and cannot be used anymore for Payins. A new mandate has to be created. 35 | */ 36 | EXPIRED 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/MandateType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Type of mandate. 5 | */ 6 | public enum MandateType { 7 | 8 | /** 9 | * Nor specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * Direct debit type. 15 | */ 16 | DIRECT_DEBIT 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/NaturalUserCapacity.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Enumeration that differentiates natural users. 5 | */ 6 | public enum NaturalUserCapacity { 7 | 8 | /** 9 | * Real customer. 10 | */ 11 | NORMAL, 12 | 13 | /** 14 | * User used only for declaration purpose. 15 | */ 16 | DECLARATIVE 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PayInExecutionType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Execution type enumeration. 5 | */ 6 | public enum PayInExecutionType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * WEB execution type. 14 | */ 15 | WEB, 16 | 17 | /** 18 | * DIRECT execution type. 19 | */ 20 | DIRECT, 21 | 22 | /** 23 | * PREAUTHORIZED execution type. 24 | */ 25 | PREAUTHORIZED, 26 | 27 | /** 28 | * EXTERNAL INSTRUCTION execution type. 29 | */ 30 | EXTERNAL_INSTRUCTION 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PayInReferences.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | public class PayInReferences { 4 | 5 | private String type; 6 | 7 | private String value; 8 | 9 | public PayInReferences(String type, String value) { 10 | this.type = type; 11 | this.value = value; 12 | } 13 | 14 | public String getType() { 15 | return type; 16 | } 17 | 18 | public String getValue() { 19 | return value; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PayOutPaymentType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Payment type enumeration. 5 | */ 6 | public enum PayOutPaymentType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * BANK WIRE payment type. 14 | */ 15 | BANK_WIRE, 16 | 17 | /** 18 | * MERCHANT EXPENSE payment type. 19 | */ 20 | MERCHANT_EXPENSE, 21 | 22 | /** 23 | * AMAZON GIFTCARD payment type. 24 | */ 25 | AMAZON_GIFTCARD 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PaymentStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Payment status enumeration. 5 | */ 6 | public enum PaymentStatus { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * WAITING payment status. 14 | */ 15 | WAITING, 16 | 17 | /** 18 | * CANCELED payment status. 19 | */ 20 | CANCELED, 21 | 22 | /** 23 | * EXPIRED payment status. 24 | */ 25 | EXPIRED, 26 | 27 | /** 28 | * VALIDATED payment status. 29 | */ 30 | VALIDATED, 31 | 32 | /** 33 | * CANCEL_REQUESTED payment status (deposits) 34 | */ 35 | CANCEL_REQUESTED, 36 | 37 | /** 38 | * TO_BE_COMPLETED payment status (deposits) 39 | */ 40 | TO_BE_COMPLETED, 41 | 42 | /** 43 | * NO_SHOW_REQUESTED payment status (deposits) 44 | */ 45 | NO_SHOW_REQUESTED, 46 | 47 | /** 48 | * NO_SHOW payment status (deposits) 49 | */ 50 | NO_SHOW, 51 | 52 | /** 53 | * FAILED payment status (deposits) 54 | */ 55 | FAILED 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PayoutMode.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | public enum PayoutMode { 4 | STANDARD, 5 | INSTANT_PAYMENT, 6 | INSTANT_PAYMENT_ONLY, 7 | RTGS_PAYMENT 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PersonType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Person type enumeration. 5 | */ 6 | public enum PersonType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * NATURAL user type. 14 | */ 15 | NATURAL, 16 | 17 | /** 18 | * LEGAL user type. 19 | */ 20 | LEGAL 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PreAuthorizationExecutionType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Pre-authorization execution type enumeration. 5 | */ 6 | public enum PreAuthorizationExecutionType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * CARD execution type. 14 | */ 15 | CARD, 16 | 17 | /** 18 | * DIRECT execution type. 19 | */ 20 | DIRECT 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/PreAuthorizationStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * PreAuthorization status enumeration. 5 | */ 6 | public enum PreAuthorizationStatus { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * CREATED preauthorization status. 14 | */ 15 | CREATED, 16 | 17 | /** 18 | * SUCCEEDED preauthorization status. 19 | */ 20 | SUCCEEDED, 21 | 22 | /** 23 | * FAILED preauthorization status. 24 | */ 25 | FAILED 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/RecurringPayInRegistrationPaymentType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Payment type enumeration. 5 | */ 6 | public enum RecurringPayInRegistrationPaymentType { 7 | CARD_DIRECT, 8 | PAYPAL 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/RefundReasonType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Refund reason type enumeration. 5 | */ 6 | public enum RefundReasonType { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * Incorrect bank account. 15 | */ 16 | BANKACCOUNT_INCORRECT, 17 | 18 | /** 19 | * Closed bank account. 20 | */ 21 | BANKACCOUNT_HAS_BEEN_CLOSED, 22 | 23 | /** 24 | * Owner-bank account mismatch. 25 | */ 26 | OWNER_DOT_NOT_MATCH_BANKACCOUNT, 27 | 28 | /** 29 | * Withdrawal impossible on savings accounts. 30 | */ 31 | WITHDRAWAL_IMPOSSIBLE_ON_SAVINGS_ACCOUNTS, 32 | 33 | /** 34 | * Initialized by client. 35 | */ 36 | INITIALIZED_BY_CLIENT, 37 | 38 | /** 39 | * Initialized by Mangopay. 40 | */ 41 | INITIALIZED_BY_MANGOPAY, 42 | 43 | AG01_FORBIDDEN_TRANSACTION, 44 | 45 | AC06_BLOCKED_BANKACCOUNT, 46 | 47 | AG02_INVALID_BANK_OPERATION, 48 | 49 | AM05_DUPLICATE_PAYMENT, 50 | 51 | BE04_BENEFICIARY_ADDRESS_MISSING, 52 | 53 | CNOR_INVALID_BIC, 54 | 55 | ERIN_REMITTANCE_INFO_NOT_SUPPORTED, 56 | 57 | MD07_BENEFICIARY_IS_DECEASED, 58 | 59 | MS02_BENEFICIARY_ORDER, 60 | 61 | MS03_NOT_SPECIFIED, 62 | 63 | RC01_INVALIDE_BIC, 64 | 65 | RR01_REGULATORY_REASON, 66 | 67 | RR02_REGULATORY_REASON, 68 | 69 | RR03_BENEFICIARY_NAME_OR_ADDRESS_MISSING, 70 | 71 | RR04_REGULATORY_REASON, 72 | 73 | ED05_SETTLEMENT_FAILED, 74 | 75 | FF01_INVALID_FILE_FORMAT, 76 | 77 | TM01_CUT_OFF_TIME, 78 | 79 | DNOR_DEBTOR_BANK_NOT_REGISTERED, 80 | 81 | FOCR_RECALLED, 82 | 83 | CB, 84 | 85 | /** 86 | * Other. 87 | */ 88 | OTHER 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/ReportStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Status of a report. 5 | */ 6 | public enum ReportStatus { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * Report is pending. 15 | */ 16 | PENDING, 17 | 18 | /** 19 | * Report has expired. 20 | */ 21 | EXPIRED, 22 | 23 | /** 24 | * Report creation failed. 25 | */ 26 | FAILED, 27 | 28 | /** 29 | * Report is ready to download. 30 | */ 31 | READY_FOR_DOWNLOAD 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/ReportType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Report type enumeration. 5 | */ 6 | public enum ReportType { 7 | 8 | /** 9 | * Not specified. 10 | */ 11 | NotSpecified, 12 | 13 | /** 14 | * Transactions type. 15 | */ 16 | TRANSACTIONS, 17 | 18 | /** 19 | * Wallets type. 20 | */ 21 | WALLETS 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/RequestType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Request type enumeration. 5 | */ 6 | public enum RequestType { 7 | GET, 8 | POST, 9 | PUT, 10 | DELETE 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/Sector.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Sector enumeration 5 | */ 6 | public enum Sector { 7 | 8 | RENTALS, 9 | STORES_FASHION_ACCESSORIES_OBJECTS, 10 | BEAUTY_COSMETICS_HEALTH, 11 | FOOD_WINE_RESTAURANTS, 12 | HOSPITALITY_TRAVEL_CORIDING, 13 | ART_MUSIC_ENTERTAINMENT, 14 | FURNITURE_GARDEN, 15 | SERVICES_JOBBING_EDUCATION, 16 | SPORT_RECREATION_ACTIVITIES, 17 | TICKETING 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/SecureMode.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Secure mode enumeration. 5 | */ 6 | public enum SecureMode { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * Secured Mode is activated from €100. 14 | */ 15 | DEFAULT, 16 | 17 | /** 18 | * Secured Mode is activated for any transaction's amount. 19 | */ 20 | FORCE, 21 | 22 | /** 23 | * Secured Mode has no choice. 24 | */ 25 | NO_CHOICE 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/ShippingPreference.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | public enum ShippingPreference { 4 | SET_PROVIDED_ADDRESS, 5 | GET_FROM_FILE, 6 | NO_SHIPPING 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/SortDirection.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | 4 | /** 5 | * Sort direction enumeration. 6 | */ 7 | public enum SortDirection { 8 | 9 | none, 10 | asc, 11 | desc 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/TransactionNature.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Transaction nature enumeration. 5 | */ 6 | public enum TransactionNature { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * REGULAR transaction nature. 14 | */ 15 | REGULAR, 16 | 17 | /** 18 | * REFUND transaction nature. 19 | */ 20 | REFUND, 21 | 22 | /** 23 | * REPUDIATION transaction nature. 24 | */ 25 | REPUDIATION, 26 | 27 | /** 28 | * SETTLEMENT transaction nature. 29 | */ 30 | SETTLEMENT 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/TransactionStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Transaction status enumeration. 5 | */ 6 | public enum TransactionStatus { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * CREATED transaction status. 14 | */ 15 | CREATED, 16 | 17 | /** 18 | * SUCCEEDED transaction status. 19 | */ 20 | SUCCEEDED, 21 | 22 | /** 23 | * FAILED transaction status. 24 | */ 25 | FAILED 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/TransactionType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Transaction type enumeration. 5 | */ 6 | public enum TransactionType { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * PAYIN transaction type. 14 | */ 15 | PAYIN, 16 | 17 | /** 18 | * PAYOUT transaction type. 19 | */ 20 | PAYOUT, 21 | 22 | /** 23 | * TRANSFER transaction type. 24 | */ 25 | TRANSFER, 26 | 27 | /** 28 | * CONVERSION transaction type. 29 | */ 30 | CONVERSION, 31 | 32 | /** 33 | * CARD_VALIDATION transaction type. 34 | */ 35 | CARD_VALIDATION 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/UboDeclarationRefusedReasonType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Enumeration of reasons why a UBO declaration could be refused. 5 | */ 6 | public enum UboDeclarationRefusedReasonType { 7 | 8 | /** 9 | * When at least one natural user is missing on the declaration 10 | */ 11 | MISSING_UBO, 12 | 13 | /** 14 | * When at least one natural user should not be declared as UBO 15 | */ 16 | DECLARATION_DO_NOT_MATCH_UBO_INFORMATION, 17 | 18 | /** 19 | * When at least one natural user declared as UBO has been created 20 | * with wrong details (i.e. date of birth, country of residence) 21 | */ 22 | INVALID_UBO_DETAILS 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/UboDeclarationStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * UBO declaration status enumeration. 5 | */ 6 | public enum UboDeclarationStatus { 7 | 8 | /** 9 | * When the UBO declaration was created 10 | */ 11 | CREATED, 12 | 13 | /** 14 | * When validation has been requested for the UBO declaration 15 | */ 16 | VALIDATION_ASKED, 17 | 18 | /** 19 | * When the UBO declaration was validated 20 | */ 21 | VALIDATED, 22 | 23 | /** 24 | * When the UBO declaration was refused 25 | */ 26 | REFUSED, 27 | 28 | /** 29 | * When the UBO declaration was incomplete 30 | */ 31 | INCOMPLETE 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/UboRefusedReasonType.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Enumerated reasons why declaration of a user as UBO was refused. 5 | */ 6 | public enum UboRefusedReasonType { 7 | 8 | /** 9 | * When user should not be declared as UBO 10 | */ 11 | INVALID_DECLARED_UBO, 12 | 13 | /** 14 | * User declared as UBO was created with wrong 15 | * details (i.e. date of birth, country of residence). 16 | */ 17 | INVALID_UBO_DETAILS 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/UserCategory.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | public enum UserCategory { 4 | PAYER, 5 | OWNER 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/enumerations/Validity.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.enumerations; 2 | 3 | /** 4 | * Validity enumeration. 5 | */ 6 | public enum Validity { 7 | /** 8 | * Not specified. 9 | */ 10 | NotSpecified, 11 | 12 | /** 13 | * UNKNOWN validity. 14 | */ 15 | UNKNOWN, 16 | 17 | /** 18 | * VALID validity. 19 | */ 20 | VALID, 21 | 22 | /** 23 | * INVALID validity. 24 | */ 25 | INVALID 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/interfaces/BankAccountDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.interfaces; 2 | 3 | /** 4 | * Marker interface for classes with bank account details. 5 | */ 6 | public interface BankAccountDetails { } 7 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/interfaces/BankingAliasDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.interfaces; 2 | 3 | /** 4 | * Marker interface for classes containing banking alias details. 5 | */ 6 | public interface BankingAliasDetails { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/interfaces/PayInExecutionDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.interfaces; 2 | 3 | /** 4 | * Marker interface for classes with details of execution option in PayIn entity. 5 | */ 6 | public interface PayInExecutionDetails { } 7 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/interfaces/PayInPaymentDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.interfaces; 2 | 3 | /** 4 | * Marker interface for classes with details of means of payment in PayIn entity. 5 | */ 6 | public interface PayInPaymentDetails { } 7 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/interfaces/PayInTransactionDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.interfaces; 2 | 3 | /** 4 | * Marker interface for classes with transaction details 5 | * Currently needed only by BankWire 6 | */ 7 | public interface PayInTransactionDetails { } 8 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/interfaces/PayOutPaymentDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.interfaces; 2 | 3 | /** 4 | * Marker interface for classes with details of means of payment in PayOut entity. 5 | */ 6 | public interface PayOutPaymentDetails { } 7 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/interfaces/StorageStrategy.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.interfaces; 2 | 3 | import com.mangopay.core.OAuthToken; 4 | 5 | /** 6 | * Storage strategy interface. 7 | */ 8 | public interface StorageStrategy { 9 | 10 | OAuthToken get(String envKey); 11 | 12 | void store(OAuthToken token, String envKey); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/serializer/CardInfoTypeSerializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.serializer; 2 | 3 | import com.google.gson.*; 4 | import com.mangopay.core.enumerations.CardInfoType; 5 | 6 | import java.lang.reflect.Type; 7 | 8 | public class CardInfoTypeSerializer implements JsonSerializer { 9 | @Override 10 | public JsonElement serialize(CardInfoType src, Type typeOfSrc, JsonSerializationContext context) { 11 | if (src == null) { 12 | return JsonNull.INSTANCE; 13 | } 14 | if (src == CardInfoType.CHARGE_CARD) { 15 | return new JsonPrimitive("CHARGE CARD"); 16 | } 17 | return new JsonPrimitive(src.name()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/serializer/CreateConversionQuoteSerializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.serializer; 2 | 3 | import com.google.gson.*; 4 | import com.mangopay.core.Money; 5 | import com.mangopay.entities.CreateConversionQuote; 6 | 7 | import java.lang.reflect.Type; 8 | 9 | public class CreateConversionQuoteSerializer implements JsonSerializer { 10 | 11 | /** 12 | * For creating a Conversion Quote, the Money.Amount fields needs to be sent as NULL in some cases 13 | */ 14 | @Override 15 | public JsonElement serialize(CreateConversionQuote src, Type typeOfSrc, JsonSerializationContext context) { 16 | JsonObject object = new Gson().toJsonTree(src, typeOfSrc).getAsJsonObject(); 17 | 18 | Money debitedFunds = src.getDebitedFunds(); 19 | Money creditedFunds = src.getCreditedFunds(); 20 | 21 | if (debitedFunds != null && creditedFunds != null) { 22 | // as per API docs: the DebitedFunds.Amount is required if CreditedFunds.Amount is null 23 | if (debitedFunds.getAmount() == 0 && creditedFunds.getAmount() != 0) { 24 | JsonObject debitedFundsObj = object.getAsJsonObject("DebitedFunds"); 25 | debitedFundsObj.addProperty("Amount", (String) null); 26 | object.add("DebitedFunds", debitedFundsObj); 27 | } 28 | 29 | // as per API docs: the CreditedFunds.Amount is required if DebitedFunds.Amount is null 30 | if (debitedFunds.getAmount() != 0 && creditedFunds.getAmount() == 0) { 31 | JsonObject creditedFundsObj = object.getAsJsonObject("CreditedFunds"); 32 | creditedFundsObj.addProperty("Amount", (String) null); 33 | object.add("CreditedFunds", creditedFundsObj); 34 | } 35 | } 36 | 37 | return object; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/serializer/PayOutSerializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.serializer; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonObject; 5 | import com.google.gson.JsonSerializationContext; 6 | import com.google.gson.JsonSerializer; 7 | import com.mangopay.entities.PayOut; 8 | import com.mangopay.entities.subentities.PayOutPaymentDetailsBankWire; 9 | 10 | import java.lang.reflect.Type; 11 | 12 | public class PayOutSerializer implements JsonSerializer { 13 | @Override 14 | public JsonElement serialize(PayOut src, Type typeOfSrc, JsonSerializationContext context) { 15 | JsonObject object = SerializedTransaction.getTransactionObject(src, context); 16 | object.add("DebitedWalletId", context.serialize(src.getDebitedWalletId())); 17 | object.add("PaymentType", context.serialize(src.getPaymentType())); 18 | switch (src.getMeanOfPaymentDetails().getClass().getSimpleName()) { 19 | case "PayOutPaymentDetailsBankWire": 20 | object.add("BankAccountId", context.serialize(((PayOutPaymentDetailsBankWire) src.getMeanOfPaymentDetails()).getBankAccountId())); 21 | object.add("BankWireRef", context.serialize(((PayOutPaymentDetailsBankWire) src.getMeanOfPaymentDetails()).getBankWireRef())); 22 | object.add("PayoutModeRequested", context.serialize(((PayOutPaymentDetailsBankWire) src.getMeanOfPaymentDetails()).getPayoutModeRequested())); 23 | return object; 24 | default: 25 | return null; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/serializer/SerializedTransaction.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.serializer; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonSerializationContext; 5 | import com.mangopay.entities.Transaction; 6 | 7 | class SerializedTransaction { 8 | 9 | static JsonObject getTransactionObject(Transaction source, JsonSerializationContext context) { 10 | JsonObject object = new JsonObject(); 11 | object.add("Id", context.serialize(source.getId())); 12 | object.add("Tag", context.serialize(source.getTag())); 13 | object.add("CreationDate", context.serialize(source.getCreationDate())); 14 | 15 | object.add("AuthorId", context.serialize(source.getAuthorId())); 16 | object.add("CreditedUserId", context.serialize(source.getCreditedUserId())); 17 | object.add("DebitedFunds", context.serialize(source.getDebitedFunds())); 18 | object.add("CreditedFunds", context.serialize(source.getCreditedFunds())); 19 | object.add("Fees", context.serialize(source.getFees())); 20 | object.add("Status", context.serialize(source.getStatus())); 21 | object.add("ResultCode", context.serialize(source.getResultCode())); 22 | object.add("ResultMessage", context.serialize(source.getResultMessage())); 23 | object.add("ExecutionDate", context.serialize(source.getExecutionDate())); 24 | object.add("Type", context.serialize(source.getType())); 25 | object.add("Nature", context.serialize(source.getNature())); 26 | object.add("DepositId", context.serialize(source.getDepositId())); 27 | 28 | return object; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/core/serializer/TransferSerializer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core.serializer; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonObject; 5 | import com.google.gson.JsonSerializationContext; 6 | import com.google.gson.JsonSerializer; 7 | import com.mangopay.entities.Transfer; 8 | 9 | import java.lang.reflect.Type; 10 | 11 | public class TransferSerializer implements JsonSerializer { 12 | @Override 13 | public JsonElement serialize(Transfer src, Type typeOfSrc, JsonSerializationContext context) { 14 | JsonObject object = SerializedTransaction.getTransactionObject(src, context); 15 | object.add("DebitedWalletId", context.serialize(src.getDebitedWalletId())); 16 | object.add("CreditedWalletId", context.serialize(src.getCreditedWalletId())); 17 | object.add("ScaContext", context.serialize(src.getScaContext())); 18 | return object; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/BinData.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class BinData { 6 | 7 | /** 8 | * The subtype of the card product. Examples include: CLASSIC, GOLD, PLATINUM, PREPAID, etc. 9 | */ 10 | @SerializedName("Subtype") 11 | private String subtype; 12 | 13 | /** 14 | * The card brand. Examples include: AMERICAN EXPRESS, DISCOVER, JCB, MASTERCARD, VISA, etc. 15 | */ 16 | @SerializedName("Brand") 17 | private String brand; 18 | 19 | /** 20 | * Whether the card is held in a personal or commercial capacity. 21 | */ 22 | @SerializedName("CommercialIndicator") 23 | private String commercialIndicator; 24 | 25 | /** 26 | * The type of the card. Allowed / Returned / Default values: CREDIT, DEBIT, CHARGE CARD 27 | */ 28 | @SerializedName("CardType") 29 | private String cardType; 30 | 31 | public String getSubtype() { 32 | return subtype; 33 | } 34 | 35 | public void setSubtype(String subtype) { 36 | this.subtype = subtype; 37 | } 38 | 39 | public String getBrand() { 40 | return brand; 41 | } 42 | 43 | public void setBrand(String brand) { 44 | this.brand = brand; 45 | } 46 | 47 | public String getCommercialIndicator() { 48 | return commercialIndicator; 49 | } 50 | 51 | public BinData setCommercialIndicator(String commercialIndicator) { 52 | this.commercialIndicator = commercialIndicator; 53 | return this; 54 | } 55 | 56 | public String getCardType() { 57 | return cardType; 58 | } 59 | 60 | public BinData setCardType(String cardType) { 61 | this.cardType = cardType; 62 | return this; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/Birthplace.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.enumerations.CountryIso; 6 | 7 | public class Birthplace extends Dto { 8 | 9 | /** 10 | * City. 11 | */ 12 | @SerializedName("City") 13 | private String city; 14 | 15 | /** 16 | * Country. 17 | */ 18 | @SerializedName("Country") 19 | private CountryIso country; 20 | 21 | public Birthplace() { 22 | } 23 | 24 | public Birthplace(String city, CountryIso country) { 25 | this.city=city; 26 | this.country=country; 27 | } 28 | 29 | public String getCity() { return city; } 30 | 31 | public void setCity(String city) { this.city = city; } 32 | 33 | public CountryIso getCountry() { return country; } 34 | 35 | public void setCountry(CountryIso country) { this.country = country; } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/ClientBankWireDirect.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.core.Money; 6 | 7 | /** 8 | * Client bankwire direct entity. 9 | */ 10 | public class ClientBankWireDirect extends EntityBase { 11 | 12 | /** 13 | * Declared debited funds. 14 | */ 15 | @SerializedName("DeclaredDebitedFunds") 16 | private Money declaredDebitedFunds; 17 | 18 | /** 19 | * Credited wallet alias. 20 | */ 21 | @SerializedName("CreditedWalletId") 22 | private String creditedWalletId; 23 | 24 | public ClientBankWireDirect(String creditedWalletAlias, Money declaredDebitedFunds) { 25 | this.creditedWalletId = creditedWalletAlias; 26 | this.declaredDebitedFunds = declaredDebitedFunds; 27 | } 28 | 29 | public Money getDeclaredDebitedFunds() { 30 | return declaredDebitedFunds; 31 | } 32 | 33 | public void setDeclaredDebitedFunds(Money declaredDebitedFunds) { 34 | this.declaredDebitedFunds = declaredDebitedFunds; 35 | } 36 | 37 | public String getCreditedWalletId() { 38 | return creditedWalletId; 39 | } 40 | 41 | public void setCreditedWalletId(String creditedWalletId) { 42 | this.creditedWalletId = creditedWalletId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/ClientLogo.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | /** 7 | * Client logo container. 8 | */ 9 | public class ClientLogo extends EntityBase { 10 | 11 | /** 12 | * File content. 13 | */ 14 | @SerializedName("File") 15 | private String file; 16 | 17 | public String getFile() { 18 | return file; 19 | } 20 | 21 | public void setFile(String file) { 22 | this.file = file; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/ConversionQuote.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.core.Money; 6 | 7 | public class ConversionQuote extends EntityBase { 8 | 9 | @SerializedName("ExpirationDate") 10 | private int expirationDate; 11 | @SerializedName("Status") 12 | private String status; 13 | @SerializedName("Duration") 14 | private int duration; 15 | @SerializedName("DebitedFunds") 16 | private Money debitedFunds; 17 | @SerializedName("CreditedFunds") 18 | private Money creditedFunds; 19 | @SerializedName("ConversionRateResponse") 20 | private ConversionRate conversionRateResponse; 21 | 22 | public int getExpirationDate() { 23 | return expirationDate; 24 | } 25 | 26 | public void setExpirationDate(int expirationDate) { 27 | this.expirationDate = expirationDate; 28 | } 29 | 30 | public String getStatus() { 31 | return status; 32 | } 33 | 34 | public void setStatus(String status) { 35 | this.status = status; 36 | } 37 | 38 | public int getDuration() { 39 | return duration; 40 | } 41 | 42 | public void setDuration(int duration) { 43 | this.duration = duration; 44 | } 45 | 46 | public Money getDebitedFunds() { 47 | return debitedFunds; 48 | } 49 | 50 | public void setDebitedFunds(Money debitedFunds) { 51 | this.debitedFunds = debitedFunds; 52 | } 53 | 54 | public Money getCreditedFunds() { 55 | return creditedFunds; 56 | } 57 | 58 | public void setCreditedFunds(Money creditedFunds) { 59 | this.creditedFunds = creditedFunds; 60 | } 61 | 62 | public ConversionRate getConversionRateResponse() { 63 | return conversionRateResponse; 64 | } 65 | 66 | public void setConversionRateResponse(ConversionRate conversionRateResponse) { 67 | this.conversionRateResponse = conversionRateResponse; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/CountryAuthorization.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.enumerations.CountryIso; 6 | import com.mangopay.entities.subentities.CountryAuthorizationData; 7 | 8 | public class CountryAuthorization extends Dto { 9 | @SerializedName("CountryCode") 10 | private CountryIso countryCode; 11 | 12 | @SerializedName("CountryName") 13 | private String countryName; 14 | 15 | @SerializedName("Authorization") 16 | private CountryAuthorizationData authorization; 17 | 18 | @SerializedName("LastUpdate") 19 | private Long lastUpdate; 20 | 21 | public CountryIso getCountryCode() { 22 | return countryCode; 23 | } 24 | 25 | public CountryAuthorization setCountryCode(CountryIso countryCode) { 26 | this.countryCode = countryCode; 27 | return this; 28 | } 29 | 30 | public String getCountryName() { 31 | return countryName; 32 | } 33 | 34 | public CountryAuthorization setCountryName(String countryName) { 35 | this.countryName = countryName; 36 | return this; 37 | } 38 | 39 | public CountryAuthorizationData getAuthorization() { 40 | return authorization; 41 | } 42 | 43 | public CountryAuthorization setAuthorization(CountryAuthorizationData authorization) { 44 | this.authorization = authorization; 45 | return this; 46 | } 47 | 48 | public Long getLastUpdate() { 49 | return lastUpdate; 50 | } 51 | 52 | public CountryAuthorization setLastUpdate(Long lastUpdate) { 53 | this.lastUpdate = lastUpdate; 54 | return this; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/CreateConversionQuote.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.Money; 6 | 7 | public class CreateConversionQuote extends Dto { 8 | @SerializedName("Duration") 9 | private int duration; 10 | @SerializedName("DebitedFunds") 11 | private Money debitedFunds; 12 | @SerializedName("CreditedFunds") 13 | private Money creditedFunds; 14 | @SerializedName("Tag") 15 | private String tag; 16 | 17 | public int getDuration() { 18 | return duration; 19 | } 20 | 21 | public void setDuration(int duration) { 22 | this.duration = duration; 23 | } 24 | 25 | public Money getDebitedFunds() { 26 | return debitedFunds; 27 | } 28 | 29 | public void setDebitedFunds(Money debitedFunds) { 30 | this.debitedFunds = debitedFunds; 31 | } 32 | 33 | public Money getCreditedFunds() { 34 | return creditedFunds; 35 | } 36 | 37 | public void setCreditedFunds(Money creditedFunds) { 38 | this.creditedFunds = creditedFunds; 39 | } 40 | 41 | public String getTag() { 42 | return tag; 43 | } 44 | 45 | public void setTag(String tag) { 46 | this.tag = tag; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/CreateQuotedConversion.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class CreateQuotedConversion extends Dto { 7 | 8 | /** 9 | * The unique identifier of the active quote which guaranteed the rate for the conversion. 10 | */ 11 | @SerializedName("QuoteId") 12 | private String quoteId; 13 | 14 | /** 15 | * The unique identifier of the user at the source of the transaction. 16 | */ 17 | @SerializedName("AuthorId") 18 | public String authorId; 19 | 20 | /** 21 | * The unique identifier of the debited wallet. 22 | */ 23 | @SerializedName("DebitedWalletId") 24 | public String debitedWalletId; 25 | 26 | /** 27 | * The unique identifier of the credited wallet 28 | */ 29 | @SerializedName("CreditedWalletId") 30 | public String creditedWalletId; 31 | 32 | /** 33 | * Custom data. 34 | */ 35 | @SerializedName("Tag") 36 | private String tag; 37 | 38 | public String getQuoteId() { 39 | return quoteId; 40 | } 41 | 42 | public void setQuoteId(String quoteId) { 43 | this.quoteId = quoteId; 44 | } 45 | 46 | public String getAuthorId() { 47 | return authorId; 48 | } 49 | 50 | public void setAuthorId(String authorId) { 51 | this.authorId = authorId; 52 | } 53 | 54 | public String getDebitedWalletId() { 55 | return debitedWalletId; 56 | } 57 | 58 | public void setDebitedWalletId(String debitedWalletId) { 59 | this.debitedWalletId = debitedWalletId; 60 | } 61 | 62 | public String getCreditedWalletId() { 63 | return creditedWalletId; 64 | } 65 | 66 | public void setCreditedWalletId(String creditedWalletId) { 67 | this.creditedWalletId = creditedWalletId; 68 | } 69 | 70 | public String getTag() { 71 | return tag; 72 | } 73 | 74 | public void setTag(String tag) { 75 | this.tag = tag; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/CurrentState.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.Money; 6 | 7 | import java.lang.reflect.Type; 8 | import java.util.Map; 9 | 10 | public class CurrentState extends Dto { 11 | 12 | @SerializedName("PayinsLinked ") 13 | private int payinsLinked; 14 | 15 | @SerializedName("CumulatedDebitedAmount") 16 | private Money cumulatedDebitedAmount; 17 | 18 | @SerializedName("CumulatedFeesAmount") 19 | private Money cumulatedFeesAmount; 20 | 21 | @SerializedName("LastPayinId") 22 | private String lastPayinId; 23 | 24 | public int getPayinsLinked() { 25 | return payinsLinked; 26 | } 27 | 28 | public Money getCumulatedDebitedAmount() { 29 | return cumulatedDebitedAmount; 30 | } 31 | 32 | public Money getCumulatedFeesAmount() { 33 | return cumulatedFeesAmount; 34 | } 35 | 36 | public String getLastPayinId() { 37 | return lastPayinId; 38 | } 39 | 40 | @Override 41 | public Map getSubObjects() { 42 | Map result = super.getSubObjects(); 43 | 44 | result.put("Money", Money.class); 45 | 46 | return result; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/DisputePage.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | /** 7 | * Dispute page entity. 8 | */ 9 | public class DisputePage extends EntityBase { 10 | 11 | /** 12 | * File content. 13 | */ 14 | @SerializedName("File") 15 | private String file; 16 | 17 | public String getFile() { 18 | return file; 19 | } 20 | 21 | public void setFile(String file) { 22 | this.file = file; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/EMoney.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.core.Money; 6 | 7 | import java.lang.reflect.Type; 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | /** 12 | * Model of a user's e-money entity. 13 | */ 14 | public class EMoney extends EntityBase { 15 | 16 | /** 17 | * The object owner's UserId 18 | */ 19 | @SerializedName("UserId") 20 | private String userId; 21 | 22 | /** 23 | * The amount of money that has been credited to this user 24 | */ 25 | @SerializedName("CreditedEMoney") 26 | private Money creditedEMoney; 27 | 28 | /** 29 | * The amount of money that has been debited from this user 30 | */ 31 | @SerializedName("DebitedEMoney") 32 | private Money debitedEMoney; 33 | 34 | public String getUserId() { 35 | return userId; 36 | } 37 | 38 | public void setUserId(String userId) { 39 | this.userId = userId; 40 | } 41 | 42 | public Money getCreditedEMoney() { 43 | return creditedEMoney; 44 | } 45 | 46 | public void setCreditedEMoney(Money creditedEMoney) { 47 | this.creditedEMoney = creditedEMoney; 48 | } 49 | 50 | public Money getDebitedEMoney() { 51 | return debitedEMoney; 52 | } 53 | 54 | public void setDebitedEMoney(Money debitedEMoney) { 55 | this.debitedEMoney = debitedEMoney; 56 | } 57 | 58 | /** 59 | * Gets map which property is an object and what type of object. 60 | * 61 | * @return Collection of field name-field type pairs. 62 | */ 63 | @Override 64 | public Map getSubObjects() { 65 | HashMap result = new HashMap<>(); 66 | 67 | result.put("DebitedEMoney", Money.class); 68 | result.put("CreditedEMoney", Money.class); 69 | 70 | return result; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/Event.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.core.enumerations.EventType; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * Event entity. 11 | */ 12 | public class Event extends EntityBase { 13 | 14 | /** 15 | * Resource identifier. 16 | */ 17 | @SerializedName("ResourceId") 18 | private String resourceId; 19 | 20 | /** 21 | * Type of event. 22 | */ 23 | @SerializedName("EventType") 24 | private EventType eventType; 25 | 26 | /** 27 | * Date as UNIX timestamp. 28 | */ 29 | @SerializedName("Date") 30 | private long date; 31 | 32 | public String getResourceId() { 33 | return resourceId; 34 | } 35 | 36 | public void setResourceId(String resourceId) { 37 | this.resourceId = resourceId; 38 | } 39 | 40 | public EventType getEventType() { 41 | return eventType; 42 | } 43 | 44 | public void setEventType(EventType eventType) { 45 | this.eventType = eventType; 46 | } 47 | 48 | public long getDate() { 49 | return date; 50 | } 51 | 52 | public void setDate(long date) { 53 | this.date = date; 54 | } 55 | 56 | /** 57 | * Gets the collection of read-only fields names. 58 | * 59 | * @return List of field names. 60 | */ 61 | @Override 62 | public ArrayList getReadOnlyProperties() { 63 | 64 | ArrayList result = super.getReadOnlyProperties(); 65 | 66 | result.add("ResourceId"); 67 | result.add("EventType"); 68 | result.add("Date"); 69 | 70 | return result; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/Hook.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.core.enumerations.EventType; 6 | import com.mangopay.core.enumerations.HookStatus; 7 | import com.mangopay.core.enumerations.Validity; 8 | 9 | /** 10 | * Hooks and Notifications entity. 11 | */ 12 | public class Hook extends EntityBase { 13 | 14 | /** 15 | * This is the URL where you receive notification for various event types. 16 | */ 17 | @SerializedName("Url") 18 | private String url; 19 | 20 | /** 21 | * Hook status. 22 | */ 23 | @SerializedName("Status") 24 | private HookStatus status; 25 | 26 | /** 27 | * Hook validity. 28 | */ 29 | @SerializedName("Validity") 30 | private Validity validity; 31 | 32 | /** 33 | * Event type (the EventType.ALL value is forbidden here). 34 | */ 35 | @SerializedName("EventType") 36 | private EventType eventType; 37 | 38 | public String getUrl() { 39 | return url; 40 | } 41 | 42 | public void setUrl(String url) { 43 | this.url = url; 44 | } 45 | 46 | public HookStatus getStatus() { 47 | return status; 48 | } 49 | 50 | public void setStatus(HookStatus status) { 51 | this.status = status; 52 | } 53 | 54 | public Validity getValidity() { 55 | return validity; 56 | } 57 | 58 | public void setValidity(Validity validity) { 59 | this.validity = validity; 60 | } 61 | 62 | public EventType getEventType() { 63 | return eventType; 64 | } 65 | 66 | public void setEventType(EventType eventType) { 67 | this.eventType = eventType; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/IdempotencyResponse.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | /** 7 | * IdempotencyResponse entity. 8 | */ 9 | public class IdempotencyResponse extends EntityBase { 10 | 11 | @SerializedName("StatusCode") 12 | private String statusCode; 13 | 14 | @SerializedName("ContentLength") 15 | private String contentLength; 16 | 17 | @SerializedName("ContentType") 18 | private String contentType; 19 | 20 | @SerializedName("Date") 21 | private String date; 22 | 23 | @SerializedName("Resource") 24 | private Object resource; 25 | 26 | @SerializedName("RequestURL") 27 | private String requestUrl; 28 | 29 | public String getStatusCode() { 30 | return statusCode; 31 | } 32 | 33 | public void setStatusCode(String statusCode) { 34 | this.statusCode = statusCode; 35 | } 36 | 37 | public String getContentLength() { 38 | return contentLength; 39 | } 40 | 41 | public void setContentLength(String contentLength) { 42 | this.contentLength = contentLength; 43 | } 44 | 45 | public String getContentType() { 46 | return contentType; 47 | } 48 | 49 | public void setContentType(String contentType) { 50 | this.contentType = contentType; 51 | } 52 | 53 | public String getDate() { 54 | return date; 55 | } 56 | 57 | public void setDate(String date) { 58 | this.date = date; 59 | } 60 | 61 | public Object getResource() { 62 | return resource; 63 | } 64 | 65 | public void setResource(Object resource) { 66 | this.resource = resource; 67 | } 68 | 69 | public String getRequestUrl() { 70 | return requestUrl; 71 | } 72 | 73 | public void setRequestUrl(String requestUrl) { 74 | this.requestUrl = requestUrl; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/KycPage.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | /** 7 | * KYC page entity. 8 | */ 9 | public class KycPage extends EntityBase { 10 | 11 | /** 12 | * File content. 13 | */ 14 | @SerializedName("File") 15 | private String file; 16 | 17 | public String getFile() { 18 | return file; 19 | } 20 | 21 | public void setFile(String file) { 22 | this.file = file; 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/PayOutEligibilityResult.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.entities.subentities.InstantPayout; 6 | 7 | public class PayOutEligibilityResult extends Dto { 8 | @SerializedName("InstantPayout") 9 | private InstantPayout instantPayout; 10 | 11 | public InstantPayout getInstantPayout() { 12 | return instantPayout; 13 | } 14 | 15 | public void setInstantPayout(InstantPayout instantPayout) { 16 | this.instantPayout = instantPayout; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/RecurringPayIn.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class RecurringPayIn extends PayIn { 6 | 7 | @SerializedName("RecurringPayinRegistrationId") 8 | private String recurringPayinRegistrationId; 9 | 10 | public String getRecurringPayinRegistrationId() { 11 | return recurringPayinRegistrationId; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/RecurringPayInMIT.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.Money; 6 | 7 | import java.lang.reflect.Type; 8 | import java.util.Map; 9 | 10 | public class RecurringPayInMIT extends Dto { 11 | 12 | @SerializedName("RecurringPayinRegistrationId") 13 | private String recurringPayInRegistrationId; 14 | 15 | @SerializedName("DebitedFunds") 16 | private Money debitedFunds; 17 | 18 | @SerializedName("Fees") 19 | private Money fees; 20 | 21 | @SerializedName("StatementDescriptor") 22 | private String statementDescriptor; 23 | 24 | @SerializedName("Tag") 25 | private String tag; 26 | 27 | public String getRecurringPayInRegistrationId() { 28 | return recurringPayInRegistrationId; 29 | } 30 | 31 | public void setRecurringPayInRegistrationId(String recurringPayInRegistrationId) { 32 | this.recurringPayInRegistrationId = recurringPayInRegistrationId; 33 | } 34 | 35 | public String getStatementDescriptor() { 36 | return statementDescriptor; 37 | } 38 | 39 | public void setStatementDescriptor(String statementDescriptor) { 40 | this.statementDescriptor = statementDescriptor; 41 | } 42 | 43 | public String getTag() { 44 | return tag; 45 | } 46 | 47 | public void setTag(String tag) { 48 | this.tag = tag; 49 | } 50 | 51 | public Money getDebitedFunds() { return debitedFunds; } 52 | 53 | public void setDebitedFunds(Money debitedFunds) { this.debitedFunds = debitedFunds; } 54 | 55 | public Money getFees() { return fees; } 56 | 57 | public void setFees(Money fees) { this.fees = fees; } 58 | 59 | @Override 60 | public Map getSubObjects() { 61 | 62 | Map result = super.getSubObjects(); 63 | 64 | result.put("Money", Money.class); 65 | 66 | return result; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/RecurringPayment.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Money; 5 | 6 | public class RecurringPayment extends CreateRecurringPayment { 7 | @SerializedName("Id") 8 | private String id; 9 | 10 | @SerializedName("Status") 11 | private String status; 12 | 13 | @SerializedName("TotalAmount") 14 | private Money totalAmount; 15 | 16 | @SerializedName("CycleNumber") 17 | private Integer cycleNumber; 18 | 19 | public String getId() { 20 | return id; 21 | } 22 | 23 | public String getStatus() { 24 | return status; 25 | } 26 | 27 | public Money getTotalAmount() { 28 | return totalAmount; 29 | } 30 | 31 | public int getCycleNumber() { 32 | return cycleNumber; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/RecurringPaymentExtended.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.lang.reflect.Type; 6 | import java.util.Map; 7 | 8 | public class RecurringPaymentExtended extends RecurringPayment { 9 | 10 | @SerializedName("CurrentState") 11 | private CurrentState currentState; 12 | 13 | public CurrentState getCurrentState() { 14 | return currentState; 15 | } 16 | 17 | @Override 18 | public Map getSubObjects() { 19 | Map result = super.getSubObjects(); 20 | 21 | result.put("CurrentState", CurrentState.class); 22 | 23 | return result; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/RecurringPaymentUpdate.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Billing; 5 | import com.mangopay.core.Dto; 6 | import com.mangopay.core.EntityBase; 7 | import com.mangopay.core.Shipping; 8 | 9 | import java.lang.reflect.Type; 10 | import java.util.Map; 11 | 12 | public class RecurringPaymentUpdate extends EntityBase { 13 | @SerializedName("CardId") 14 | private String cardId; 15 | 16 | @SerializedName("Billing") 17 | private Billing billing; 18 | 19 | @SerializedName("Shipping") 20 | private Shipping shipping; 21 | 22 | @SerializedName("Status") 23 | private String status; 24 | 25 | public String getCardId() { 26 | return cardId; 27 | } 28 | 29 | public void setCardId(String cardId) { 30 | this.cardId = cardId; 31 | } 32 | 33 | public Billing getBilling() { 34 | return billing; 35 | } 36 | 37 | public void setBilling(Billing billing) { 38 | this.billing = billing; 39 | } 40 | 41 | public Shipping getShipping() { 42 | return shipping; 43 | } 44 | 45 | public void setShipping(Shipping shipping) { 46 | this.shipping = shipping; 47 | } 48 | 49 | public String getStatus() { return status; } 50 | 51 | public void setStatus(String status) { this.status = status; } 52 | 53 | @Override 54 | public Map getSubObjects() { 55 | Map result = super.getSubObjects(); 56 | 57 | result.put("Shipping", Shipping.class); 58 | result.put("Billing", Billing.class); 59 | 60 | return result; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/SettlementTransfer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Settlement transfer entity. 7 | */ 8 | public class SettlementTransfer extends Transfer { 9 | 10 | /** 11 | * The repudiation id of the settlement 12 | */ 13 | @SerializedName("RepudiationId") 14 | private String repudiationId; 15 | 16 | public String getRepudiationId() { 17 | return repudiationId; 18 | } 19 | 20 | public void setRepudiationId(String repudiationId) { 21 | this.repudiationId = repudiationId; 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/Transfer.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.entities.subentities.PendingUserAction; 5 | 6 | /** 7 | * Transfer entity. 8 | */ 9 | public class Transfer extends Transaction { 10 | 11 | /** 12 | * Debited wallet identifier. 13 | */ 14 | @SerializedName("DebitedWalletId") 15 | private String debitedWalletId; 16 | 17 | /** 18 | * Credited wallet identifier. 19 | */ 20 | @SerializedName("CreditedWalletId") 21 | private String creditedWalletId; 22 | 23 | @SerializedName("ScaContext") 24 | private String scaContext; 25 | 26 | @SerializedName("PendingUserAction") 27 | private PendingUserAction pendingUserAction; 28 | 29 | public String getDebitedWalletId() { 30 | return debitedWalletId; 31 | } 32 | 33 | public void setDebitedWalletId(String debitedWalletId) { 34 | this.debitedWalletId = debitedWalletId; 35 | } 36 | 37 | public String getCreditedWalletId() { 38 | return creditedWalletId; 39 | } 40 | 41 | public void setCreditedWalletId(String creditedWalletId) { 42 | this.creditedWalletId = creditedWalletId; 43 | } 44 | 45 | public PendingUserAction getPendingUserAction() { 46 | return pendingUserAction; 47 | } 48 | 49 | public Transfer setPendingUserAction(PendingUserAction pendingUserAction) { 50 | this.pendingUserAction = pendingUserAction; 51 | return this; 52 | } 53 | 54 | public String getScaContext() { 55 | return scaContext; 56 | } 57 | 58 | public Transfer setScaContext(String scaContext) { 59 | this.scaContext = scaContext; 60 | return this; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/UserBlockStatus.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.entities.subentities.ScopeBlocked; 6 | 7 | public class UserBlockStatus extends EntityBase { 8 | @SerializedName("ScopeBlocked") 9 | private ScopeBlocked scopeBlocked; 10 | 11 | @SerializedName("ActionCode") 12 | private String actionCode; 13 | 14 | public ScopeBlocked getScopeBlocked() { 15 | return scopeBlocked; 16 | } 17 | 18 | public UserBlockStatus setScopeBlocked(ScopeBlocked scopeBlocked) { 19 | this.scopeBlocked = scopeBlocked; 20 | return this; 21 | } 22 | 23 | public String getActionCode() { 24 | return actionCode; 25 | } 26 | 27 | public UserBlockStatus setActionCode(String actionCode) { 28 | this.actionCode = actionCode; 29 | return this; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BankAccountDetailsCA.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.BankAccountDetails; 6 | 7 | /** 8 | * Class represents CA type of bank account. 9 | */ 10 | public class BankAccountDetailsCA extends Dto implements BankAccountDetails { 11 | 12 | /** 13 | * Bank name. 14 | */ 15 | @SerializedName("BankName") 16 | private String bankName; 17 | 18 | /** 19 | * Institution number. 20 | */ 21 | @SerializedName("InstitutionNumber") 22 | private String institutionNumber; 23 | 24 | /** 25 | * Branch code. 26 | */ 27 | @SerializedName("BranchCode") 28 | private String branchCode; 29 | 30 | /** 31 | * Account number. 32 | */ 33 | @SerializedName("AccountNumber") 34 | private String accountNumber; 35 | 36 | public String getBankName() { 37 | return bankName; 38 | } 39 | 40 | public void setBankName(String bankName) { 41 | this.bankName = bankName; 42 | } 43 | 44 | public String getInstitutionNumber() { 45 | return institutionNumber; 46 | } 47 | 48 | public void setInstitutionNumber(String institutionNumber) { 49 | this.institutionNumber = institutionNumber; 50 | } 51 | 52 | public String getBranchCode() { 53 | return branchCode; 54 | } 55 | 56 | public void setBranchCode(String branchCode) { 57 | this.branchCode = branchCode; 58 | } 59 | 60 | public String getAccountNumber() { 61 | return accountNumber; 62 | } 63 | 64 | public void setAccountNumber(String accountNumber) { 65 | this.accountNumber = accountNumber; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BankAccountDetailsGB.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.BankAccountDetails; 6 | 7 | /** 8 | * Class represents GB type of bank account. 9 | */ 10 | public class BankAccountDetailsGB extends Dto implements BankAccountDetails { 11 | 12 | /** 13 | * Account number. 14 | */ 15 | @SerializedName("AccountNumber") 16 | private String accountNumber; 17 | 18 | /** 19 | * Sort code. 20 | */ 21 | @SerializedName("SortCode") 22 | private String sortCode; 23 | 24 | public String getAccountNumber() { 25 | return accountNumber; 26 | } 27 | 28 | public void setAccountNumber(String accountNumber) { 29 | this.accountNumber = accountNumber; 30 | } 31 | 32 | public String getSortCode() { 33 | return sortCode; 34 | } 35 | 36 | public void setSortCode(String sortCode) { 37 | this.sortCode = sortCode; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BankAccountDetailsIBAN.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.BankAccountDetails; 6 | 7 | /** 8 | * Class represents IBAN type of bank account. 9 | */ 10 | public class BankAccountDetailsIBAN extends Dto implements BankAccountDetails { 11 | 12 | /** 13 | * IBAN number. 14 | */ 15 | @SerializedName("IBAN") 16 | private String iban; 17 | 18 | /** 19 | * BIC. 20 | */ 21 | @SerializedName("BIC") 22 | private String bic; 23 | 24 | public String getIban() { 25 | return iban; 26 | } 27 | 28 | public void setIban(String iban) { 29 | this.iban = iban; 30 | } 31 | 32 | public String getBic() { 33 | return bic; 34 | } 35 | 36 | public void setBic(String bic) { 37 | this.bic = bic; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BankAccountDetailsOTHER.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.enumerations.CountryIso; 6 | import com.mangopay.core.interfaces.BankAccountDetails; 7 | 8 | /** 9 | * Class represents OTHER type of bank account. 10 | */ 11 | public class BankAccountDetailsOTHER extends Dto implements BankAccountDetails { 12 | 13 | /** 14 | * Type. 15 | */ 16 | //public String Type; 17 | 18 | /** 19 | * The Country associated to the BankAccount. 20 | */ 21 | @SerializedName("Country") 22 | private CountryIso country; 23 | 24 | /** 25 | * Valid BIC format. 26 | */ 27 | @SerializedName("BIC") 28 | private String bic; 29 | 30 | /** 31 | * Account number. 32 | */ 33 | @SerializedName("AccountNumber") 34 | private String accountNumber; 35 | 36 | public CountryIso getCountry() { 37 | return country; 38 | } 39 | 40 | public void setCountry(CountryIso country) { 41 | this.country = country; 42 | } 43 | 44 | public String getBic() { 45 | return bic; 46 | } 47 | 48 | public void setBic(String bic) { 49 | this.bic = bic; 50 | } 51 | 52 | public String getAccountNumber() { 53 | return accountNumber; 54 | } 55 | 56 | public void setAccountNumber(String accountNumber) { 57 | this.accountNumber = accountNumber; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BankAccountDetailsUS.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.enumerations.DepositAccountType; 6 | import com.mangopay.core.interfaces.BankAccountDetails; 7 | 8 | import static com.mangopay.core.enumerations.DepositAccountType.CHECKING; 9 | 10 | /** 11 | * Class represents US type of bank account. 12 | */ 13 | public class BankAccountDetailsUS extends Dto implements BankAccountDetails { 14 | 15 | /** 16 | * Account number. 17 | */ 18 | @SerializedName("AccountNumber") 19 | private String accountNumber; 20 | 21 | /** 22 | * ABA. 23 | */ 24 | @SerializedName("ABA") 25 | private String aba; 26 | 27 | /** 28 | * Deposit account type. 29 | */ 30 | @SerializedName("DepositAccountType") 31 | private DepositAccountType depositAccountType; 32 | 33 | /** 34 | * Instantiates new BankAccountDetailsUS object. 35 | */ 36 | public BankAccountDetailsUS() { 37 | this.depositAccountType = CHECKING; 38 | } 39 | 40 | public String getAccountNumber() { 41 | return accountNumber; 42 | } 43 | 44 | public void setAccountNumber(String accountNumber) { 45 | this.accountNumber = accountNumber; 46 | } 47 | 48 | public String getAba() { 49 | return aba; 50 | } 51 | 52 | public void setAba(String aba) { 53 | this.aba = aba; 54 | } 55 | 56 | public com.mangopay.core.enumerations.DepositAccountType getDepositAccountType() { 57 | return depositAccountType; 58 | } 59 | 60 | public void setDepositAccountType(com.mangopay.core.enumerations.DepositAccountType depositAccountType) { 61 | this.depositAccountType = depositAccountType; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BankingAliasDetailsIBAN.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.mangopay.core.Dto; 4 | import com.mangopay.core.interfaces.BankingAliasDetails; 5 | 6 | /** 7 | * Created by thepa on 08-Feb-17. 8 | */ 9 | public class BankingAliasDetailsIBAN extends Dto implements BankingAliasDetails { 10 | 11 | /** 12 | * The IBAN of the banking alias. 13 | */ 14 | public String IBAN; 15 | /** 16 | * The BIC of the banking alias. 17 | */ 18 | public String BIC; 19 | 20 | public String getIBAN() { 21 | return IBAN; 22 | } 23 | 24 | public void setIBAN(String IBAN) { 25 | this.IBAN = IBAN; 26 | } 27 | 28 | public String getBIC() { 29 | return BIC; 30 | } 31 | 32 | public void setBIC(String BIC) { 33 | this.BIC = BIC; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BusinessRecipient.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Address; 5 | import com.mangopay.core.Dto; 6 | 7 | public class BusinessRecipient extends Dto { 8 | /** 9 | * The name of the business 10 | */ 11 | @SerializedName("BusinessName") 12 | private String businessName; 13 | 14 | /** 15 | * Contains the business address details 16 | */ 17 | @SerializedName("Address") 18 | private Address address; 19 | 20 | public String getBusinessName() { 21 | return businessName; 22 | } 23 | 24 | public BusinessRecipient setBusinessName(String businessName) { 25 | this.businessName = businessName; 26 | return this; 27 | } 28 | 29 | public Address getAddress() { 30 | return address; 31 | } 32 | 33 | public BusinessRecipient setAddress(Address address) { 34 | this.address = address; 35 | return this; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/BusinessRecipientPropertySchema.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class BusinessRecipientPropertySchema extends Dto { 7 | @SerializedName("BusinessName") 8 | private RecipientPropertySchema businessName; 9 | 10 | @SerializedName("Address") 11 | private RecipientAddressPropertySchema address; 12 | 13 | public RecipientPropertySchema getBusinessName() { 14 | return businessName; 15 | } 16 | 17 | public BusinessRecipientPropertySchema setBusinessName(RecipientPropertySchema businessName) { 18 | this.businessName = businessName; 19 | return this; 20 | } 21 | 22 | public RecipientAddressPropertySchema getAddress() { 23 | return address; 24 | } 25 | 26 | public BusinessRecipientPropertySchema setAddress(RecipientAddressPropertySchema address) { 27 | this.address = address; 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/CountryAuthorizationData.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class CountryAuthorizationData extends Dto { 7 | @SerializedName("BlockUserCreation") 8 | private Boolean blockUserCreation; 9 | 10 | @SerializedName("BlockBankAccountCreation") 11 | private Boolean blockBankAccountCreation; 12 | 13 | @SerializedName("BlockPayout") 14 | private Boolean blockPayout; 15 | 16 | public Boolean getBlockUserCreation() { 17 | return blockUserCreation; 18 | } 19 | 20 | public CountryAuthorizationData setBlockUserCreation(Boolean blockUserCreation) { 21 | this.blockUserCreation = blockUserCreation; 22 | return this; 23 | } 24 | 25 | public Boolean getBlockBankAccountCreation() { 26 | return blockBankAccountCreation; 27 | } 28 | 29 | public CountryAuthorizationData setBlockBankAccountCreation(Boolean blockBankAccountCreation) { 30 | this.blockBankAccountCreation = blockBankAccountCreation; 31 | return this; 32 | } 33 | 34 | public Boolean getBlockPayout() { 35 | return blockPayout; 36 | } 37 | 38 | public CountryAuthorizationData setBlockPayout(Boolean blockPayout) { 39 | this.blockPayout = blockPayout; 40 | return this; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/FallbackReason.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class FallbackReason { 6 | @SerializedName("Code") 7 | private String code; 8 | 9 | @SerializedName("Message") 10 | private String message; 11 | 12 | public String getCode() { 13 | return code; 14 | } 15 | 16 | public FallbackReason setCode(String code) { 17 | this.code = code; 18 | return this; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public FallbackReason setMessage(String message) { 26 | this.message = message; 27 | return this; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/IndividualRecipient.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Address; 5 | import com.mangopay.core.Dto; 6 | 7 | public class IndividualRecipient extends Dto { 8 | /** 9 | * The first name of the individual recipient. 10 | */ 11 | @SerializedName("FirstName") 12 | private String firstName; 13 | 14 | /** 15 | * The last name of the individual recipient. 16 | */ 17 | @SerializedName("LastName") 18 | private String lastName; 19 | 20 | /** 21 | * The address of the individual recipient. 22 | */ 23 | @SerializedName("Address") 24 | private Address address; 25 | 26 | public String getFirstName() { 27 | return firstName; 28 | } 29 | 30 | public IndividualRecipient setFirstName(String firstName) { 31 | this.firstName = firstName; 32 | return this; 33 | } 34 | 35 | public String getLastName() { 36 | return lastName; 37 | } 38 | 39 | public IndividualRecipient setLastName(String lastName) { 40 | this.lastName = lastName; 41 | return this; 42 | } 43 | 44 | public Address getAddress() { 45 | return address; 46 | } 47 | 48 | public IndividualRecipient setAddress(Address address) { 49 | this.address = address; 50 | return this; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/IndividualRecipientPropertySchema.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class IndividualRecipientPropertySchema extends Dto { 7 | @SerializedName("FirstName") 8 | private RecipientPropertySchema firstName; 9 | 10 | @SerializedName("LastName") 11 | private RecipientPropertySchema lastName; 12 | 13 | @SerializedName("Address") 14 | private RecipientAddressPropertySchema address; 15 | 16 | public RecipientPropertySchema getFirstName() { 17 | return firstName; 18 | } 19 | 20 | public IndividualRecipientPropertySchema setFirstName(RecipientPropertySchema firstName) { 21 | this.firstName = firstName; 22 | return this; 23 | } 24 | 25 | public RecipientPropertySchema getLastName() { 26 | return lastName; 27 | } 28 | 29 | public IndividualRecipientPropertySchema setLastName(RecipientPropertySchema lastName) { 30 | this.lastName = lastName; 31 | return this; 32 | } 33 | 34 | public RecipientAddressPropertySchema getAddress() { 35 | return address; 36 | } 37 | 38 | public IndividualRecipientPropertySchema setAddress(RecipientAddressPropertySchema address) { 39 | this.address = address; 40 | return this; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/InstantPayout.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class InstantPayout { 6 | 7 | @SerializedName("IsReachable") 8 | private boolean isReachable; 9 | 10 | @SerializedName("UnreachableReason") 11 | private FallbackReason unreachableReason; 12 | 13 | public boolean isReachable() { 14 | return isReachable; 15 | } 16 | 17 | public void setReachable(boolean reachable) { 18 | isReachable = reachable; 19 | } 20 | 21 | public FallbackReason getUnreachableReason() { 22 | return unreachableReason; 23 | } 24 | 25 | public void setUnreachableReason(FallbackReason unreachableReason) { 26 | this.unreachableReason = unreachableReason; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/InternationalAccount.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class InternationalAccount extends Dto { 7 | 8 | @SerializedName("IBAN") 9 | private String iban; 10 | 11 | @SerializedName("BIC") 12 | private String bic; 13 | 14 | public InternationalAccount(String iban, String bic) { 15 | this.iban = iban; 16 | this.bic = bic; 17 | } 18 | 19 | 20 | public String getIban() { 21 | return iban; 22 | } 23 | 24 | public InternationalAccount setIban(String iban) { 25 | this.iban = iban; 26 | return this; 27 | } 28 | 29 | public String getBic() { 30 | return bic; 31 | } 32 | 33 | public InternationalAccount setBic(String bic) { 34 | this.bic = bic; 35 | return this; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/InternationalAccountDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class InternationalAccountDetails extends Dto { 7 | 8 | @SerializedName("Address") 9 | private VirtualAccountAddress address; 10 | 11 | @SerializedName("Account") 12 | private InternationalAccount account; 13 | 14 | public InternationalAccountDetails(VirtualAccountAddress address, InternationalAccount account) { 15 | this.address = address; 16 | this.account = account; 17 | } 18 | 19 | public VirtualAccountAddress getAddress() { 20 | return address; 21 | } 22 | 23 | public InternationalAccountDetails setAddress(VirtualAccountAddress address) { 24 | this.address = address; 25 | return this; 26 | } 27 | 28 | public InternationalAccount getAccount() { 29 | return account; 30 | } 31 | 32 | public InternationalAccountDetails setAccount(InternationalAccount account) { 33 | this.account = account; 34 | return this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/LocalAccount.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | public class LocalAccount extends EntityBase { 7 | 8 | @SerializedName("AccountNumber") 9 | private String accountNumber; 10 | 11 | @SerializedName("SortCode") 12 | private String sortCode; 13 | 14 | public String getAccountNumber() { 15 | return accountNumber; 16 | } 17 | 18 | public LocalAccount setAccountNumber(String accountNumber) { 19 | this.accountNumber = accountNumber; 20 | return this; 21 | } 22 | 23 | public String getSortCode() { 24 | return sortCode; 25 | } 26 | 27 | public LocalAccount setSortCode(String sortCode) { 28 | this.sortCode = sortCode; 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/LocalAccountDetails.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class LocalAccountDetails extends Dto { 7 | 8 | @SerializedName("Address") 9 | private VirtualAccountAddress address; 10 | 11 | @SerializedName("Account") 12 | private LocalAccount account; 13 | 14 | public LocalAccountDetails(VirtualAccountAddress address, LocalAccount account) { 15 | this.address = address; 16 | this.account = account; 17 | } 18 | 19 | public VirtualAccountAddress getAddress() { 20 | return address; 21 | } 22 | 23 | public LocalAccountDetails setAddress(VirtualAccountAddress address) { 24 | this.address = address; 25 | return this; 26 | } 27 | 28 | 29 | public LocalAccount getAccount() { 30 | return account; 31 | } 32 | 33 | public LocalAccountDetails setAccount(LocalAccount account) { 34 | this.account = account; 35 | return this; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsApplePay.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | import java.lang.reflect.Type; 8 | import java.util.Map; 9 | 10 | public class PayInPaymentDetailsApplePay extends Dto implements PayInPaymentDetails { 11 | 12 | @SerializedName("PaymentData") 13 | private PaymentData paymentData; 14 | 15 | @SerializedName("StatementDescriptor") 16 | private String statementDescriptor; 17 | 18 | public PaymentData getPaymentData() { 19 | return paymentData; 20 | } 21 | 22 | public PayInPaymentDetailsApplePay setPaymentData(PaymentData paymentData) { 23 | this.paymentData = paymentData; 24 | return this; 25 | } 26 | 27 | public String getStatementDescriptor() { 28 | return statementDescriptor; 29 | } 30 | 31 | public PayInPaymentDetailsApplePay setStatementDescriptor(String statementDescriptor) { 32 | this.statementDescriptor = statementDescriptor; 33 | return this; 34 | } 35 | 36 | @Override 37 | public Map getSubObjects() { 38 | Map subObjects = super.getSubObjects(); 39 | 40 | subObjects.put("PaymentData", PaymentData.class); 41 | 42 | return subObjects; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsBancontact.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | /** 8 | * Class representing the BANCONTACT type for mean of payment in PayIn entity. 9 | */ 10 | public class PayInPaymentDetailsBancontact extends Dto implements PayInPaymentDetails { 11 | 12 | /** 13 | * The URL where you should redirect your client in a mobile app experience 14 | */ 15 | @SerializedName("DeepLinkURL") 16 | private String deepLinkUrl; 17 | 18 | /** 19 | * An optional value to be specified on the user's bank statement 20 | * It can be up to 10 char alphanumeric and space. 21 | */ 22 | @SerializedName("StatementDescriptor") 23 | private String statementDescriptor; 24 | 25 | /** 26 | * Whether the Bancontact pay-ins are being made to be re-used in a recurring payment flow 27 | */ 28 | @SerializedName("Recurring") 29 | private Boolean recurring; 30 | 31 | public String getDeepLinkUrl() { 32 | return deepLinkUrl; 33 | } 34 | 35 | public void setDeepLinkUrl(String deepLinkUrl) { 36 | this.deepLinkUrl = deepLinkUrl; 37 | } 38 | 39 | public String getStatementDescriptor() { 40 | return statementDescriptor; 41 | } 42 | 43 | public void setStatementDescriptor(String statementDescriptor) { 44 | this.statementDescriptor = statementDescriptor; 45 | } 46 | 47 | public Boolean getRecurring() { 48 | return recurring; 49 | } 50 | 51 | public void setRecurring(Boolean recurring) { 52 | this.recurring = recurring; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsGiropay.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | /** 8 | * Class representing the GIROPAY type for mean of payment in PayIn entity. 9 | */ 10 | public class PayInPaymentDetailsGiropay extends Dto implements PayInPaymentDetails { 11 | 12 | /** 13 | * An optional value to be specified on the user's bank statement 14 | */ 15 | @SerializedName("StatementDescriptor") 16 | private String statementDescriptor; 17 | 18 | public String getStatementDescriptor() { 19 | return statementDescriptor; 20 | } 21 | 22 | public void setStatementDescriptor(String statementDescriptor) { 23 | this.statementDescriptor = statementDescriptor; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsGooglePay.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Billing; 5 | import com.mangopay.core.Dto; 6 | import com.mangopay.core.interfaces.PayInPaymentDetails; 7 | 8 | import java.lang.reflect.Type; 9 | import java.util.Map; 10 | 11 | public class PayInPaymentDetailsGooglePay extends Dto implements PayInPaymentDetails { 12 | 13 | @SerializedName("PaymentData") 14 | private PaymentData paymentData; 15 | 16 | @SerializedName("StatementDescriptor") 17 | private String statementDescriptor; 18 | 19 | @SerializedName("Billing") 20 | private Billing billing; 21 | 22 | public PaymentData getPaymentData() { 23 | return paymentData; 24 | } 25 | 26 | public PayInPaymentDetailsGooglePay setPaymentData(PaymentData paymentData) { 27 | this.paymentData = paymentData; 28 | return this; 29 | } 30 | 31 | public String getStatementDescriptor() { 32 | return statementDescriptor; 33 | } 34 | 35 | public PayInPaymentDetailsGooglePay setStatementDescriptor(String statementDescriptor) { 36 | this.statementDescriptor = statementDescriptor; 37 | return this; 38 | } 39 | 40 | public Billing getBilling() { 41 | return billing; 42 | } 43 | 44 | public PayInPaymentDetailsGooglePay setBilling(Billing billing) { 45 | this.billing = billing; 46 | return this; 47 | } 48 | 49 | @Override 50 | public Map getSubObjects() { 51 | Map subObjects = super.getSubObjects(); 52 | 53 | subObjects.put("PaymentData", PaymentData.class); 54 | subObjects.put("Billing", Billing.class); 55 | 56 | return subObjects; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsIdeal.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | /** 8 | * Class representing the IDEAL type for mean of payment in PayIn entity. 9 | */ 10 | public class PayInPaymentDetailsIdeal extends Dto implements PayInPaymentDetails { 11 | 12 | /** 13 | * An optional value to be specified on the user's bank statement 14 | */ 15 | @SerializedName("StatementDescriptor") 16 | private String statementDescriptor; 17 | 18 | /** 19 | * Name of the end-user’s bank 20 | */ 21 | @SerializedName("BankName") 22 | private String bankName; 23 | 24 | /** 25 | * The BIC identifier of the end-user’s bank 26 | */ 27 | @SerializedName("Bic") 28 | private String bic; 29 | 30 | public String getStatementDescriptor() { 31 | return statementDescriptor; 32 | } 33 | 34 | public void setStatementDescriptor(String statementDescriptor) { 35 | this.statementDescriptor = statementDescriptor; 36 | } 37 | 38 | public String getBankName() { 39 | return bankName; 40 | } 41 | 42 | public void setBankName(String bankName) { 43 | this.bankName = bankName; 44 | } 45 | 46 | public String getBic() { 47 | return bic; 48 | } 49 | 50 | public void setBic(String bic) { 51 | this.bic = bic; 52 | } 53 | } -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsMbway.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | /** 8 | * Class representing the MBWAY type for mean of payment in PayIn entity. 9 | */ 10 | public class PayInPaymentDetailsMbway extends Dto implements PayInPaymentDetails { 11 | 12 | /** 13 | * An optional value to be specified on the user's bank statement 14 | */ 15 | @SerializedName("StatementDescriptor") 16 | private String statementDescriptor; 17 | 18 | /** 19 | * The mobile phone number of the user initiating the pay-in 20 | * Country code followed by hash symbol (#) followed by the rest of the number. Only digits and hash allowed 21 | */ 22 | @SerializedName("Phone") 23 | private String phone; 24 | 25 | public String getStatementDescriptor() { 26 | return statementDescriptor; 27 | } 28 | 29 | public PayInPaymentDetailsMbway setStatementDescriptor(String statementDescriptor) { 30 | this.statementDescriptor = statementDescriptor; 31 | return this; 32 | } 33 | 34 | public String getPhone() { 35 | return phone; 36 | } 37 | 38 | public PayInPaymentDetailsMbway setPhone(String phone) { 39 | this.phone = phone; 40 | return this; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsMultibanco.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | /** 8 | * Class representing the MULTIBANCO type for mean of payment in PayIn entity. 9 | */ 10 | public class PayInPaymentDetailsMultibanco extends Dto implements PayInPaymentDetails { 11 | 12 | /** 13 | * An optional value to be specified on the user's bank statement 14 | */ 15 | @SerializedName("StatementDescriptor") 16 | private String statementDescriptor; 17 | 18 | public String getStatementDescriptor() { 19 | return statementDescriptor; 20 | } 21 | 22 | public PayInPaymentDetailsMultibanco setStatementDescriptor(String statementDescriptor) { 23 | this.statementDescriptor = statementDescriptor; 24 | return this; 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsPreAuthorized.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.Shipping; 6 | import com.mangopay.core.enumerations.CultureCode; 7 | import com.mangopay.core.interfaces.PayInPaymentDetails; 8 | 9 | /** 10 | * Class representing the PreAuthorized type for execution option in PayIn entity. 11 | */ 12 | public class PayInPaymentDetailsPreAuthorized extends Dto implements PayInPaymentDetails { 13 | 14 | /** 15 | * Pre-authorization identifier. 16 | */ 17 | @SerializedName("PreauthorizationId") 18 | private String preauthorizationId; 19 | 20 | /** 21 | * The language to use for the payment page - needs to be the ISO code of the language 22 | */ 23 | @SerializedName("Culture") 24 | private CultureCode culture; 25 | 26 | @SerializedName("Shipping") 27 | private Shipping shipping; 28 | 29 | public String getPreauthorizationId() { 30 | return preauthorizationId; 31 | } 32 | 33 | public Shipping getShipping() { 34 | return shipping; 35 | } 36 | 37 | public PayInPaymentDetailsPreAuthorized setShipping(Shipping shipping) { 38 | this.shipping = shipping; 39 | return this; 40 | } 41 | 42 | public void setPreauthorizationId(String preauthorizationId) { 43 | this.preauthorizationId = preauthorizationId; 44 | } 45 | 46 | public CultureCode getCulture() { 47 | return culture; 48 | } 49 | 50 | public PayInPaymentDetailsPreAuthorized setCulture(CultureCode culture) { 51 | this.culture = culture; 52 | return this; 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsSatispay.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | /** 8 | * Class representing the SATISPAY type for mean of payment in PayIn entity. 9 | */ 10 | public class PayInPaymentDetailsSatispay extends Dto implements PayInPaymentDetails { 11 | 12 | @SerializedName("Country") 13 | private String country; 14 | 15 | /** 16 | * An optional value to be specified on the user's bank statement 17 | */ 18 | @SerializedName("StatementDescriptor") 19 | private String statementDescriptor; 20 | 21 | public void setCountry(String country) { 22 | this.country = country; 23 | } 24 | 25 | public String getCountry() { 26 | return country; 27 | } 28 | 29 | public String getStatementDescriptor() { 30 | return statementDescriptor; 31 | } 32 | 33 | public PayInPaymentDetailsSatispay setStatementDescriptor(String statementDescriptor) { 34 | this.statementDescriptor = statementDescriptor; 35 | return this; 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInPaymentDetailsTwint.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.core.interfaces.PayInPaymentDetails; 6 | 7 | /** 8 | * Class representing the TWINT type for mean of payment in PayIn entity. 9 | */ 10 | public class PayInPaymentDetailsTwint extends Dto implements PayInPaymentDetails { 11 | 12 | /** 13 | * Max. length: 10 characters; only alphanumeric and spaces 14 | *

15 | * Custom description to appear on the user’s bank statement along with the platform name. 16 | * Different banks may show more or less information. See the Customizing bank statement references article for details. 17 | */ 18 | @SerializedName("StatementDescriptor") 19 | private String statementDescriptor; 20 | 21 | public String getStatementDescriptor() { 22 | return statementDescriptor; 23 | } 24 | 25 | public PayInPaymentDetailsTwint setStatementDescriptor(String statementDescriptor) { 26 | this.statementDescriptor = statementDescriptor; 27 | return this; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayInTemplateURLOptions.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.mangopay.core.Dto; 4 | 5 | /** 6 | * Class represents template URL options. 7 | */ 8 | public class PayInTemplateURLOptions extends Dto { 9 | 10 | /** 11 | * PAYLINE options. 12 | */ 13 | public String PAYLINE; 14 | 15 | /** 16 | * PAYLINEV2 options. 17 | */ 18 | public String PAYLINEV2; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayOutPaymentRef.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class PayOutPaymentRef { 6 | 7 | // Only valid PaymentRef reasonType is PAYIN_REFUND 8 | @SerializedName("ReasonType") 9 | private String reasonType; 10 | 11 | @SerializedName("ReferenceId") 12 | private String referenceId; 13 | 14 | public String getReasonType() { 15 | return reasonType; 16 | } 17 | 18 | public void setReasonType(String reasonType) { 19 | this.reasonType = reasonType; 20 | } 21 | 22 | public String getReferenceId() { 23 | return referenceId; 24 | } 25 | 26 | public void setReferenceId(String referenceId) { 27 | this.referenceId = referenceId; 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayPalWebTracking.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | public class PayPalWebTracking extends EntityBase { 7 | 8 | /** 9 | * The shipment’s tracking number provided by the carrier. 10 | */ 11 | @SerializedName("TrackingNumber") 12 | private String trackingNumber; 13 | /** 14 | * The carrier for the shipment. Use the country-specific version of the carrier if it exists, 15 | * otherwise use its global version. 16 | * Returned values: One of the carriers supported by PayPal. 17 | */ 18 | @SerializedName("Carrier") 19 | private String carrier; 20 | /** 21 | * If true, sends an email notification to the PaypalBuyerAccountEmail containing the TrackingNumber and Carrier, 22 | * which allows the end user to track their shipment with the carrier. 23 | * Default value: false 24 | */ 25 | @SerializedName("NotifyBuyer") 26 | private boolean notifyBuyer; 27 | 28 | public String getTrackingNumber() { 29 | return trackingNumber; 30 | } 31 | 32 | public PayPalWebTracking setTrackingNumber(String trackingNumber) { 33 | this.trackingNumber = trackingNumber; 34 | return this; 35 | } 36 | 37 | public String getCarrier() { 38 | return carrier; 39 | } 40 | 41 | public PayPalWebTracking setCarrier(String carrier) { 42 | this.carrier = carrier; 43 | return this; 44 | } 45 | 46 | public boolean isNotifyBuyer() { 47 | return notifyBuyer; 48 | } 49 | 50 | public PayPalWebTracking setNotifyBuyer(boolean notifyBuyer) { 51 | this.notifyBuyer = notifyBuyer; 52 | return this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayinsLinked.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class PayinsLinked extends Dto { 7 | @SerializedName("PayinCaptureId") 8 | private String payinCaptureId; 9 | 10 | @SerializedName("PayinComplementId") 11 | private String PayinComplementId; 12 | 13 | public String getPayinCaptureId() { 14 | return payinCaptureId; 15 | } 16 | 17 | public PayinsLinked setPayinCaptureId(String payinCaptureId) { 18 | this.payinCaptureId = payinCaptureId; 19 | return this; 20 | } 21 | 22 | public String getPayinComplementId() { 23 | return PayinComplementId; 24 | } 25 | 26 | public PayinsLinked setPayinComplementId(String payinComplementId) { 27 | PayinComplementId = payinComplementId; 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PaymentData.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.mangopay.core.Dto; 4 | 5 | public class PaymentData extends Dto { 6 | 7 | private String transactionId; 8 | 9 | public String getNetwork() { 10 | return network; 11 | } 12 | 13 | public PaymentData setNetwork(String network) { 14 | this.network = network; 15 | return this; 16 | } 17 | 18 | public String getTokenData() { 19 | return tokenData; 20 | } 21 | 22 | public PaymentData setTokenData(String tokenData) { 23 | this.tokenData = tokenData; 24 | return this; 25 | } 26 | 27 | private String network; 28 | 29 | private String tokenData; 30 | 31 | public String getTransactionId() { 32 | return transactionId; 33 | } 34 | 35 | public PaymentData setTransactionId(String transactionId) { 36 | this.transactionId = transactionId; 37 | return this; 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PayoutMethods.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | import java.util.List; 7 | 8 | public class PayoutMethods extends Dto { 9 | @SerializedName("AvailablePayoutMethods") 10 | private List availablePayoutMethods; 11 | 12 | public List getAvailablePayoutMethods() { 13 | return availablePayoutMethods; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/PendingUserAction.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class PendingUserAction extends Dto { 7 | /** 8 | * The URL to which to redirect the user to perform strong customer authentication (SCA) via a Mangopay-hosted webpage. This value is a variable and should not be hardcoded. 9 | *

10 | * Caution: Before redirecting the user on this URL, you must add the query parameter ReturnUrl with the percent-encoded URL to which you want the SCA session to return the user after authentication (whether successful or not). 11 | *

12 | * For more details, see How to redirect a user for an SCA session 13 | */ 14 | @SerializedName("RedirectUrl") 15 | private String redirectUrl; 16 | 17 | public String getRedirectUrl() { 18 | return redirectUrl; 19 | } 20 | 21 | public Boolean allFieldsNull() { 22 | return redirectUrl == null; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/ReportColumn.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class ReportColumn { 6 | @SerializedName("Name") 7 | private String Name; 8 | 9 | @SerializedName("IsDefault") 10 | private Boolean isDefault; 11 | 12 | public String getName() { 13 | return Name; 14 | } 15 | 16 | public ReportColumn setName(String name) { 17 | Name = name; 18 | return this; 19 | } 20 | 21 | public Boolean getDefault() { 22 | return isDefault; 23 | } 24 | 25 | public ReportColumn setDefault(Boolean aDefault) { 26 | isDefault = aDefault; 27 | return this; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/ScopeBlocked.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class ScopeBlocked { 6 | @SerializedName("Inflows") 7 | private Boolean inflows; 8 | 9 | @SerializedName("Outflows") 10 | private Boolean outflows; 11 | 12 | public Boolean getInflows() { 13 | return inflows; 14 | } 15 | 16 | public ScopeBlocked setInflows(Boolean inflows) { 17 | this.inflows = inflows; 18 | return this; 19 | } 20 | 21 | public Boolean getOutflows() { 22 | return outflows; 23 | } 24 | 25 | public ScopeBlocked setOutflows(Boolean outflows) { 26 | this.outflows = outflows; 27 | return this; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/UpdateDeposit.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.core.enumerations.PaymentStatus; 6 | 7 | public class UpdateDeposit extends EntityBase { 8 | @SerializedName("PaymentStatus") 9 | private PaymentStatus paymentStatus; 10 | 11 | public PaymentStatus getPaymentStatus() { 12 | return paymentStatus; 13 | } 14 | 15 | public UpdateDeposit setPaymentStatus(PaymentStatus paymentStatus) { 16 | this.paymentStatus = paymentStatus; 17 | return this; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/UserDataFormatValidation.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | public class UserDataFormatValidation extends EntityBase { 7 | /** 8 | * Information about the registration number of a legal entity 9 | */ 10 | @SerializedName("CompanyNumber") 11 | private CompanyNumberValidation companyNumber; 12 | 13 | public CompanyNumberValidation getCompanyNumber() { 14 | return companyNumber; 15 | } 16 | 17 | public UserDataFormatValidation setCompanyNumber(CompanyNumberValidation companyNumberValidation) { 18 | this.companyNumber = companyNumberValidation; 19 | return this; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/UserEnrollmentResult.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | public class UserEnrollmentResult extends Dto { 7 | 8 | /** 9 | * Information about the action required from the user if action was triggered by the API call (otherwise returned null). 10 | */ 11 | @SerializedName("PendingUserAction") 12 | PendingUserAction pendingUserAction; 13 | 14 | public PendingUserAction getPendingUserAction() { 15 | return pendingUserAction; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/UserRecipients.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | import com.mangopay.entities.Recipient; 6 | 7 | import java.util.List; 8 | 9 | public class UserRecipients extends Dto { 10 | /** 11 | * A list of recipients associated with a specific user 12 | */ 13 | @SerializedName("Recipients") 14 | private List recipients; 15 | 16 | public List getRecipients() { 17 | return recipients; 18 | } 19 | 20 | public UserRecipients setRecipients(List recipients) { 21 | this.recipients = recipients; 22 | return this; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/VirtualAccountAddress.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | 6 | public class VirtualAccountAddress extends EntityBase { 7 | 8 | @SerializedName("StreetName") 9 | private String streetName; 10 | 11 | @SerializedName("PostCode") 12 | private String postCode; 13 | 14 | @SerializedName("TownName") 15 | private String townName; 16 | 17 | @SerializedName("CountrySubDivision") 18 | private String countrySubDivision; 19 | 20 | @SerializedName("Country") 21 | private String country; 22 | 23 | public String getStreetName() { 24 | return streetName; 25 | } 26 | 27 | public VirtualAccountAddress setStreetName(String streetName) { 28 | this.streetName = streetName; 29 | return this; 30 | } 31 | 32 | public String getPostCode() { 33 | return postCode; 34 | } 35 | 36 | public VirtualAccountAddress setPostCode(String postCode) { 37 | this.postCode = postCode; 38 | return this; 39 | } 40 | 41 | public String getTownName() { 42 | return townName; 43 | } 44 | 45 | public VirtualAccountAddress setTownName(String townName) { 46 | this.townName = townName; 47 | return this; 48 | } 49 | 50 | public String getCountrySubDivision() { 51 | return countrySubDivision; 52 | } 53 | 54 | public VirtualAccountAddress setCountrySubDivision(String countrySubDivision) { 55 | this.countrySubDivision = countrySubDivision; 56 | return this; 57 | } 58 | 59 | public String getCountry() { 60 | return country; 61 | } 62 | 63 | public VirtualAccountAddress setCountry(String country) { 64 | this.country = country; 65 | return this; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/VirtualAccountAvailabilities.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.Dto; 5 | 6 | import java.util.List; 7 | 8 | public class VirtualAccountAvailabilities extends Dto { 9 | 10 | @SerializedName("Collection") 11 | private List collection; 12 | 13 | @SerializedName("UserOwned") 14 | private List userOwned; 15 | 16 | public VirtualAccountAvailabilities(List collection, List userOwned) { 17 | this.collection = collection; 18 | this.userOwned = userOwned; 19 | } 20 | 21 | public List getCollection() { 22 | return collection; 23 | } 24 | 25 | public VirtualAccountAvailabilities setCollection(List collection) { 26 | this.collection = collection; 27 | return this; 28 | } 29 | 30 | public List getUserOwned() { 31 | return userOwned; 32 | } 33 | 34 | public VirtualAccountAvailabilities setUserOwned(List userOwned) { 35 | this.userOwned = userOwned; 36 | return this; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/mangopay/entities/subentities/VirtualAccountAvailability.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities.subentities; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.mangopay.core.EntityBase; 5 | import com.mangopay.core.enumerations.CurrencyIso; 6 | 7 | import java.util.List; 8 | 9 | public class VirtualAccountAvailability extends EntityBase { 10 | 11 | @SerializedName("Country") 12 | private String country; 13 | 14 | @SerializedName("Available") 15 | private Boolean available; 16 | 17 | @SerializedName("Currencies") 18 | private List currencies; 19 | 20 | public String getCountry() { 21 | return country; 22 | } 23 | 24 | public VirtualAccountAvailability setCountry(String country) { 25 | this.country = country; 26 | return this; 27 | } 28 | 29 | public Boolean getAvailable() { 30 | return available; 31 | } 32 | 33 | public VirtualAccountAvailability setAvailable(Boolean available) { 34 | this.available = available; 35 | return this; 36 | } 37 | 38 | public List getCurrencies() { 39 | return currencies; 40 | } 41 | 42 | public VirtualAccountAvailability setCurrencies(List currencies) { 43 | this.currencies = currencies; 44 | return this; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/com/mangopay/core/mangopay.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 10 14:04:21 EEST 2025 2 | version=2.52.0 3 | -------------------------------------------------------------------------------- /src/test/java/com/mangopay/MangoPayApiTest.java: -------------------------------------------------------------------------------- 1 | package com.mangopay; 2 | 3 | import com.mangopay.core.*; 4 | import org.junit.Test; 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * 9 | */ 10 | public class MangoPayApiTest extends BaseTest { 11 | 12 | @Test 13 | public void ApiAndUsersConstructionTest() { 14 | MangoPayApi mangoPayApi = new MangoPayApi(); 15 | assertNotNull(mangoPayApi); 16 | assertNotNull(mangoPayApi.getUserApi()); 17 | } 18 | } -------------------------------------------------------------------------------- /src/test/java/com/mangopay/core/BankingAliasApiImplTest.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.mangopay.core.enumerations.CountryIso; 4 | import com.mangopay.entities.BankingAlias; 5 | import com.mangopay.entities.Wallet; 6 | import org.junit.Test; 7 | 8 | import java.util.List; 9 | 10 | import static junit.framework.TestCase.assertEquals; 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Tests concerning the banking alias API. 15 | */ 16 | public class BankingAliasApiImplTest extends BaseTest { 17 | 18 | @Test 19 | public void createBankingAlias() throws Exception { 20 | BankingAlias bankingAlias = getJohnsBankingAlias(); 21 | 22 | assertTrue(bankingAlias.getId().length() > 0); 23 | assertNotNull(bankingAlias.getDetails()); 24 | } 25 | 26 | @Test 27 | public void getBankingAlias() throws Exception { 28 | BankingAlias bankingAlias = getJohnsBankingAlias(); 29 | BankingAlias getBankingAlias = this.api.getBankingAliases().get(bankingAlias.getId()); 30 | 31 | assertEquals(bankingAlias.getId(), getBankingAlias.getId()); 32 | assertNotNull(bankingAlias.getDetails()); 33 | assertNotNull(getBankingAlias.getDetails()); 34 | } 35 | 36 | @Test 37 | public void getWalletBankingAliases() throws Exception { 38 | Wallet wallet = getJohnsWallet(); 39 | BankingAlias bankingAlias = getJohnsBankingAlias(); 40 | List bankingAliases = this.api.getBankingAliases().listForWallet(wallet.getId()); 41 | 42 | assertEquals(bankingAlias.getId(), bankingAliases.get(0).getId()); 43 | } 44 | 45 | @Test 46 | public void deactivateBankingAlias() throws Exception { 47 | BankingAlias bankingAlias = getJohnsBankingAlias(); 48 | bankingAlias.setActive(false); 49 | BankingAlias deactivatedBankingAlias = this.api.getBankingAliases().deactivate(bankingAlias.getId(), bankingAlias); 50 | 51 | assertFalse(deactivatedBankingAlias.isActive()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/test/java/com/mangopay/core/ConfigurationsTest.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import static org.junit.Assert.*; 4 | import org.junit.Test; 5 | 6 | /** 7 | * Tests for holding authentication token in instance 8 | */ 9 | public class ConfigurationsTest extends BaseTest { 10 | 11 | @Test(expected = ResponseException.class) 12 | public void confInConstruct() throws Exception { 13 | this.api.getConfig().setClientId("test_asd"); 14 | this.api.getConfig().setClientPassword("00000"); 15 | this.api.getUserApi().getAll(); 16 | } 17 | 18 | @Test 19 | public void getVersionTest() { 20 | // First load from properties files 21 | assertNotNull(getApi().getConfig().getVersion()); 22 | // Second load from memory 23 | assertNotNull(getApi().getConfig().getVersion()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/mangopay/core/DefaultStorageStrategyForTests.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.mangopay.core.interfaces.StorageStrategy; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | /** 8 | * Default token storage strategy implementation for tests. 9 | */ 10 | public class DefaultStorageStrategyForTests implements StorageStrategy { 11 | 12 | private static Map oAuthToken = new HashMap<>(); 13 | 14 | /** 15 | * Gets the currently stored token. 16 | * @param envKey Environment key for token. 17 | * @return Currently stored token instance or null. 18 | */ 19 | @Override 20 | public OAuthToken get(String envKey) { 21 | if (!oAuthToken.containsKey(envKey)) return null; 22 | 23 | return oAuthToken.get(envKey); 24 | } 25 | 26 | /** 27 | * Stores authorization token passed as an argument. 28 | * @param token Token instance to be stored. 29 | * @param envKey Environment key for token. 30 | */ 31 | @Override 32 | public void store(OAuthToken token, String envKey) { 33 | oAuthToken.put(envKey, token); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /src/test/java/com/mangopay/core/EventApiImplTest.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.core; 2 | 3 | import com.mangopay.core.enumerations.EventType; 4 | import com.mangopay.entities.Event; 5 | import org.junit.Test; 6 | 7 | import java.util.List; 8 | 9 | import static org.junit.Assert.assertNotNull; 10 | 11 | /** 12 | * EventApiImpl test methods 13 | */ 14 | public class EventApiImplTest extends BaseTest { 15 | 16 | @Test 17 | public void getEvents() throws Exception { 18 | 19 | FilterEvents eventsFilter = new FilterEvents(); 20 | eventsFilter.setType(EventType.PAYIN_NORMAL_CREATED); 21 | 22 | List getEvents = this.api.getEventApi().get(eventsFilter, null, null); 23 | 24 | eventsFilter.setType(EventType.ALL); 25 | List getAllEvents = this.api.getEventApi().get(eventsFilter, null, null); 26 | 27 | assertNotNull(getEvents); 28 | assertNotNull(getAllEvents); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/mangopay/core/ObjectToolTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.mangopay.core; 7 | 8 | import org.junit.After; 9 | import org.junit.AfterClass; 10 | import org.junit.Before; 11 | import org.junit.BeforeClass; 12 | import org.junit.Test; 13 | import static org.junit.Assert.*; 14 | 15 | /** 16 | * 17 | * @author Hector Espert hespert@peertopark.com 18 | */ 19 | public class ObjectToolTest { 20 | 21 | public ObjectToolTest() { 22 | } 23 | 24 | @BeforeClass 25 | public static void setUpClass() { 26 | } 27 | 28 | @AfterClass 29 | public static void tearDownClass() { 30 | } 31 | 32 | @Before 33 | public void setUp() { 34 | } 35 | 36 | @After 37 | public void tearDown() { 38 | } 39 | 40 | /** 41 | * Test of nonNull method, of class ObjectTool. 42 | */ 43 | @Test 44 | public void testNonNull() { 45 | Object object = null; 46 | assertFalse(ObjectTool.nonNull(object)); 47 | object = new Object(); 48 | assertTrue(ObjectTool.nonNull(object)); 49 | } 50 | 51 | /** 52 | * Test of isNull method, of class ObjectTool. 53 | */ 54 | @Test 55 | public void testIsNull() { 56 | Object object = null; 57 | assertTrue(ObjectTool.isNull(object)); 58 | object = new Object(); 59 | assertFalse(ObjectTool.isNull(object)); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/test/java/com/mangopay/entities/GsonTest.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.mangopay.core.BaseTest; 4 | import com.mangopay.core.enumerations.CardInfoType; 5 | import org.junit.Test; 6 | 7 | import static org.junit.Assert.assertEquals; 8 | import static org.junit.Assert.assertNull; 9 | 10 | public class GsonTest extends BaseTest { 11 | @Test 12 | public void testSerializeCardInfoType() { 13 | CardInfoType type = CardInfoType.CHARGE_CARD; 14 | String json = getApi().getGson().toJson(type); 15 | assertEquals("\"CHARGE CARD\"", json); 16 | 17 | type = null; 18 | json = getApi().getGson().toJson(type); 19 | assertEquals("null", json); 20 | } 21 | 22 | @Test 23 | public void testDeserializeCardInfoType() { 24 | String jsonInput = "\"CHARGE CARD\""; 25 | CardInfoType deserialized = getApi().getGson().fromJson(jsonInput, CardInfoType.class); 26 | assertEquals(CardInfoType.CHARGE_CARD, deserialized); 27 | 28 | jsonInput = "null"; 29 | deserialized = getApi().getGson().fromJson(jsonInput, CardInfoType.class); 30 | assertNull(deserialized); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/com/mangopay/entities/RateLimitTest.java: -------------------------------------------------------------------------------- 1 | package com.mangopay.entities; 2 | 3 | import com.mangopay.core.BaseTest; 4 | import org.junit.Test; 5 | 6 | import java.util.List; 7 | 8 | import static org.junit.Assert.*; 9 | 10 | /** 11 | * Tests concerning rate limit data storage and update. 12 | *

13 | * Created by thepa on 28-Jul-17. 14 | */ 15 | public class RateLimitTest extends BaseTest { 16 | 17 | @Test 18 | public void rateLimitsUpdateTest() throws Exception { 19 | assertNull(this.api.getRateLimits()); 20 | 21 | getJohnsCardPreAuthorization(); 22 | 23 | List rateLimits = this.api.getRateLimits(); 24 | 25 | assertNotNull(rateLimits); 26 | assertFalse(rateLimits.isEmpty()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/resources/com/mangopay/core/TestKycPageFile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mangopay/mangopay2-java-sdk/991f35519e3a2e3c685e287ea22c7489e3d1ece0/src/test/resources/com/mangopay/core/TestKycPageFile.png --------------------------------------------------------------------------------