Package org.pac4j.oauth.profile.paypal

Examples of org.pac4j.oauth.profile.paypal.PayPalProfile


        kryo.register(PayPalAddress.class);
    }
   
    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final PayPalProfile profile = (PayPalProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        assertEquals("YAxf5WKSFn4BG_l3wqcBJUSObQTG1Aww5FY0EDf_ccw", profile.getId());
        assertEquals(PayPalProfile.class.getSimpleName() + UserProfile.SEPARATOR
                     + "YAxf5WKSFn4BG_l3wqcBJUSObQTG1Aww5FY0EDf_ccw", profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), PayPalProfile.class));
        assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
        assertCommonProfile(userProfile, "testscribeup@gmail.com", "Test", "ScribeUP", "Test ScribeUP", null,
                            Gender.UNSPECIFIED, Locale.FRANCE, null, null, "Europe/Berlin");
        final PayPalAddress address = profile.getAddress();
        assertEquals("FR", address.getCountry());
        assertEquals("Paris", address.getLocality());
        assertEquals("75001", address.getPostalCode());
        assertEquals("Adr1", address.getStreetAddress());
        final Locale language = profile.getLanguage();
        assertEquals(Locale.FRANCE, language);
        assertEquals(9, profile.getAttributes().size());
    }
View Full Code Here


        return "https://api.paypal.com/v1/identity/openidconnect/userinfo?schema=openid";
    }
   
    @Override
    protected PayPalProfile extractUserProfile(final String body) {
        final PayPalProfile profile = new PayPalProfile();
        final JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            final String userId = (String) JsonHelper.get(json, "user_id");
            profile.setId(StringUtils.substringAfter(userId, "/user/"));
            for (final String attribute : OAuthAttributesDefinitions.payPalDefinition.getAllAttributes()) {
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));
            }
        }
        return profile;
    }
View Full Code Here

TOP

Related Classes of org.pac4j.oauth.profile.paypal.PayPalProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.