// Path: src/main/java/com/cardinity/rest/RestResource.java
// public abstract class RestResource {
// 
//     // @formatter:off
//     public static final Gson GSON = new GsonBuilder()
//             .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//             .registerTypeAdapter(Payment.class, new PaymentDeserializer())
//             .registerTypeAdapter(Card.class, new CardSerializer())
//             .registerTypeAdapter(Date.class, new UtcDateTypeAdapter())
//             .create();
//     // @formatter:on
// 
// 
//     public enum RequestMethod {
//         GET, PATCH, POST
//     }
// 
//     public enum Resource {
//         PAYMENTS, REFUNDS, SETTLEMENTS, VOIDS, CHARGEBACKS
//     }
// 
// }


import com.cardinity.rest.RestResource;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.util.Map;
import java.util.TreeMap;
package com.cardinity.oauth;



public final class CardinityOAuthProvider implements OAuthProvider {

    private static final String OAUTH_VERSION = "1.0";

    private static final SecureRandom RANDOM = new SecureRandom();

    private final OAuthSigner signer;

    private final String consumerKey;
    private final String consumerSecret;

    public CardinityOAuthProvider(String consumerKey, String consumerSecret) {
        this.signer = new HmacOAuthSigner();
        this.consumerKey = consumerKey;
        this.consumerSecret = consumerSecret;
    }

    @Override
    public String buildAuthorizationHeader(RestResource.RequestMethod requestMethod, String requestUrl) throws
            GeneralSecurityException, UnsupportedEncodingException {
        return buildAuthorizationHeader(requestMethod, requestUrl, null);
    }

    @Override
// Path: src/main/java/com/cardinity/rest/RestResource.java
// public abstract class RestResource {
// 
//     // @formatter:off
//     public static final Gson GSON = new GsonBuilder()
//             .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//             .registerTypeAdapter(Payment.class, new PaymentDeserializer())
//             .registerTypeAdapter(Card.class, new CardSerializer())
//             .registerTypeAdapter(Date.class, new UtcDateTypeAdapter())
//             .create();
//     // @formatter:on
// 
// 
//     public enum RequestMethod {
//         GET, PATCH, POST
//     }
// 
//     public enum Resource {
//         PAYMENTS, REFUNDS, SETTLEMENTS, VOIDS, CHARGEBACKS
//     }
// 
// }


// Path: src/main/java/com/cardinity/oauth/CardinityOAuthProvider.java
import com.cardinity.rest.RestResource;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.util.Map;
import java.util.TreeMap;

package com.cardinity.oauth;



public final class CardinityOAuthProvider implements OAuthProvider {

    private static final String OAUTH_VERSION = "1.0";

    private static final SecureRandom RANDOM = new SecureRandom();

    private final OAuthSigner signer;

    private final String consumerKey;
    private final String consumerSecret;

    public CardinityOAuthProvider(String consumerKey, String consumerSecret) {
        this.signer = new HmacOAuthSigner();
        this.consumerKey = consumerKey;
        this.consumerSecret = consumerSecret;
    }

    @Override
    public String buildAuthorizationHeader(RestResource.RequestMethod requestMethod, String requestUrl) throws
            GeneralSecurityException, UnsupportedEncodingException {
        return buildAuthorizationHeader(requestMethod, requestUrl, null);
    }

    @Override
    public String buildAuthorizationHeader(RestResource.RequestMethod requestMethod, String requestUrl, Map<String,