public final class EwayRapidConfig
extends java.lang.Object
OidcConfig: system property first (dev / Ant
build.properties), then AWSSecretUtil.findCommonSecret(String)
so UAT/PROD do not store secrets in the GitHub properties repos.
Preferred secret key:
EWAY_RAPID_{MERCHANT}_{AREA}_{FIELD} e.g.
EWAY_RAPID_MEMBERSHIP_DEV_API_KEY or
EWAY_RAPID_EVENTS_PROD_API_KEY. AREA is DEV,
UAT, or PROD from the AREA system property.
Any other value, including blank, uses DEV. EVENTS
is a separate merchant: it never falls back to membership keys.
| Modifier and Type | Class and Description |
|---|---|
static class |
EwayRapidConfig.Field
Credential field used in
EWAY_RAPID_{MERCHANT}_{AREA}_{FIELD} names. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MERCHANT_EVENTS
Events / conference eWay merchant.
|
static java.lang.String |
MERCHANT_MEMBERSHIP
Membership eWay merchant (default).
|
| Constructor and Description |
|---|
EwayRapidConfig(EwayRapidEnvironment environment,
java.lang.String apiKey,
java.lang.String apiPassword,
java.lang.String cseKey) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getApiKey() |
java.lang.String |
getApiPassword() |
java.lang.String |
getCseKey() |
EwayRapidEnvironment |
getEnvironment() |
boolean |
hasCredentials() |
static boolean |
isEventsMerchant(java.lang.String merchant) |
static EwayRapidConfig |
load(EwayRapidEnvironment environment)
Load membership credentials for
environment. |
static EwayRapidConfig |
load(EwayRapidEnvironment environment,
java.lang.String merchant)
Load credentials for
merchant on environment. |
static java.lang.String |
normalizeMerchant(java.lang.String merchant)
MEMBERSHIP (default) or EVENTS. |
static java.lang.String |
notConfiguredMessage(java.lang.String merchant)
Message when
hasCredentials() is false. |
static java.lang.String |
propertyName(java.lang.String merchant,
EwayRapidConfig.Field field)
EWAY_RAPID_MEMBERSHIP_DEV_API_KEY style name. |
public static final java.lang.String MERCHANT_MEMBERSHIP
public static final java.lang.String MERCHANT_EVENTS
public EwayRapidConfig(EwayRapidEnvironment environment, java.lang.String apiKey, java.lang.String apiPassword, java.lang.String cseKey)
environment - sandbox or production hostapiKey - Rapid API keyapiPassword - Rapid API passwordcseKey - CSE public key, or blank@CheckReturnValue @Nonnull public static EwayRapidConfig load(EwayRapidEnvironment environment)
environment.environment - Rapid host@CheckReturnValue @Nonnull public static EwayRapidConfig load(EwayRapidEnvironment environment, java.lang.String merchant)
merchant on environment.environment - Rapid hostmerchant - MEMBERSHIP or EVENTS@CheckReturnValue
@Nonnull
public static java.lang.String normalizeMerchant(@Nullable
java.lang.String merchant)
MEMBERSHIP (default) or EVENTS. Case-insensitive.merchant - raw merchant, or blankMERCHANT_MEMBERSHIP or MERCHANT_EVENTSjava.lang.IllegalArgumentException - when merchant is neither blank nor a known code@CheckReturnValue
public static boolean isEventsMerchant(@Nullable
java.lang.String merchant)
merchant - raw merchant, or blankmerchant normalises to MERCHANT_EVENTS@CheckReturnValue
@Nonnull
public static java.lang.String propertyName(java.lang.String merchant,
EwayRapidConfig.Field field)
EWAY_RAPID_MEMBERSHIP_DEV_API_KEY style name.
The area segment is DEV, UAT, or PROD from
CUtilities.getAreaName(). Any other
value, including blank, uses DEV.merchant - MERCHANT_MEMBERSHIP or MERCHANT_EVENTSfield - API key, password, or CSE key@CheckReturnValue @Nonnull public EwayRapidEnvironment getEnvironment()
@CheckReturnValue @Nonnull public java.lang.String getApiKey()
@CheckReturnValue @Nonnull public java.lang.String getApiPassword()
@CheckReturnValue @Nonnull public java.lang.String getCseKey()
public boolean hasCredentials()
@CheckReturnValue
@Nonnull
public static java.lang.String notConfiguredMessage(@Nullable
java.lang.String merchant)
hasCredentials() is false.merchant - MERCHANT_MEMBERSHIP, MERCHANT_EVENTS, or blankstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.