diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/TokenBuilder.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/TokenBuilder.java index 78eb201..27df6bc 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/TokenBuilder.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/TokenBuilder.java @@ -31,12 +31,8 @@ import com.skplanet.jose.JoseBuilders; import com.skplanet.jose.JoseHeader; import com.skplanet.jose.jwa.Jwa; -import com.skplanet.syruppay.token.claims.MapToSktUserConfigurer; -import com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer; -import com.skplanet.syruppay.token.claims.MerchantUserConfigurer; -import com.skplanet.syruppay.token.claims.OrderConfigurer; -import com.skplanet.syruppay.token.claims.PayConfigurer; -import com.skplanet.syruppay.token.claims.SubscriptionConfigurer; +import com.skplanet.syruppay.token.claims.*; +import com.skplanet.syruppay.token.claims.MerchantUserClaim; import com.skplanet.syruppay.token.jwt.SyrupPayToken; import com.skplanet.syruppay.token.jwt.Token; import org.slf4j.Logger; @@ -200,71 +196,71 @@ public TokenBuilder expiredMinutes(int expiredMinutes) { /** * 시럽페이 로그인을 위한 설정 객체를 확인하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MerchantUserConfigurer} + * @return {@link MerchantUserClaim} * @throws Exception the exception */ - public MerchantUserConfigurer login() throws Exception { - return getOrApply(new MerchantUserConfigurer()); + public MerchantUserClaim login() throws Exception { + return getOrApply(new MerchantUserClaim()); } /** * 시럽페이 회원가입을 위한 설정 객체를 확인하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MerchantUserConfigurer} + * @return {@link MerchantUserClaim} * @throws Exception the exception */ - public MerchantUserConfigurer signUp() throws Exception { - return getOrApply(new MerchantUserConfigurer()); + public MerchantUserClaim signUp() throws Exception { + return getOrApply(new MerchantUserClaim()); } /** * 시럽페이 결제를 위한 설정 객체를 확인하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.PayConfigurer} + * @return {@link PayClaim} * @throws Exception the exception */ - public PayConfigurer pay() throws Exception { - return getOrApply(new PayConfigurer()); + public PayClaim pay() throws Exception { + return getOrApply(new PayClaim()); } /** * 시럽페이 체크아웃 기느을 위한 설정 객체를 확인하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.OrderConfigurer} + * @return {@link OrderClaim} * @throws Exception the exception */ - public OrderConfigurer checkout() throws Exception { - return getOrApply(new OrderConfigurer()); + public OrderClaim checkout() throws Exception { + return getOrApply(new OrderClaim()); } /** * 시럽페이 사용자 맵핑을 위한 설정 객체를 확인하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer} + * @return {@link MapToUserClaim} * @throws Exception the exception */ - public MapToSyrupPayUserConfigurer mapToUser() throws Exception { - return getOrApply(new MapToSyrupPayUserConfigurer()); + public MapToUserClaim mapToUser() throws Exception { + return getOrApply(new MapToUserClaim()); } /** * SKT 사용자인 시럽페이 사용자 맵핑을 위한 설정 객체를 확인하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MapToSktUserConfigurer} + * @return {@link MapToSktUserClaim} * @throws Exception the exception */ - public MapToSktUserConfigurer mapToSktUser() throws Exception { - return getOrApply(new MapToSktUserConfigurer()); + public MapToSktUserClaim mapToSktUser() throws Exception { + return getOrApply(new MapToSktUserClaim()); } /** * SKT 사용자인 시럽페이 사용자 맵핑을 위한 설정 객체를 확인하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MapToSktUserConfigurer} + * @return {@link MapToSktUserClaim} * @throws Exception the exception */ - public SubscriptionConfigurer subscription() throws Exception { - return getOrApply(new SubscriptionConfigurer()); + public SubscriptionClaim subscription() throws Exception { + return getOrApply(new SubscriptionClaim()); } @SuppressWarnings("unchecked") diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/AbstractTokenConfigurer.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/AbstractTokenClaim.java similarity index 87% rename from syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/AbstractTokenConfigurer.java rename to syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/AbstractTokenClaim.java index f3873de..7f3fea2 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/AbstractTokenConfigurer.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/AbstractTokenClaim.java @@ -35,10 +35,10 @@ * @author 임형태 * @since 1.0 */ -abstract class AbstractTokenConfigurer, B extends Builder> extends ClaimConfigurerAdapter { +abstract class AbstractTokenClaim, B extends Builder> extends ClaimConfigurerAdapter { /** - * {@link com.skplanet.syruppay.token.claims.AbstractTokenConfigurer} 을 토큰 Claim 빌드 목록에서 제거한다. + * {@link AbstractTokenClaim} 을 토큰 Claim 빌드 목록에서 제거한다. * * @return 수정된 {@link com.skplanet.syruppay.token.ClaimBuilder}를 반환한다. */ diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSktUserConfigurer.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSktUserClaim.java similarity index 85% rename from syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSktUserConfigurer.java rename to syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSktUserClaim.java index 2ef3a48..978866f 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSktUserConfigurer.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSktUserClaim.java @@ -30,7 +30,7 @@ * @since 1.0 */ @Deprecated -public class MapToSktUserConfigurer> extends AbstractTokenConfigurer, H> { +public class MapToSktUserClaim> extends AbstractTokenClaim, H> { private String lineNumber; private String svcMgmtNumber; @@ -52,12 +52,12 @@ public String getSvcMgmtNumber() { return svcMgmtNumber; } - public MapToSktUserConfigurer withLineNumber(String lineNumber) { + public MapToSktUserClaim withLineNumber(String lineNumber) { this.lineNumber = lineNumber; return this; } - public MapToSktUserConfigurer withServiceManagementNumber(String serviceManagementNumber) { + public MapToSktUserClaim withServiceManagementNumber(String serviceManagementNumber) { this.svcMgmtNumber = serviceManagementNumber; return this; } diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSyrupPayUserConfigurer.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToUserClaim.java similarity index 92% rename from syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSyrupPayUserConfigurer.java rename to syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToUserClaim.java index bc011e4..1df05f2 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToSyrupPayUserConfigurer.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MapToUserClaim.java @@ -40,10 +40,10 @@ * * @param {@link Builder} * @author 임형태 - * @see com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType + * @see MapToUserClaim.MappingType * @since 1.0 */ -public class MapToSyrupPayUserConfigurer> extends AbstractTokenConfigurer, H> { +public class MapToUserClaim> extends AbstractTokenClaim, H> { private static final ObjectMapper MAPPER = new ObjectMapper(); private MappingType mappingType; @@ -54,7 +54,7 @@ public String getIdentityAuthenticationId() { return identityAuthenticationId; } - public MapToSyrupPayUserConfigurer withIdentityAuthenticationId(String identityAuthenticationId) { + public MapToUserClaim withIdentityAuthenticationId(String identityAuthenticationId) { this.identityAuthenticationId = identityAuthenticationId; return this; } @@ -62,8 +62,8 @@ public MapToSyrupPayUserConfigurer withIdentityAuthenticationId(String identi /** * 시럽페이 사용자 정보를 맵핑하는 방식을 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType} - * @see com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType + * @return {@link MapToUserClaim.MappingType} + * @see MapToUserClaim.MappingType */ public MappingType getMappingType() { return mappingType; @@ -89,10 +89,10 @@ public Personal getPersonalIfNotExistThenNullWith(final String key) throws IOExc /** * 시럽페이 사용자 정보를 맵핑하기 위한 방식을 지정한다. * - * @param type {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType} + * @param type {@link MapToUserClaim.MappingType} * @return this */ - public MapToSyrupPayUserConfigurer withType(final MappingType type) { + public MapToUserClaim withType(final MappingType type) { this.mappingType = type; return this; } @@ -100,10 +100,10 @@ public MapToSyrupPayUserConfigurer withType(final MappingType type) { /** * 시럽페이 사용자 정보를 매핑하기 위한 값을 지정한다. * - * @param value {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType}의 값 + * @param value {@link MapToUserClaim.MappingType}의 값 * @return this */ - public MapToSyrupPayUserConfigurer withValue(final String value) { + public MapToUserClaim withValue(final String value) { this.mappingValue = value; return this; } @@ -118,7 +118,7 @@ public MapToSyrupPayUserConfigurer withValue(final String value) { * @throws IOException * @since 1.3.8 */ - public MapToSyrupPayUserConfigurer withValue(final Personal p, final String kid, final String key) throws IOException { + public MapToUserClaim withValue(final Personal p, final String kid, final String key) throws IOException { this.mappingValue = new Jose().configuration( JoseBuilders.JsonEncryptionCompactSerializationBuilder() .header(new JoseHeader(Jwa.A128KW, Jwa.A128CBC_HS256, kid)) diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MerchantUserConfigurer.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MerchantUserClaim.java similarity index 88% rename from syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MerchantUserConfigurer.java rename to syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MerchantUserClaim.java index 0cd228c..c42b04a 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MerchantUserConfigurer.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/MerchantUserClaim.java @@ -31,7 +31,7 @@ * @author 임형태 * @since 1.0 */ -public final class MerchantUserConfigurer> extends AbstractTokenConfigurer, H> { +public final class MerchantUserClaim> extends AbstractTokenClaim, H> { private String mctUserId; private String extraUserId; @Deprecated @@ -42,7 +42,7 @@ public final class MerchantUserConfigurer> extends Abstract @JsonProperty("SSOPolicy") private SsoPolicy ssoPolicy; - public MerchantUserConfigurer() { + public MerchantUserClaim() { } /** @@ -97,7 +97,7 @@ public SsoPolicy getSsoPolicy() { * @param ssoCredential sso credential * @return this */ - public MerchantUserConfigurer withSsoCredential(String ssoCredential) { + public MerchantUserClaim withSsoCredential(String ssoCredential) { this.ssoCredential = ssoCredential; return this; } @@ -109,7 +109,7 @@ public MerchantUserConfigurer withSsoCredential(String ssoCredential) { * @param merchantUserId 회원 ID * @return this */ - public MerchantUserConfigurer withMerchantUserId(String merchantUserId) { + public MerchantUserClaim withMerchantUserId(String merchantUserId) { this.mctUserId = merchantUserId; return this; } @@ -120,7 +120,7 @@ public MerchantUserConfigurer withMerchantUserId(String merchantUserId) { * @param extraMerchantUserId 추가 가맹점 회원 ID * @return this */ - public MerchantUserConfigurer withExtraMerchantUserId(String extraMerchantUserId) { + public MerchantUserClaim withExtraMerchantUserId(String extraMerchantUserId) { this.extraUserId = extraMerchantUserId; return this; } @@ -131,7 +131,7 @@ public MerchantUserConfigurer withExtraMerchantUserId(String extraMerchantUse * @param implicitSSOSeed Seed 값 * @return this */ - public MerchantUserConfigurer withImplicitSSOSeed(String implicitSSOSeed) { + public MerchantUserClaim withImplicitSSOSeed(String implicitSSOSeed) { this.implicitSSOSeed = implicitSSOSeed; return this; } @@ -141,12 +141,12 @@ public MerchantUserConfigurer withImplicitSSOSeed(String implicitSSOSeed) { * * @param deviceIdentifier device 를 식별할 수 있는 ID 값 */ - public MerchantUserConfigurer withDeviceIdentifier(String deviceIdentifier) { + public MerchantUserClaim withDeviceIdentifier(String deviceIdentifier) { this.deviceIdentifier = deviceIdentifier; return this; } - public MerchantUserConfigurer isNotApplicableSso() { + public MerchantUserClaim isNotApplicableSso() { this.ssoPolicy = SsoPolicy.NOT_APPLICABLE; return this; } diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/OrderConfigurer.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/OrderClaim.java similarity index 91% rename from syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/OrderConfigurer.java rename to syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/OrderClaim.java index 6af36ff..56e4a1b 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/OrderConfigurer.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/OrderClaim.java @@ -38,7 +38,7 @@ * @author 임형태 * @since 1.1 */ -public final class OrderConfigurer> extends AbstractTokenConfigurer, H> { +public final class OrderClaim> extends AbstractTokenClaim, H> { private int productPrice; private String submallName; private String privacyPolicyRequirements; @@ -46,9 +46,9 @@ public final class OrderConfigurer> extends AbstractTokenCo private ProductDeliveryInfo productDeliveryInfo; private List offerList = new ArrayList(); private List loyaltyList = new ArrayList(); - private List shippingAddressList = new ArrayList(); + private List shippingAddressList = new ArrayList(); private List monthlyInstallmentList = new ArrayList(); - private List bankInfoList = new ArrayList(); + private List bankInfoList = new ArrayList(); public List getMonthlyInstallmentList() { return Collections.unmodifiableList(monthlyInstallmentList); @@ -75,7 +75,7 @@ public ProductDeliveryInfo getProductDeliveryInfo() { return this.productDeliveryInfo; } - public List getBankInfoList() { + public List getBankInfoList() { return bankInfoList; } @@ -98,7 +98,7 @@ public void validRequired() throws Exception { for (Loyalty l : loyaltyList) { l.validRequired(); } - for (PayConfigurer.ShippingAddress a : shippingAddressList) { + for (PayClaim.ShippingAddress a : shippingAddressList) { a.validRequiredToCheckout(); } for (MonthlyInstallment m : monthlyInstallmentList) { @@ -106,43 +106,43 @@ public void validRequired() throws Exception { } } - public OrderConfigurer withBankInfoList(final List bankInfoList) { + public OrderClaim withBankInfoList(final List bankInfoList) { this.bankInfoList.addAll(bankInfoList); return this; } - public OrderConfigurer withBankInfoList(final PayConfigurer.Bank... bank) { + public OrderClaim withBankInfoList(final PayClaim.Bank... bank) { return withBankInfoList(Arrays.asList(bank)); } - public OrderConfigurer withPrivacyPolicyRequirements(String privacyPolicyRequirements) { + public OrderClaim withPrivacyPolicyRequirements(String privacyPolicyRequirements) { this.privacyPolicyRequirements = privacyPolicyRequirements; return this; } - public OrderConfigurer disableMainShippingAddressSetting() { + public OrderClaim disableMainShippingAddressSetting() { this.mainShippingAddressSettingDisabled = true; return this; } - public OrderConfigurer enableMainShippingAddressSetting() { + public OrderClaim enableMainShippingAddressSetting() { this.mainShippingAddressSettingDisabled = false; return this; } - public OrderConfigurer withShippingAddresses(PayConfigurer.ShippingAddress... shippingAddress) { + public OrderClaim withShippingAddresses(PayClaim.ShippingAddress... shippingAddress) { return withShippingAddresses(Arrays.asList(shippingAddress)); } - public OrderConfigurer withShippingAddresses(List shippingAddresses) { - for (PayConfigurer.ShippingAddress a : shippingAddresses) { + public OrderClaim withShippingAddresses(List shippingAddresses) { + for (PayClaim.ShippingAddress a : shippingAddresses) { a.validRequiredToCheckout(); } shippingAddressList.addAll(shippingAddresses); return this; } - public OrderConfigurer withProductPrice(int productPrice) { + public OrderClaim withProductPrice(int productPrice) { if (productPrice <= 0) { throw new IllegalArgumentException("Cannot be smaller than 0. Check yours input value : " + productPrice); } @@ -150,21 +150,21 @@ public OrderConfigurer withProductPrice(int productPrice) { return this; } - public OrderConfigurer withSubmallName(String submallName) { + public OrderClaim withSubmallName(String submallName) { this.submallName = submallName; return this; } - public OrderConfigurer withProductDeliveryInfo(ProductDeliveryInfo productDeliveryInfo) { + public OrderClaim withProductDeliveryInfo(ProductDeliveryInfo productDeliveryInfo) { this.productDeliveryInfo = productDeliveryInfo; return this; } - public OrderConfigurer withOffers(Offer... offer) { + public OrderClaim withOffers(Offer... offer) { return withOffers(Arrays.asList(offer)); } - public OrderConfigurer withOffers(List offers) { + public OrderClaim withOffers(List offers) { for (Offer o : offers) { o.validRequired(); } @@ -172,11 +172,11 @@ public OrderConfigurer withOffers(List offers) { return this; } - public OrderConfigurer withLoyalties(Loyalty... loyalty) { + public OrderClaim withLoyalties(Loyalty... loyalty) { return withLoyalties(Arrays.asList(loyalty)); } - public OrderConfigurer withLoyalties(List loyalties) { + public OrderClaim withLoyalties(List loyalties) { for (Loyalty l : loyalties) { l.validRequired(); } @@ -184,11 +184,11 @@ public OrderConfigurer withLoyalties(List loyalties) { return this; } - public OrderConfigurer withMonthlyInstallment(MonthlyInstallment... monthlyInstallment) { + public OrderClaim withMonthlyInstallment(MonthlyInstallment... monthlyInstallment) { return withMonthlyInstallment(Arrays.asList(monthlyInstallment)); } - public OrderConfigurer withMonthlyInstallment(List monthlyInstallments) { + public OrderClaim withMonthlyInstallment(List monthlyInstallments) { for (MonthlyInstallment s : monthlyInstallments) { s.validRequired(); } @@ -204,7 +204,7 @@ public List getLoyaltyList() { return Collections.unmodifiableList(loyaltyList); } - public List getShippingAddressList() { + public List getShippingAddressList() { return Collections.unmodifiableList(shippingAddressList); } @@ -279,7 +279,7 @@ public void validRequired() { public static final class ProductDeliveryInfo implements Serializable, Element { private static final long serialVersionUID = 2327522688494682416L; - private PayConfigurer.DeliveryType deliveryType; + private PayClaim.DeliveryType deliveryType; private String deliveryName; private boolean defaultDeliveryCostApplied; private boolean additionalDeliveryCostApplied; @@ -294,11 +294,11 @@ public ProductDeliveryInfo setShippingAddressDisplay(boolean shippingAddressDisp return this; } - public PayConfigurer.DeliveryType getDeliveryType() { + public PayClaim.DeliveryType getDeliveryType() { return deliveryType; } - public ProductDeliveryInfo setDeliveryType(PayConfigurer.DeliveryType deliveryType) { + public ProductDeliveryInfo setDeliveryType(PayClaim.DeliveryType deliveryType) { this.deliveryType = deliveryType; return this; } diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/PayConfigurer.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/PayClaim.java similarity index 89% rename from syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/PayConfigurer.java rename to syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/PayClaim.java index 5ed27b0..446348b 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/PayConfigurer.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/PayClaim.java @@ -34,7 +34,7 @@ * @author 임형태 * @since 1.0 */ -public final class PayConfigurer> extends AbstractTokenConfigurer, H> { +public final class PayClaim> extends AbstractTokenClaim, H> { private static final Set ISO_LANGUAGES = new HashSet(Arrays.asList(Locale.getISOLanguages())); private static final Set ISO_COUNTRIES = new HashSet(Arrays.asList(Locale.getISOCountries())); @@ -52,7 +52,7 @@ public CashReceiptDisplay getCashReceiptDisplay() { return cashReceiptDisplay; } - public PayConfigurer withCashReceiptDisplay(final CashReceiptDisplay cashReceiptDisplay) { + public PayClaim withCashReceiptDisplay(final CashReceiptDisplay cashReceiptDisplay) { this.cashReceiptDisplay = cashReceiptDisplay; return this; } @@ -83,12 +83,12 @@ public PaymentRestriction getPaymentRestrictions() { return paymentRestrictions; } - public PayConfigurer withOrderIdOfMerchant(final String orderId) { + public PayClaim withOrderIdOfMerchant(final String orderId) { mctTransAuthId = orderId; return this; } - public PayConfigurer withMerchantDefinedValue(final String merchantDefinedValue) { + public PayClaim withMerchantDefinedValue(final String merchantDefinedValue) { this.mctDefinedValue = merchantDefinedValue; return this; } @@ -104,12 +104,12 @@ public String getMerchanttDefinedValue() { return mctDefinedValue; } - public PayConfigurer withProductTitle(final String productTitle) { + public PayClaim withProductTitle(final String productTitle) { paymentInfo.productTitle = productTitle; return this; } - public PayConfigurer withProductUrls(final List productUrls) { + public PayClaim withProductUrls(final List productUrls) { for (String productDetail : productUrls) { if (!(productDetail.startsWith("http") || productDetail.startsWith("https"))) { throw new IllegalArgumentException("product details should be contained http or https urls. check your input!"); @@ -119,40 +119,40 @@ public PayConfigurer withProductUrls(final List productUrls) { return this; } - public PayConfigurer withProductUrls(final String... url) { + public PayClaim withProductUrls(final String... url) { return withProductUrls(Arrays.asList(url)); } - public PayConfigurer withBankInfoList(final List bankInfoList) { + public PayClaim withBankInfoList(final List bankInfoList) { paymentInfo.bankInfoList.addAll(bankInfoList); return this; } - public PayConfigurer withBankInfoList(final Bank... bank) { + public PayClaim withBankInfoList(final Bank... bank) { return withBankInfoList(Arrays.asList(bank)); } - public PayConfigurer withLanguageForDisplay(final Language l) { + public PayClaim withLanguageForDisplay(final Language l) { paymentInfo.lang = l.toString(); return this; } - public PayConfigurer withCurrency(final Currency c) { + public PayClaim withCurrency(final Currency c) { paymentInfo.currencyCode = c.toString(); return this; } - public PayConfigurer withShippingAddress(final ShippingAddress shippingAddress) { + public PayClaim withShippingAddress(final ShippingAddress shippingAddress) { paymentInfo.shippingAddress = shippingAddress.mapToStringForFds(); return this; } - public PayConfigurer withShippingAddress(final String shippingAddress) { + public PayClaim withShippingAddress(final String shippingAddress) { paymentInfo.shippingAddress = shippingAddress; return this; } - public PayConfigurer withAmount(final int paymentAmount) { + public PayClaim withAmount(final int paymentAmount) { if (paymentAmount <= 0) { throw new IllegalArgumentException("Cannot be smaller than 0. Check yours input value : " + paymentAmount); } @@ -160,59 +160,59 @@ public PayConfigurer withAmount(final int paymentAmount) { return this; } - public PayConfigurer withDeliveryPhoneNumber(final String deliveryPhoneNumber) { + public PayClaim withDeliveryPhoneNumber(final String deliveryPhoneNumber) { paymentInfo.deliveryPhoneNumber = deliveryPhoneNumber; return this; } - public PayConfigurer withDeliveryName(final String deliveryName) { + public PayClaim withDeliveryName(final String deliveryName) { paymentInfo.deliveryName = deliveryName; return this; } - public PayConfigurer withDeliveryType(final DeliveryType deliveryType) { + public PayClaim withDeliveryType(final DeliveryType deliveryType) { paymentInfo.deliveryType = deliveryType; return this; } - public PayConfigurer withBeAbleToExchangeToCash(final boolean exchangeable) { + public PayClaim withBeAbleToExchangeToCash(final boolean exchangeable) { paymentInfo.isExchangeable = exchangeable; return this; } - public PayConfigurer withInstallmentPerCardInformation(final List cards) { + public PayClaim withInstallmentPerCardInformation(final List cards) { paymentInfo.cardInfoList.addAll(cards); return this; } - public PayConfigurer withInstallmentPerCardInformation(final CardInstallmentInformation... card) { + public PayClaim withInstallmentPerCardInformation(final CardInstallmentInformation... card) { paymentInfo.cardInfoList.addAll(Arrays.asList(card)); return this; } - public PayConfigurer withRestrictionOf(final PayableLocaleRule r) { + public PayClaim withRestrictionOf(final PayableLocaleRule r) { paymentRestrictions.cardIssuerRegion = r.toCode(); return this; } @Deprecated - public PayConfigurer withPayableRuleWithCard(final PayableLocaleRule r) { + public PayClaim withPayableRuleWithCard(final PayableLocaleRule r) { paymentRestrictions.cardIssuerRegion = r.toCode(); return this; } - public PayConfigurer withRestrictionOf(final MatchedUser matchedUser) { + public PayClaim withRestrictionOf(final MatchedUser matchedUser) { paymentRestrictions.matchedUser = matchedUser; return this; } @Deprecated - public PayConfigurer withMatchedUser(final MatchedUser matchedUser) { + public PayClaim withMatchedUser(final MatchedUser matchedUser) { paymentRestrictions.matchedUser = matchedUser; return this; } - public PayConfigurer withRestrictionPaymentTypeOf(final String paymentType) { + public PayClaim withRestrictionPaymentTypeOf(final String paymentType) { paymentRestrictions.paymentType = paymentType; return this; } diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/SubscriptionConfigurer.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/SubscriptionClaim.java similarity index 83% rename from syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/SubscriptionConfigurer.java rename to syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/SubscriptionClaim.java index 4bebe18..e693507 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/SubscriptionConfigurer.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/claims/SubscriptionClaim.java @@ -31,19 +31,19 @@ * @author 임형태 * @since 1.3 */ -public class SubscriptionConfigurer> extends AbstractTokenConfigurer, H> { +public class SubscriptionClaim> extends AbstractTokenClaim, H> { private String autoPaymentId; private RegistrationRestrictions registrationRestrictions; private Plan plan; private String mctSubscriptionRequestId; private String promotionCode; - public SubscriptionConfigurer withAutoPaymentId(final String autoPaymentId) { + public SubscriptionClaim withAutoPaymentId(final String autoPaymentId) { this.autoPaymentId = autoPaymentId; return this; } - public SubscriptionConfigurer withRestrictionOf(final PayConfigurer.MatchedUser matchedUser) { + public SubscriptionClaim withRestrictionOf(final PayClaim.MatchedUser matchedUser) { if (registrationRestrictions == null) { registrationRestrictions = new RegistrationRestrictions(); } @@ -51,12 +51,12 @@ public SubscriptionConfigurer withRestrictionOf(final PayConfigurer.MatchedUs return this; } - public SubscriptionConfigurer with(final Plan plan) { + public SubscriptionClaim with(final Plan plan) { this.plan = plan; return this; } - public SubscriptionConfigurer withMerchantSubscriptionRequestId(String mctSubscriptionRequestId) { + public SubscriptionClaim withMerchantSubscriptionRequestId(String mctSubscriptionRequestId) { this.mctSubscriptionRequestId = mctSubscriptionRequestId; return this; } @@ -65,7 +65,7 @@ public String getPromotionCode() { return promotionCode; } - public SubscriptionConfigurer withPromotionCode(final String promotionCode) { + public SubscriptionClaim withPromotionCode(final String promotionCode) { this.promotionCode = promotionCode; return this; } @@ -87,7 +87,7 @@ public RegistrationRestrictions getRegistrationRestrictions() { return registrationRestrictions; } - public void setMatchedUser(final PayConfigurer.MatchedUser matchedUser) { + public void setMatchedUser(final PayClaim.MatchedUser matchedUser) { if (registrationRestrictions == null) { registrationRestrictions = new RegistrationRestrictions(); } @@ -105,9 +105,9 @@ public void validRequired() throws Exception { } public static class RegistrationRestrictions implements Serializable { - private PayConfigurer.MatchedUser matchedUser; + private PayClaim.MatchedUser matchedUser; - public PayConfigurer.MatchedUser getMatchedUser() { + public PayClaim.MatchedUser getMatchedUser() { return matchedUser; } } diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/SyrupPayToken.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/SyrupPayToken.java index 4f6a101..ef8ec37 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/SyrupPayToken.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/SyrupPayToken.java @@ -25,12 +25,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.skplanet.syruppay.token.ClaimConfigurer; import com.skplanet.syruppay.token.ClaimConfigurerAdapter; -import com.skplanet.syruppay.token.claims.MapToSktUserConfigurer; -import com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer; -import com.skplanet.syruppay.token.claims.MerchantUserConfigurer; -import com.skplanet.syruppay.token.claims.OrderConfigurer; -import com.skplanet.syruppay.token.claims.PayConfigurer; -import com.skplanet.syruppay.token.claims.SubscriptionConfigurer; +import com.skplanet.syruppay.token.claims.*; +import com.skplanet.syruppay.token.claims.MerchantUserClaim; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,17 +56,17 @@ public class SyrupPayToken implements Token { private Long nbf; private String sub; - private MerchantUserConfigurer loginInfo; - private PayConfigurer transactionInfo; - private MapToSyrupPayUserConfigurer userInfoMapper; - private MapToSktUserConfigurer lineInfo; - private OrderConfigurer checkoutInfo; - private SubscriptionConfigurer subscription; + private MerchantUserClaim loginInfo; + private PayClaim transactionInfo; + private MapToUserClaim userInfoMapper; + private MapToSktUserClaim lineInfo; + private OrderClaim checkoutInfo; + private SubscriptionClaim subscription; /** * {@inheritDoc} */ - public OrderConfigurer getCheckoutInfo() { + public OrderClaim getCheckoutInfo() { return checkoutInfo; } @@ -141,20 +137,20 @@ public String getSub() { /** * {@inheritDoc} */ - public MerchantUserConfigurer getLoginInfo() { + public MerchantUserClaim getLoginInfo() { return loginInfo; } /** * {@inheritDoc} */ - public PayConfigurer getTransactionInfo() { + public PayClaim getTransactionInfo() { return transactionInfo; } @Deprecated @JsonProperty("transactionInfo") - public void setTransactionInfo(PayConfigurer transactionInfo) { + public void setTransactionInfo(PayClaim transactionInfo) { if (this.transactionInfo != null && this.transactionInfo.getMctTransAuthId() == null && transactionInfo.getPaymentInfo().getProductTitle() == null) { LOGGER.warn("set only mctTransAuthId of transactionInfo element by deprecated method"); this.transactionInfo.withOrderIdOfMerchant(transactionInfo.getMctTransAuthId()); @@ -166,31 +162,31 @@ public void setTransactionInfo(PayConfigurer transactionInfo) { /** * {@inheritDoc} */ - public MapToSyrupPayUserConfigurer getUserInfoMapper() { + public MapToUserClaim getUserInfoMapper() { return userInfoMapper; } /** * {@inheritDoc} */ - public MapToSktUserConfigurer getLineInfo() { + public MapToSktUserClaim getLineInfo() { return lineInfo; } @Deprecated @JsonProperty("paymentInfo") - public void setPaymentInfo(PayConfigurer.PaymentInformationBySeller paymentInfo) { + public void setPaymentInfo(PayClaim.PaymentInformationBySeller paymentInfo) { if(transactionInfo == null) { LOGGER.warn("create transactionInfo to set payment information"); - transactionInfo = new PayConfigurer(); + transactionInfo = new PayClaim(); } LOGGER.warn("set paymentInfo element by deprecated method"); transactionInfo.withAmount(paymentInfo.getPaymentAmt()); - transactionInfo.withLanguageForDisplay(PayConfigurer.Language.valueOf(paymentInfo.getLang().toUpperCase())); + transactionInfo.withLanguageForDisplay(PayClaim.Language.valueOf(paymentInfo.getLang().toUpperCase())); transactionInfo.withShippingAddress(paymentInfo.getShippingAddress()); transactionInfo.withProductTitle(paymentInfo.getProductTitle()); transactionInfo.withProductUrls(paymentInfo.getProductUrls()); - transactionInfo.withCurrency(PayConfigurer.Currency.valueOf(paymentInfo.getCurrencyCode().toUpperCase())); + transactionInfo.withCurrency(PayClaim.Currency.valueOf(paymentInfo.getCurrencyCode().toUpperCase())); transactionInfo.withDeliveryName(paymentInfo.getDeliveryName()); transactionInfo.withDeliveryPhoneNumber(paymentInfo.getDeliveryPhoneNumber()); transactionInfo.withInstallmentPerCardInformation(paymentInfo.getCardInfoList()); @@ -198,20 +194,20 @@ public void setPaymentInfo(PayConfigurer.PaymentInformationBySeller paymentInfo) @Deprecated @JsonProperty("paymentRestrictions") - public void setPaymentRestrictions(PayConfigurer.PaymentRestriction paymentRestriction) { + public void setPaymentRestrictions(PayClaim.PaymentRestriction paymentRestriction) { if(transactionInfo == null) { LOGGER.warn("create transactionInfo to set payment restrictions"); - transactionInfo = new PayConfigurer(); + transactionInfo = new PayClaim(); } LOGGER.warn("set paymentRestrictions element by deprecated method"); - for (PayConfigurer.PayableLocaleRule r : PayConfigurer.PayableLocaleRule.values()) { + for (PayClaim.PayableLocaleRule r : PayClaim.PayableLocaleRule.values()) { if (r.toCode().equals(paymentRestriction.getCardIssuerRegion())) { transactionInfo.withPayableRuleWithCard(r); } } } - public SubscriptionConfigurer getSubscription() { + public SubscriptionClaim getSubscription() { return subscription; } @@ -257,7 +253,7 @@ private ClaimConfigurer getFieldOfClaimIfNotExistNull(final Claim c) throws Ille } public static enum Claim { - TO_SIGNUP(MerchantUserConfigurer.class), TO_LOGIN(MerchantUserConfigurer.class), TO_PAY(PayConfigurer.class), TO_CHECKOUT(OrderConfigurer.class), TO_MAP_USER(MapToSyrupPayUserConfigurer.class), TO_SUBSCRIPTION(SubscriptionConfigurer.class); + TO_SIGNUP(MerchantUserClaim.class), TO_LOGIN(MerchantUserClaim.class), TO_PAY(PayClaim.class), TO_CHECKOUT(OrderClaim.class), TO_MAP_USER(MapToUserClaim.class), TO_SUBSCRIPTION(SubscriptionClaim.class); Claim(Class configurer) { this.configurer = configurer; diff --git a/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/Token.java b/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/Token.java index edc23fe..63c0d91 100644 --- a/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/Token.java +++ b/syruppay-token/src/main/java/com/skplanet/syruppay/token/jwt/Token.java @@ -23,12 +23,8 @@ import com.skplanet.syruppay.token.ClaimConfigurer; import com.skplanet.syruppay.token.Builder; -import com.skplanet.syruppay.token.claims.MapToSktUserConfigurer; -import com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer; -import com.skplanet.syruppay.token.claims.MerchantUserConfigurer; -import com.skplanet.syruppay.token.claims.OrderConfigurer; -import com.skplanet.syruppay.token.claims.PayConfigurer; -import com.skplanet.syruppay.token.claims.SubscriptionConfigurer; +import com.skplanet.syruppay.token.claims.*; +import com.skplanet.syruppay.token.claims.OrderClaim; import java.io.Serializable; import java.util.List; @@ -43,23 +39,23 @@ public interface Token extends Serializable, JwtToken { /** * 가맹점의 사용자 정보를 인증(Authentication) 하기 위한 객체를 구성하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MerchantUserConfigurer} + * @return {@link MerchantUserClaim} */ - public MerchantUserConfigurer getLoginInfo(); + public MerchantUserClaim getLoginInfo(); /** * 거래(주문)에 대하여 결제를 시도하기 위한 객체를 구성하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.PayConfigurer} + * @return {@link PayClaim} */ - public PayConfigurer getTransactionInfo(); + public PayClaim getTransactionInfo(); /** * 시럽페이 사용자를 매칭하기 위한 객체를 구성하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer} + * @return {@link MapToUserClaim} */ - public MapToSyrupPayUserConfigurer getUserInfoMapper(); + public MapToUserClaim getUserInfoMapper(); /** * Expired Time 기준과 Not Before Time 을 기준하여 토큰이 유효한 시간 안에 있는지 여부를 검증하여 반환한다. @@ -71,18 +67,18 @@ public interface Token extends Serializable, JwtToken { /** * 가맹점 사용자가 가입된 SKT 통신회선의 가입 정보를 확인하기 위한 객체를 구성하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.MapToSktUserConfigurer} + * @return {@link MapToSktUserClaim} */ - public MapToSktUserConfigurer getLineInfo(); + public MapToSktUserClaim getLineInfo(); /** * 시럽페이 체크 아웃을 이용하기 위한 정보를 구성하여 반환한다. * - * @return {@link com.skplanet.syruppay.token.claims.OrderConfigurer} + * @return {@link OrderClaim} * @since 1.1 */ - public OrderConfigurer getCheckoutInfo(); + public OrderClaim getCheckoutInfo(); /** @@ -91,7 +87,7 @@ public interface Token extends Serializable, JwtToken { * @return the subscription * @since 1.3.4 */ - public SubscriptionConfigurer getSubscription(); + public SubscriptionClaim getSubscription(); /** * 시럽페이 토큰에 포함된 Claim 정보를 확인하여 반환한다. diff --git a/syruppay-token/src/test/java/com/skplanet/syruppay/token/TokenBuilderTest.java b/syruppay-token/src/test/java/com/skplanet/syruppay/token/TokenBuilderTest.java index 6eba5c7..4da73c7 100644 --- a/syruppay-token/src/test/java/com/skplanet/syruppay/token/TokenBuilderTest.java +++ b/syruppay-token/src/test/java/com/skplanet/syruppay/token/TokenBuilderTest.java @@ -64,9 +64,9 @@ package com.skplanet.syruppay.token; import com.fasterxml.jackson.databind.ObjectMapper; -import com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer; -import com.skplanet.syruppay.token.claims.PayConfigurer; -import com.skplanet.syruppay.token.claims.SubscriptionConfigurer; +import com.skplanet.syruppay.token.claims.MapToUserClaim; +import com.skplanet.syruppay.token.claims.PayClaim; +import com.skplanet.syruppay.token.claims.SubscriptionClaim; import com.skplanet.syruppay.token.domain.Mocks; import com.skplanet.syruppay.token.domain.TokenHistories; import com.skplanet.syruppay.token.jwt.SyrupPayToken; @@ -215,7 +215,7 @@ public void setUp() throws Exception { .withSsoCredential("SSO 를 발급 받았을 경우 입력") .and() .mapToUser() - .withType(MapToSyrupPayUserConfigurer.MappingType.CI_MAPPED_KEY) + .withType(MapToUserClaim.MappingType.CI_MAPPED_KEY) .withValue("4987234") .withIdentityAuthenticationId("bddb74b0-981f-4070-8c02-0cdf324f46f6"); // Optional // @formatter:on @@ -247,15 +247,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -308,15 +308,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") //.withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -333,15 +333,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) //.withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -358,15 +358,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(-1) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -383,15 +383,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(0) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -408,15 +408,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(500000) - //.withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + //.withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -433,15 +433,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") .withProductTitle("제품명") - //.withLanguageForDisplay(PayConfigurer.Language.KO) + //.withLanguageForDisplay(PayClaim.Language.KO) .withAmount(5550) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -458,15 +458,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("가맹점에서 관리하는 주문 ID") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(0) - .withCurrency(PayConfigurer.Currency.KRW) - //.withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + //.withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -483,15 +483,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("1234567890123456789012345678901234567890") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -508,15 +508,15 @@ public void setUp() throws Exception { .pay() .withOrderIdOfMerchant("12345678901234567890123456789012345678901") .withProductTitle("제품명") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -538,15 +538,15 @@ public void setUp() throws Exception { "\"id_1\": \"value\",\n" + "\"id_2\": 2\n" + "}") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -564,15 +564,15 @@ public void setUp() throws Exception { .withOrderIdOfMerchant("1234567890123456789012345678901234567890") .withProductTitle("제품명") .withProductUrls("h://www.11st.co.kr/product/SellerProductDetail.tmall?method=getSellerProductDetail&prdNo=1354119088&trTypeCd=22&trCtgrNo=895019") - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "KR")) .withDeliveryPhoneNumber("01011112222") .withDeliveryName("배송 수신자") - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) .withBeAbleToExchangeToCash(false) - .withPayableRuleWithCard(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) + .withPayableRuleWithCard(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) ; // @formatter:on // When @@ -592,7 +592,7 @@ public void setUp() throws Exception { .withExtraMerchantUserId("핸드폰과 같이 회원 별 추가 ID 체계가 존재할 경우 입력") .withSsoCredential("SSO 를 발급 받았을 경우 입력") .and() - .mapToUser().withType(MapToSyrupPayUserConfigurer.MappingType.CI_HASH).withValue("asdkfjhsakdfj") + .mapToUser().withType(MapToUserClaim.MappingType.CI_HASH).withValue("asdkfjhsakdfj") .and() .generateTokenBy("가맹점에게 전달한 비밀키"); // @formatter:on @@ -685,9 +685,9 @@ public void setUp() throws Exception { .and() .subscription() .withAutoPaymentId("시럽페이로부터 발급받은 자동결제 ID") // Optional - .withRestrictionOf(PayConfigurer.MatchedUser.CI_MATCHED_ONLY) // Optional + .withRestrictionOf(PayClaim.MatchedUser.CI_MATCHED_ONLY) // Optional .withMerchantSubscriptionRequestId("가맹점에서 다시 전달받을 ID 문자열") // Optional - .with(new SubscriptionConfigurer.Plan(SubscriptionConfigurer.Interval.WEEKLY, "결제명")) + .with(new SubscriptionClaim.Plan(SubscriptionClaim.Interval.WEEKLY, "결제명")) .withPromotionCode("PROMOTION_CODE_001") .and() .generateTokenBy("가맹점에게 전달한 비밀키"); @@ -731,7 +731,7 @@ public void setUp() throws Exception { .and() .subscription() .withAutoPaymentId("시럽페이로부터 발급받은 자동결제 ID") // Optional - .withRestrictionOf(PayConfigurer.MatchedUser.CI_MATCHED_ONLY) // Optional + .withRestrictionOf(PayClaim.MatchedUser.CI_MATCHED_ONLY) // Optional .and() .generateTokenBy("가맹점에게 전달한 비밀키"); // @formatter:on @@ -758,7 +758,7 @@ public void setUp() throws Exception { .and() .subscription() .withAutoPaymentId("시럽페이로부터 발급받은 자동결제 ID") // Optional - .withRestrictionOf(PayConfigurer.MatchedUser.CI_MATCHED_ONLY) // Optional + .withRestrictionOf(PayClaim.MatchedUser.CI_MATCHED_ONLY) // Optional .and() .generateTokenBy("가맹점에게 전달한 비밀키"); // @formatter:on @@ -784,8 +784,8 @@ public void setUp() throws Exception { .withSsoCredential("SSO 를 발급 받았을 경우 입력") .and() .mapToUser() - .withType(MapToSyrupPayUserConfigurer.MappingType.ENCRYPTED_PERSONAL_INFO) - .withValue(new MapToSyrupPayUserConfigurer.Personal("사용자", "1234567", "휴대폰번호"), "가맹점 ID", "가맹점에게 전달한 비밀") + .withType(MapToUserClaim.MappingType.ENCRYPTED_PERSONAL_INFO) + .withValue(new MapToUserClaim.Personal("사용자", "1234567", "휴대폰번호"), "가맹점 ID", "가맹점에게 전달한 비밀") .and() .generateTokenBy("가맹점에게 전달한 비밀키"); // @formatter:on @@ -831,23 +831,23 @@ public void setUp() throws Exception { .withSsoCredential("발급 받은 SSO") .and() .mapToUser() // Optional 사용자 개인정보를 이용하여 시럽페이 사용자와 동일 여부 검증 시 사용 - .withType(MapToSyrupPayUserConfigurer.MappingType.ENCRYPTED_PERSONAL_INFO) - .withValue(new MapToSyrupPayUserConfigurer.Personal() + .withType(MapToUserClaim.MappingType.ENCRYPTED_PERSONAL_INFO) + .withValue(new MapToUserClaim.Personal() .setUsername("홍길동") .setSsnFirst7Digit("8011221") .setLineNumber("01022223333") - .setOperatorCode(MapToSyrupPayUserConfigurer.OperatorCode.SKT) + .setOperatorCode(MapToUserClaim.OperatorCode.SKT) .setCiHash("HHHHHHAAAAAAAAAAAASSSSSSSSSSSSSSHHHHHHHHHHH") .setEmail("test@mail.com") .setPayableCard( - new MapToSyrupPayUserConfigurer.PayableCard() + new MapToUserClaim.PayableCard() .setCardNo("카드번호") .setExpireDate("202012") .setCardName("카드이름") .setCardIssuerName("발급사명") .setCardIssuer("발급사코드") .setCardAcquirer("매입사코드") - .setCardType(MapToSyrupPayUserConfigurer.CardType.CREDIT)) + .setCardType(MapToUserClaim.CardType.CREDIT)) , "가맹점 ID", "가맹점에 전달한 비밀키") .and() .pay() @@ -857,21 +857,21 @@ public void setUp() throws Exception { "http://deal.11st.co.kr/product/SellerProductDetail.tmall?method=getSellerProductDetail&prdNo=1122841340", "http://deal.11st.co.kr/product/SellerProductDetail.tmall?method=getSellerProductDetail&prdNo=1265508741" ) // Optional - .withLanguageForDisplay(PayConfigurer.Language.KO) + .withLanguageForDisplay(PayClaim.Language.KO) .withAmount(50000) - .withCurrency(PayConfigurer.Currency.KRW) - .withShippingAddress(new PayConfigurer.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "kr")) // Optional + .withCurrency(PayClaim.Currency.KRW) + .withShippingAddress(new PayClaim.ShippingAddress("137-332", "서초구 잠원동 하나아파트", "1동 1호", "서울", "", "kr")) // Optional .withDeliveryPhoneNumber("01011112222") // Optional .withDeliveryName("배송 수신자") // Optional - .withInstallmentPerCardInformation(new PayConfigurer.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) // Optional + .withInstallmentPerCardInformation(new PayClaim.CardInstallmentInformation("카드구분 코드", "할부정보. ex. NN1;NN2;YY3;YY4;YY5;NH6")) // Optional .withBeAbleToExchangeToCash(false) // Optional - .withRestrictionOf(PayConfigurer.PayableLocaleRule.ONLY_ALLOWED_KOR) // Optional + .withRestrictionOf(PayClaim.PayableLocaleRule.ONLY_ALLOWED_KOR) // Optional .withRestrictionPaymentTypeOf("CARD;MOBILE;BANK") // Optional .withMerchantDefinedValue("{" + "\"id_1\": \"value\"," + "\"id_2\": 2" + "}") // Optional, JSON 포맷 이용 시 Escape(\) 입력에 주의 필요, 1k 제한 - .withRestrictionOf(PayConfigurer.MatchedUser.CI_MATCHED_ONLY) // Optional. 가맹점과 시럽페이 사용자 동일 여부 확인 시에만 필요 + .withRestrictionOf(PayClaim.MatchedUser.CI_MATCHED_ONLY) // Optional. 가맹점과 시럽페이 사용자 동일 여부 확인 시에만 필요 .and() .generateTokenBy("가맹점의 전달한 비밀키"); // @formatter:on @@ -892,8 +892,8 @@ public void setUp() throws Exception { // @formatter:off String t = tokenBuilder.of("가맹점") .mapToUser() - .withType(MapToSyrupPayUserConfigurer.MappingType.ENCRYPTED_PERSONAL_INFO) - .withValue(new MapToSyrupPayUserConfigurer.Personal("사용자", "123456", "휴대폰번호"), "가맹점 ID", "가맹점에게 전달한 비밀") + .withType(MapToUserClaim.MappingType.ENCRYPTED_PERSONAL_INFO) + .withValue(new MapToUserClaim.Personal("사용자", "123456", "휴대폰번호"), "가맹점 ID", "가맹점에게 전달한 비밀") .and() .generateTokenBy("가맹점에게 전달한 비밀키"); // @formatter:on @@ -948,19 +948,19 @@ public void setUp() throws Exception { @Test(expected = AssertionError.class) public void 사용자_정보_Assert_테스트_SET_NULL_TO_사용자명() { - MapToSyrupPayUserConfigurer.Personal personal = new MapToSyrupPayUserConfigurer.Personal(); + MapToUserClaim.Personal personal = new MapToUserClaim.Personal(); personal.setUsername(null); } @Test(expected = AssertionError.class) public void 사용자_정보_Assert_테스트_SET_BLANK_TO_사용자명() { - MapToSyrupPayUserConfigurer.Personal personal = new MapToSyrupPayUserConfigurer.Personal(); + MapToUserClaim.Personal personal = new MapToUserClaim.Personal(); personal.setUsername(""); } @Test public void 사용자_정보_Assert_테스트_SET_HASH_TO_사용자명() { - MapToSyrupPayUserConfigurer.Personal personal = new MapToSyrupPayUserConfigurer.Personal(); + MapToUserClaim.Personal personal = new MapToUserClaim.Personal(); personal.setUsername("홍길동"); } @@ -993,7 +993,7 @@ public void setUp() throws Exception { // @formatter:off tokenBuilder.of("가맹점") .subscription() - .withRestrictionOf(PayConfigurer.MatchedUser.CI_MATCHED_ONLY) + .withRestrictionOf(PayClaim.MatchedUser.CI_MATCHED_ONLY) .and() .login() .withMerchantUserId("가맹점의 회원 ID 또는 식별자") @@ -1002,7 +1002,7 @@ public void setUp() throws Exception { .isNotApplicableSso() .and() .mapToUser() - .withType(MapToSyrupPayUserConfigurer.MappingType.CI_MAPPED_KEY) + .withType(MapToUserClaim.MappingType.CI_MAPPED_KEY) .withValue("21o39812093") ; diff --git a/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/MerchantUserConfigurerTest.java b/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/MerchantUserConfigurerTest.java index e1c6053..e48e67b 100644 --- a/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/MerchantUserConfigurerTest.java +++ b/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/MerchantUserConfigurerTest.java @@ -24,7 +24,7 @@ public void tearDown() throws Exception { @Test public void testSsoPolicy_equasl_with_null() { - assertThat(MerchantUserConfigurer.SsoPolicy.NOT_APPLICABLE.equals(null), is(false)); + assertThat(MerchantUserClaim.SsoPolicy.NOT_APPLICABLE.equals(null), is(false)); } } \ No newline at end of file diff --git a/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/PlanTest.java b/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/PlanTest.java index 89810da..7b12885 100644 --- a/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/PlanTest.java +++ b/syruppay-token/src/test/java/com/skplanet/syruppay/token/claims/PlanTest.java @@ -20,13 +20,13 @@ public void tearDown() throws Exception { @Test(expected = AssertionError.class) public void testContsruct_with_null() { - new SubscriptionConfigurer.Plan(null, null); + new SubscriptionClaim.Plan(null, null); } @Test(expected = AssertionError.class) public void testContsruct_with_empty() { - new SubscriptionConfigurer.Plan(SubscriptionConfigurer.Interval.ONDEMAND, ""); + new SubscriptionClaim.Plan(SubscriptionClaim.Interval.ONDEMAND, ""); } } \ No newline at end of file diff --git a/syruppay-token/src/test/java/com/skplanet/syruppay/token/domain/Mocks.java b/syruppay-token/src/test/java/com/skplanet/syruppay/token/domain/Mocks.java index e261e8b..c87af55 100644 --- a/syruppay-token/src/test/java/com/skplanet/syruppay/token/domain/Mocks.java +++ b/syruppay-token/src/test/java/com/skplanet/syruppay/token/domain/Mocks.java @@ -63,8 +63,8 @@ package com.skplanet.syruppay.token.domain; -import com.skplanet.syruppay.token.claims.OrderConfigurer; -import com.skplanet.syruppay.token.claims.PayConfigurer; +import com.skplanet.syruppay.token.claims.OrderClaim; +import com.skplanet.syruppay.token.claims.PayClaim; import java.util.ArrayList; import java.util.List; @@ -74,42 +74,42 @@ * @since 2015.10.20 */ public class Mocks { - public static List offerList = new ArrayList() {{ - add(new OrderConfigurer.Offer().setId("Offer-01").setName("기본할인").setAmountOff(1000).setUserSelectable(false).setOrderApplied(1)); - add(new OrderConfigurer.Offer().setId("Offer-02").setName("복수구매할인").setAmountOff(500).setUserSelectable(false).setOrderApplied(2)); - add(new OrderConfigurer.Offer().setId("Offer-03").setName("추가할인").setAmountOff(300).setUserSelectable(false).setOrderApplied(3)); - add(new OrderConfigurer.Offer().setId("Offer-04").setName("보너스할인").setAmountOff(700).setUserSelectable(false).setOrderApplied(4)); - add(new OrderConfigurer.Offer().setId("Offer-05").setName("임직원할인").setAmountOff(100).setUserSelectable(false).setOrderApplied(5)); - add(new OrderConfigurer.Offer().setId("Offer-06").setName("카드사할인").setAmountOff(1000).setUserSelectable(true).setOrderApplied(6)); - add(new OrderConfigurer.Offer().setId("Offer-07").setName("플러스쿠폰").setAmountOff(500).setUserSelectable(true).setOrderApplied(7)); - add(new OrderConfigurer.Offer().setId("Offer-08").setType(OrderConfigurer.OfferType.DELIVERY_COUPON).setName("배송비쿠폰").setAmountOff(2500).setUserSelectable(true).setOrderApplied(8)); + public static List offerList = new ArrayList() {{ + add(new OrderClaim.Offer().setId("Offer-01").setName("기본할인").setAmountOff(1000).setUserSelectable(false).setOrderApplied(1)); + add(new OrderClaim.Offer().setId("Offer-02").setName("복수구매할인").setAmountOff(500).setUserSelectable(false).setOrderApplied(2)); + add(new OrderClaim.Offer().setId("Offer-03").setName("추가할인").setAmountOff(300).setUserSelectable(false).setOrderApplied(3)); + add(new OrderClaim.Offer().setId("Offer-04").setName("보너스할인").setAmountOff(700).setUserSelectable(false).setOrderApplied(4)); + add(new OrderClaim.Offer().setId("Offer-05").setName("임직원할인").setAmountOff(100).setUserSelectable(false).setOrderApplied(5)); + add(new OrderClaim.Offer().setId("Offer-06").setName("카드사할인").setAmountOff(1000).setUserSelectable(true).setOrderApplied(6)); + add(new OrderClaim.Offer().setId("Offer-07").setName("플러스쿠폰").setAmountOff(500).setUserSelectable(true).setOrderApplied(7)); + add(new OrderClaim.Offer().setId("Offer-08").setType(OrderClaim.OfferType.DELIVERY_COUPON).setName("배송비쿠폰").setAmountOff(2500).setUserSelectable(true).setOrderApplied(8)); }}; - public static List loyalList = new ArrayList() {{ - add(new OrderConfigurer.Loyalty().setIdBy(OrderConfigurer.LoyaltyId.MILEAGE_OF_11ST).setName("마일리지").setSubscriberId("Loyalty-Sub-Id-02").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(500).setOrderApplied(1)); - add(new OrderConfigurer.Loyalty().setIdBy(OrderConfigurer.LoyaltyId.T_MEMBERSHIP).setName("T멤버쉽").setSubscriberId("Loyalty-Sub-Id-03").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(500).setOrderApplied(2)); - add(new OrderConfigurer.Loyalty().setIdBy(OrderConfigurer.LoyaltyId.POINT_OF_11ST).setName("포인트").setSubscriberId("Loyalty-Sub-Id-04").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(1000).setOrderApplied(3)); - add(new OrderConfigurer.Loyalty().setIdBy(OrderConfigurer.LoyaltyId.OK_CASHBAG).setName("OK캐쉬백").setSubscriberId("Loyalty-Sub-Id-05").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(10).setOrderApplied(4)); - OrderConfigurer.Loyalty errorLoyalty = new OrderConfigurer.Loyalty().setIdBy(OrderConfigurer.LoyaltyId.T_MEMBERSHIP).setName("T멤버쉽-에러상황").setSubscriberId("Loyalty-Sub-Id-06").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(1000).setOrderApplied(5); - errorLoyalty.setError(new OrderConfigurer.Error().setType(OrderConfigurer.ErrorType.MAINTENACE).setDescription("T멤버쉽이 정기점검중이므로 일시적으로 서비스를 이용할 수 없습니다. 잠시 후에 다시 이용해 주세요.")); + public static List loyalList = new ArrayList() {{ + add(new OrderClaim.Loyalty().setIdBy(OrderClaim.LoyaltyId.MILEAGE_OF_11ST).setName("마일리지").setSubscriberId("Loyalty-Sub-Id-02").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(500).setOrderApplied(1)); + add(new OrderClaim.Loyalty().setIdBy(OrderClaim.LoyaltyId.T_MEMBERSHIP).setName("T멤버쉽").setSubscriberId("Loyalty-Sub-Id-03").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(500).setOrderApplied(2)); + add(new OrderClaim.Loyalty().setIdBy(OrderClaim.LoyaltyId.POINT_OF_11ST).setName("포인트").setSubscriberId("Loyalty-Sub-Id-04").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(1000).setOrderApplied(3)); + add(new OrderClaim.Loyalty().setIdBy(OrderClaim.LoyaltyId.OK_CASHBAG).setName("OK캐쉬백").setSubscriberId("Loyalty-Sub-Id-05").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(10).setOrderApplied(4)); + OrderClaim.Loyalty errorLoyalty = new OrderClaim.Loyalty().setIdBy(OrderClaim.LoyaltyId.T_MEMBERSHIP).setName("T멤버쉽-에러상황").setSubscriberId("Loyalty-Sub-Id-06").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(1000).setOrderApplied(5); + errorLoyalty.setError(new OrderClaim.Error().setType(OrderClaim.ErrorType.MAINTENACE).setDescription("T멤버쉽이 정기점검중이므로 일시적으로 서비스를 이용할 수 없습니다. 잠시 후에 다시 이용해 주세요.")); add(errorLoyalty); - OrderConfigurer.Loyalty addDiscLoyalty = new OrderConfigurer.Loyalty().setIdBy(OrderConfigurer.LoyaltyId.OK_CASHBAG).setName("OK캐쉬백-추가할인").setSubscriberId("Loyalty-Sub-Id-01").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(10).setOrderApplied(6); - addDiscLoyalty.setAdditionalDiscount(new OrderConfigurer.AdditionalDiscount().setPercentOff(10).setMaxApplicableAmt(500)); + OrderClaim.Loyalty addDiscLoyalty = new OrderClaim.Loyalty().setIdBy(OrderClaim.LoyaltyId.OK_CASHBAG).setName("OK캐쉬백-추가할인").setSubscriberId("Loyalty-Sub-Id-01").setBalance(10000).setMaxApplicableAmt(3000).setInitialAppliedAmt(10).setOrderApplied(6); + addDiscLoyalty.setAdditionalDiscount(new OrderClaim.AdditionalDiscount().setPercentOff(10).setMaxApplicableAmt(500)); add(addDiscLoyalty); }}; - public static List shippingAddressList = new ArrayList() {{ - add(new PayConfigurer.ShippingAddress().setId("Shipping-Address-01").setName("회사").setCountryCode("KR").setZipCode("12345").setMainAddress("경기도 성남시 분당구 판교로264").setDetailAddress("더플래닛").setCity("성남시").setState("경기도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayConfigurer.DeliveryRestriction.NOT_FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(0).setOrderApplied(1)); - add(new PayConfigurer.ShippingAddress().setId("Shipping-Address-02").setName("집").setCountryCode("KR").setZipCode("12345").setMainAddress("경기도 성남시 분당구 판교로123").setDetailAddress("SK플래닛 2사옥").setCity("성남시").setState("경기도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayConfigurer.DeliveryRestriction.NOT_FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(0).setOrderApplied(2)); - add(new PayConfigurer.ShippingAddress().setId("Shipping-Address-03").setName("시골").setCountryCode("KR").setZipCode("56789").setMainAddress("강원도 삼척시 산골면 시골읍").setDetailAddress("판자집").setCity("삼척").setState("강원도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayConfigurer.DeliveryRestriction.FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(2500).setOrderApplied(3)); - add(new PayConfigurer.ShippingAddress().setId("Shipping-Address-04").setName("섬나라").setCountryCode("KR").setZipCode("98765").setMainAddress("제주도 서귀포시 제주면 제주읍").setDetailAddress("돌담집").setCity("서귀포").setState("제주도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayConfigurer.DeliveryRestriction.FAR_FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(5000).setOrderApplied(4)); + public static List shippingAddressList = new ArrayList() {{ + add(new PayClaim.ShippingAddress().setId("Shipping-Address-01").setName("회사").setCountryCode("KR").setZipCode("12345").setMainAddress("경기도 성남시 분당구 판교로264").setDetailAddress("더플래닛").setCity("성남시").setState("경기도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayClaim.DeliveryRestriction.NOT_FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(0).setOrderApplied(1)); + add(new PayClaim.ShippingAddress().setId("Shipping-Address-02").setName("집").setCountryCode("KR").setZipCode("12345").setMainAddress("경기도 성남시 분당구 판교로123").setDetailAddress("SK플래닛 2사옥").setCity("성남시").setState("경기도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayClaim.DeliveryRestriction.NOT_FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(0).setOrderApplied(2)); + add(new PayClaim.ShippingAddress().setId("Shipping-Address-03").setName("시골").setCountryCode("KR").setZipCode("56789").setMainAddress("강원도 삼척시 산골면 시골읍").setDetailAddress("판자집").setCity("삼척").setState("강원도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayClaim.DeliveryRestriction.FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(2500).setOrderApplied(3)); + add(new PayClaim.ShippingAddress().setId("Shipping-Address-04").setName("섬나라").setCountryCode("KR").setZipCode("98765").setMainAddress("제주도 서귀포시 제주면 제주읍").setDetailAddress("돌담집").setCity("서귀포").setState("제주도").setRecipientName("USER").setRecipientPhoneNumber("01012341234").setDeliveryRestriction(PayClaim.DeliveryRestriction.FAR_FAR_AWAY).setDefaultDeliveryCost(2500).setAdditionalDeliveryCost(5000).setOrderApplied(4)); }}; - public static List productDeliveryInfoList = new ArrayList() {{ - add(new OrderConfigurer.ProductDeliveryInfo().setDeliveryType(PayConfigurer.DeliveryType.PREPAID).setDeliveryName("선결제").setDefaultDeliveryCostApplied(true).setAdditionalDeliveryCostApplied(true)); - add(new OrderConfigurer.ProductDeliveryInfo().setDeliveryType(PayConfigurer.DeliveryType.FREE).setDeliveryName("무료배송").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(true)); - add(new OrderConfigurer.ProductDeliveryInfo().setDeliveryType(PayConfigurer.DeliveryType.DIY).setDeliveryName("방문수령").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(false)); - add(new OrderConfigurer.ProductDeliveryInfo().setDeliveryType(PayConfigurer.DeliveryType.QUICK).setDeliveryName("퀵서비스").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(false)); - add(new OrderConfigurer.ProductDeliveryInfo().setDeliveryType(PayConfigurer.DeliveryType.PAYMENT_ON_DELIVERY).setDeliveryName("착불").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(true)); + public static List productDeliveryInfoList = new ArrayList() {{ + add(new OrderClaim.ProductDeliveryInfo().setDeliveryType(PayClaim.DeliveryType.PREPAID).setDeliveryName("선결제").setDefaultDeliveryCostApplied(true).setAdditionalDeliveryCostApplied(true)); + add(new OrderClaim.ProductDeliveryInfo().setDeliveryType(PayClaim.DeliveryType.FREE).setDeliveryName("무료배송").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(true)); + add(new OrderClaim.ProductDeliveryInfo().setDeliveryType(PayClaim.DeliveryType.DIY).setDeliveryName("방문수령").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(false)); + add(new OrderClaim.ProductDeliveryInfo().setDeliveryType(PayClaim.DeliveryType.QUICK).setDeliveryName("퀵서비스").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(false)); + add(new OrderClaim.ProductDeliveryInfo().setDeliveryType(PayClaim.DeliveryType.PAYMENT_ON_DELIVERY).setDeliveryName("착불").setDefaultDeliveryCostApplied(false).setAdditionalDeliveryCostApplied(true)); }}; }