|
| 1 | +/* |
| 2 | + * ###### |
| 3 | + * ###### |
| 4 | + * ############ ####( ###### #####. ###### ############ ############ |
| 5 | + * ############# #####( ###### #####. ###### ############# ############# |
| 6 | + * ###### #####( ###### #####. ###### ##### ###### ##### ###### |
| 7 | + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### |
| 8 | + * ###### ###### #####( ###### #####. ###### ##### ##### ###### |
| 9 | + * ############# ############# ############# ############# ##### ###### |
| 10 | + * ############ ############ ############# ############ ##### ###### |
| 11 | + * ###### |
| 12 | + * ############# |
| 13 | + * ############ |
| 14 | + * |
| 15 | + * Adyen Java API Library |
| 16 | + * |
| 17 | + * Copyright (c) 2019 Adyen B.V. |
| 18 | + * This file is open source and available under the MIT license. |
| 19 | + * See the LICENSE file for more info. |
| 20 | + */ |
| 21 | +package com.adyen.model.terminal; |
| 22 | + |
| 23 | +import com.adyen.model.applicationinfo.ApplicationInfo; |
| 24 | +import com.google.gson.Gson; |
| 25 | +import com.google.gson.GsonBuilder; |
| 26 | +import org.apache.commons.codec.binary.Base64; |
| 27 | + |
| 28 | +import java.util.Map; |
| 29 | +import java.util.Objects; |
| 30 | + |
| 31 | +public class SaleToAcquirerData { |
| 32 | + |
| 33 | + private Map<String, String> metadata; |
| 34 | + private String shopperEmail; |
| 35 | + private String shopperReference; |
| 36 | + private String recurringContract; |
| 37 | + private String shopperStatement; |
| 38 | + private String recurringDetailName; |
| 39 | + private String recurringTokenService; |
| 40 | + private String store; |
| 41 | + private String merchantAccount; |
| 42 | + private String currency; |
| 43 | + private ApplicationInfo applicationInfo; |
| 44 | + private String tenderOption; |
| 45 | + private Map<String, String> additionalData; |
| 46 | + private static final Gson PRETTY_PRINT_GSON = new GsonBuilder().setPrettyPrinting().create(); |
| 47 | + |
| 48 | + public SaleToAcquirerData() { |
| 49 | + if (this.applicationInfo == null) { |
| 50 | + this.applicationInfo = new ApplicationInfo(); |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + public Map<String, String> getMetadata() { |
| 55 | + return metadata; |
| 56 | + } |
| 57 | + |
| 58 | + public void setMetadata(Map<String, String> metadata) { |
| 59 | + this.metadata = metadata; |
| 60 | + } |
| 61 | + |
| 62 | + public String getShopperEmail() { |
| 63 | + return shopperEmail; |
| 64 | + } |
| 65 | + |
| 66 | + public void setShopperEmail(String shopperEmail) { |
| 67 | + this.shopperEmail = shopperEmail; |
| 68 | + } |
| 69 | + |
| 70 | + public String getShopperReference() { |
| 71 | + return shopperReference; |
| 72 | + } |
| 73 | + |
| 74 | + public void setShopperReference(String shopperReference) { |
| 75 | + this.shopperReference = shopperReference; |
| 76 | + } |
| 77 | + |
| 78 | + public String getRecurringContract() { |
| 79 | + return recurringContract; |
| 80 | + } |
| 81 | + |
| 82 | + public void setRecurringContract(String recurringContract) { |
| 83 | + this.recurringContract = recurringContract; |
| 84 | + } |
| 85 | + |
| 86 | + public String getShopperStatement() { |
| 87 | + return shopperStatement; |
| 88 | + } |
| 89 | + |
| 90 | + public void setShopperStatement(String shopperStatement) { |
| 91 | + this.shopperStatement = shopperStatement; |
| 92 | + } |
| 93 | + |
| 94 | + public String getRecurringDetailName() { |
| 95 | + return recurringDetailName; |
| 96 | + } |
| 97 | + |
| 98 | + public void setRecurringDetailName(String recurringDetailName) { |
| 99 | + this.recurringDetailName = recurringDetailName; |
| 100 | + } |
| 101 | + |
| 102 | + public String getRecurringTokenService() { |
| 103 | + return recurringTokenService; |
| 104 | + } |
| 105 | + |
| 106 | + public void setRecurringTokenService(String recurringTokenService) { |
| 107 | + this.recurringTokenService = recurringTokenService; |
| 108 | + } |
| 109 | + |
| 110 | + public String getStore() { |
| 111 | + return store; |
| 112 | + } |
| 113 | + |
| 114 | + public void setStore(String store) { |
| 115 | + this.store = store; |
| 116 | + } |
| 117 | + |
| 118 | + public String getMerchantAccount() { |
| 119 | + return merchantAccount; |
| 120 | + } |
| 121 | + |
| 122 | + public void setMerchantAccount(String merchantAccount) { |
| 123 | + this.merchantAccount = merchantAccount; |
| 124 | + } |
| 125 | + |
| 126 | + public String getCurrency() { |
| 127 | + return currency; |
| 128 | + } |
| 129 | + |
| 130 | + public void setCurrency(String currency) { |
| 131 | + this.currency = currency; |
| 132 | + } |
| 133 | + |
| 134 | + public ApplicationInfo getApplicationInfo() { |
| 135 | + return applicationInfo; |
| 136 | + } |
| 137 | + |
| 138 | + public void setApplicationInfo(ApplicationInfo applicationInfo) { |
| 139 | + this.applicationInfo = applicationInfo; |
| 140 | + } |
| 141 | + |
| 142 | + public String getTenderOption() { |
| 143 | + return tenderOption; |
| 144 | + } |
| 145 | + |
| 146 | + public void setTenderOption(String tenderOption) { |
| 147 | + this.tenderOption = tenderOption; |
| 148 | + } |
| 149 | + |
| 150 | + public Map<String, String> getAdditionalData() { |
| 151 | + return additionalData; |
| 152 | + } |
| 153 | + |
| 154 | + public void setAdditionalData(Map<String, String> additionalData) { |
| 155 | + this.additionalData = additionalData; |
| 156 | + } |
| 157 | + |
| 158 | + @Override |
| 159 | + public boolean equals(Object o) { |
| 160 | + if (this == o) { |
| 161 | + return true; |
| 162 | + } |
| 163 | + if (o == null || getClass() != o.getClass()) { |
| 164 | + return false; |
| 165 | + } |
| 166 | + SaleToAcquirerData that = (SaleToAcquirerData) o; |
| 167 | + return Objects.equals(metadata, that.metadata) && |
| 168 | + Objects.equals(shopperEmail, that.shopperEmail) && |
| 169 | + Objects.equals(shopperReference, that.shopperReference) && |
| 170 | + Objects.equals(recurringContract, that.recurringContract) && |
| 171 | + Objects.equals(shopperStatement, that.shopperStatement) && |
| 172 | + Objects.equals(recurringDetailName, that.recurringDetailName) && |
| 173 | + Objects.equals(recurringTokenService, that.recurringTokenService) && |
| 174 | + Objects.equals(store, that.store) && |
| 175 | + Objects.equals(merchantAccount, that.merchantAccount) && |
| 176 | + Objects.equals(currency, that.currency) && |
| 177 | + Objects.equals(applicationInfo, that.applicationInfo) && |
| 178 | + Objects.equals(tenderOption, that.tenderOption) && |
| 179 | + Objects.equals(additionalData, that.additionalData); |
| 180 | + } |
| 181 | + |
| 182 | + @Override |
| 183 | + public int hashCode() { |
| 184 | + return Objects.hash(metadata, shopperEmail, shopperReference, recurringContract, shopperStatement, recurringDetailName, recurringTokenService, store, merchantAccount, currency, applicationInfo, tenderOption, additionalData); |
| 185 | + } |
| 186 | + |
| 187 | + @Override |
| 188 | + public String toString() { |
| 189 | + return "SaleToAcquirerDataModel{" + |
| 190 | + "metadata=" + metadata + |
| 191 | + ", shopperEmail='" + shopperEmail + '\'' + |
| 192 | + ", shopperReference='" + shopperReference + '\'' + |
| 193 | + ", recurringContract='" + recurringContract + '\'' + |
| 194 | + ", shopperStatement='" + shopperStatement + '\'' + |
| 195 | + ", recurringDetailName='" + recurringDetailName + '\'' + |
| 196 | + ", recurringTokenService='" + recurringTokenService + '\'' + |
| 197 | + ", store='" + store + '\'' + |
| 198 | + ", merchantAccount='" + merchantAccount + '\'' + |
| 199 | + ", currency='" + currency + '\'' + |
| 200 | + ", applicationInfo=" + applicationInfo + |
| 201 | + ", tenderOption='" + tenderOption + '\'' + |
| 202 | + ", additionalData=" + additionalData + |
| 203 | + '}'; |
| 204 | + } |
| 205 | + |
| 206 | + public String toBase64() { |
| 207 | + String json = PRETTY_PRINT_GSON.toJson(this); |
| 208 | + return new String(Base64.encodeBase64(json.getBytes())); |
| 209 | + } |
| 210 | +} |
0 commit comments