Search in sources :

Example 1 with PayPalClient

use of org.pac4j.oauth.client.PayPalClient in project cas by apereo.

the class DelegatedClientFactory method configurePaypalClient.

/**
 * Configure paypal client.
 *
 * @param properties the properties
 */
protected void configurePaypalClient(final Collection<BaseClient> properties) {
    final Pac4jDelegatedAuthenticationProperties.Paypal paypal = pac4jProperties.getPaypal();
    if (StringUtils.isNotBlank(paypal.getId()) && StringUtils.isNotBlank(paypal.getSecret())) {
        final PayPalClient client = new PayPalClient(paypal.getId(), paypal.getSecret());
        configureClient(client, paypal);
        LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
        properties.add(client);
    }
}
Also used : PayPalClient(org.pac4j.oauth.client.PayPalClient) Pac4jDelegatedAuthenticationProperties(org.apereo.cas.configuration.model.support.pac4j.Pac4jDelegatedAuthenticationProperties)

Example 2 with PayPalClient

use of org.pac4j.oauth.client.PayPalClient in project cas by apereo.

the class DefaultDelegatedClientFactory method configurePayPalClient.

/**
 * Configure paypal client.
 *
 * @param properties the properties
 */
protected void configurePayPalClient(final Collection<IndirectClient> properties) {
    val pac4jProperties = casProperties.getAuthn().getPac4j();
    val paypal = pac4jProperties.getPaypal();
    if (paypal.isEnabled() && StringUtils.isNotBlank(paypal.getId()) && StringUtils.isNotBlank(paypal.getSecret())) {
        val client = new PayPalClient(paypal.getId(), paypal.getSecret());
        configureClient(client, paypal);
        LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
        properties.add(client);
    }
}
Also used : lombok.val(lombok.val) PayPalClient(org.pac4j.oauth.client.PayPalClient)

Example 3 with PayPalClient

use of org.pac4j.oauth.client.PayPalClient in project cas by apereo.

the class Pac4jAuthenticationEventExecutionPlanConfiguration method configurePaypalClient.

private void configurePaypalClient(final Collection<BaseClient> properties) {
    final Pac4jProperties.Paypal paypal = casProperties.getAuthn().getPac4j().getPaypal();
    if (StringUtils.isNotBlank(paypal.getId()) && StringUtils.isNotBlank(paypal.getSecret())) {
        final PayPalClient client = new PayPalClient(paypal.getId(), paypal.getSecret());
        properties.add(client);
    }
}
Also used : PayPalClient(org.pac4j.oauth.client.PayPalClient) Pac4jProperties(org.apereo.cas.configuration.model.support.pac4j.Pac4jProperties)

Example 4 with PayPalClient

use of org.pac4j.oauth.client.PayPalClient in project pac4j by pac4j.

the class RunPaypalClient method getClient.

@Override
protected IndirectClient getClient() {
    final PayPalClient payPalClient = new PayPalClient("ARQFlBAOdRsb1NhZlutHT_PORP2F-TQpU-Laz-osaBwAHUIBIdg-C8DEsTWY", "EAMZPBBfYJGeCBHYkm30xqC-VZ1kePnWZzPLdXyzY43rh-q0OQUH5eucXI6R");
    payPalClient.setCallbackUrl(PAC4J_BASE_URL);
    return payPalClient;
}
Also used : PayPalClient(org.pac4j.oauth.client.PayPalClient)

Aggregations

PayPalClient (org.pac4j.oauth.client.PayPalClient)4 lombok.val (lombok.val)1 Pac4jDelegatedAuthenticationProperties (org.apereo.cas.configuration.model.support.pac4j.Pac4jDelegatedAuthenticationProperties)1 Pac4jProperties (org.apereo.cas.configuration.model.support.pac4j.Pac4jProperties)1