Search in sources :

Example 1 with MetadataBuilder

use of com.braintreepayments.api.models.MetadataBuilder in project braintree_android by braintree.

the class Venmo method getLaunchIntent.

static Intent getLaunchIntent(VenmoConfiguration venmoConfiguration, String profileId, BraintreeFragment fragment) {
    Intent venmoIntent = getVenmoIntent().putExtra(EXTRA_MERCHANT_ID, profileId).putExtra(EXTRA_ACCESS_TOKEN, venmoConfiguration.getAccessToken()).putExtra(EXTRA_ENVIRONMENT, venmoConfiguration.getEnvironment());
    try {
        JSONObject braintreeData = new JSONObject();
        JSONObject meta = new MetadataBuilder().sessionId(fragment.getSessionId()).integration(fragment.getIntegrationType()).version().build();
        braintreeData.put(META_KEY, meta);
        venmoIntent.putExtra(EXTRA_BRAINTREE_DATA, braintreeData.toString());
    } catch (JSONException ignored) {
    }
    return venmoIntent;
}
Also used : JSONObject(org.json.JSONObject) MetadataBuilder(com.braintreepayments.api.models.MetadataBuilder) JSONException(org.json.JSONException) Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)1 MetadataBuilder (com.braintreepayments.api.models.MetadataBuilder)1 JSONException (org.json.JSONException)1 JSONObject (org.json.JSONObject)1