-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from Adyen/develop
Release 1.4.0
- Loading branch information
Showing
95 changed files
with
5,004 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* ###### | ||
* ###### | ||
* ############ ####( ###### #####. ###### ############ ############ | ||
* ############# #####( ###### #####. ###### ############# ############# | ||
* ###### #####( ###### #####. ###### ##### ###### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ###### | ||
* ############# ############# ############# ############# ##### ###### | ||
* ############ ############ ############# ############ ##### ###### | ||
* ###### | ||
* ############# | ||
* ############ | ||
* | ||
* Adyen Java API Library | ||
* | ||
* Copyright (c) 2018 Adyen B.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
*/ | ||
|
||
package com.adyen.constants; | ||
|
||
public interface ErrorTypeCodes { | ||
Integer FIELD_MISSING = 1; | ||
Integer EMAIL_INVALID = 2; | ||
Integer COUNTRY_INVALID = 3; | ||
Integer CONTAINS_NUMBERS = 4; | ||
Integer WEB_ADDRESS_INVALID = 5; | ||
Integer INVALID_DATE_FORMAT = 6; | ||
Integer DATE_OUT_OF_RANGE = 7; | ||
Integer BANK_DETAILS_INVALID = 8; | ||
Integer POSTAL_CODE_INVALID = 9; | ||
Integer STATE_CODE_INVALID = 10; | ||
Integer STATE_CODE_UNKNOWN = 11; | ||
Integer PHONE_NUMBER_OBJECT = 12; | ||
Integer PHONE_NUMBER_INVALID = 13; | ||
Integer PHONE_NUMBER_TOO_SHORT = 14; | ||
Integer COUNTRY_NOT_SUPPORTED = 15; | ||
Integer INVALID_CURRENCY = 16; | ||
Integer IBAN_AND_ACCOUNT_NUMBER = 17; | ||
Integer BANK_CODE_UNKNOWN = 18; | ||
Integer TIER_NUMBER_INVALID = 19; | ||
Integer FORBIDDEN_FIELD = 20; | ||
Integer INVALID_ACCOUNT_DESCRIPTION = 21; | ||
} |
95 changes: 95 additions & 0 deletions
95
src/main/java/com/adyen/deserializer/MarketPayNotificationMessageDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* ###### | ||
* ###### | ||
* ############ ####( ###### #####. ###### ############ ############ | ||
* ############# #####( ###### #####. ###### ############# ############# | ||
* ###### #####( ###### #####. ###### ##### ###### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ###### | ||
* ############# ############# ############# ############# ##### ###### | ||
* ############ ############ ############# ############ ##### ###### | ||
* ###### | ||
* ############# | ||
* ############ | ||
* | ||
* Adyen Java API Library | ||
* | ||
* Copyright (c) 2017 Adyen B.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
*/ | ||
|
||
package com.adyen.deserializer; | ||
|
||
import java.lang.reflect.Type; | ||
import com.adyen.model.marketpay.notification.AccountCreatedNotification; | ||
import com.adyen.model.marketpay.notification.AccountHolderCreatedNotification; | ||
import com.adyen.model.marketpay.notification.AccountHolderLimitReachedNotification; | ||
import com.adyen.model.marketpay.notification.AccountHolderPayoutNotification; | ||
import com.adyen.model.marketpay.notification.AccountHolderStatusChangeNotification; | ||
import com.adyen.model.marketpay.notification.AccountHolderUpdatedNotification; | ||
import com.adyen.model.marketpay.notification.AccountHolderVerificationNotification; | ||
import com.adyen.model.marketpay.notification.BeneficiarySetupNotification; | ||
import com.adyen.model.marketpay.notification.CompensateNegativeBalanceNotification; | ||
import com.adyen.model.marketpay.notification.GenericNotification; | ||
import com.adyen.model.marketpay.notification.PaymentFailureNotification; | ||
import com.adyen.model.marketpay.notification.ReportAvailableNotification; | ||
import com.adyen.model.marketpay.notification.ScheduledRefundsNotification; | ||
import com.adyen.model.marketpay.notification.TransferFundsNotification; | ||
import com.google.gson.JsonDeserializationContext; | ||
import com.google.gson.JsonDeserializer; | ||
import com.google.gson.JsonElement; | ||
import com.google.gson.JsonObject; | ||
import com.google.gson.JsonParseException; | ||
|
||
public class MarketPayNotificationMessageDeserializer implements JsonDeserializer<GenericNotification> { | ||
@Override | ||
public GenericNotification deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException { | ||
JsonObject jsonObject = jsonElement.getAsJsonObject(); | ||
|
||
JsonElement jsonType = jsonObject.get("eventType"); | ||
String eventType = jsonType.getAsString(); | ||
|
||
if (GenericNotification.EventTypeEnum.ACCOUNT_CREATED.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, AccountCreatedNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_CREATED.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, AccountHolderCreatedNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_LIMIT_REACHED.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, AccountHolderLimitReachedNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_VERIFICATION.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, AccountHolderVerificationNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_STATUS_CHANGE.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, AccountHolderStatusChangeNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, AccountHolderPayoutNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_UPDATED.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, AccountHolderUpdatedNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.BENEFICIARY_SETUP.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, BeneficiarySetupNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.SCHEDULED_REFUNDS.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, ScheduledRefundsNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.COMPENSATE_NEGATIVE_BALANCE.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, CompensateNegativeBalanceNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.PAYMENT_FAILURE.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, PaymentFailureNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.REPORT_AVAILABLE.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, ReportAvailableNotification.class); | ||
} | ||
if (GenericNotification.EventTypeEnum.TRANSFER_FUNDS.toString().equalsIgnoreCase(eventType)) { | ||
return jsonDeserializationContext.deserialize(jsonElement, TransferFundsNotification.class); | ||
} | ||
|
||
return jsonDeserializationContext.deserialize(jsonElement, GenericNotification.class); | ||
} | ||
} |
Oops, something went wrong.