package com.cyksj.service.paypal;

import com.paypal.core.PayPalEnvironment;
import com.paypal.core.PayPalHttpClient;

/**
 * @author zwhui
 * @date 2025/2/14 11:32
 */
public class PayPalClient {


    public PayPalHttpClient client(String mode, String clientId, String clientSecret) {
        PayPalEnvironment environment = mode.equals("live") ? new PayPalEnvironment.Live(clientId, clientSecret) : new PayPalEnvironment.Sandbox(clientId, clientSecret);
        return new PayPalHttpClient(environment);
    }
}
