1 package com.srv4pos.server.api.infrastructure.credentials;
2
3 import com.srv4pos.server.api.infrastructure.http.HttpHelper;
4 import org.apache.commons.codec.binary.Base64;
5 import sun.rmi.server.Activation;
6
7 import static java.lang.String.format;
8
9
10
11
12
13
14 public class ActivationCredentials extends SellerCredentials {
15
16 private String apiKey;
17
18 public ActivationCredentials(String country, String corporateId, String apiKey) {
19 super(country, corporateId);
20 this.apiKey = apiKey;
21 }
22
23 public String getApiKey() {
24 return apiKey;
25 }
26
27
28
29
30
31
32 @Override
33 public String toAuthentication() {
34 return "Basic " + new String(Base64.encodeBase64(this.apiKey.getBytes(HttpHelper.CHARSET_FOR_TOKEN)), HttpHelper.CHARSET_UTF8);
35 }
36 }