PayPalDataCollector/src/main/java/com/paypal/android/sdk/data/collector/PayPalDataCollector.java
@MainThread
    public static String getClientMetadataId(Context context, PayPalDataCollectorRequest request) {
        if (context == null) {
            return "";
        }

        MagnesSDK magnesInstance = MagnesSDK.getInstance();
        MagnesSettings.Builder magnesSettingsBuilder = new MagnesSettings.Builder(context)
                .setMagnesSource(MagnesSource.BRAINTREE)
                .disableBeacon(request.isDisableBeacon())
                .setMagnesEnvironment(Environment.LIVE)
                .setAppGuid(request.getApplicationGuid());

        magnesInstance.setUp(magnesSettingsBuilder.build());

        MagnesResult result = magnesInstance.collectAndSubmit(context, request.getClientMetadataId(), request.getAdditionalData());

        return result.getPaypalClientMetaDataId();
    }
@MainThread
    public static String getClientMetadataId(Context context, PayPalDataCollectorRequest request) {
        if (context == null) {
            return "";
        }

        MagnesSDK magnesInstance = MagnesSDK.getInstance();
        MagnesSettings.Builder magnesSettingsBuilder = new MagnesSettings.Builder(context)
                .setMagnesSource(MagnesSource.BRAINTREE)
                .disableBeacon(request.isDisableBeacon())
                .setMagnesEnvironment(Environment.LIVE)
                .setAppGuid(request.getApplicationGuid());

        magnesInstance.setUp(magnesSettingsBuilder.build());

        MagnesResult result = magnesInstance.collectAndSubmit(context, request.getClientMetadataId(), request.getAdditionalData());

        return result.getPaypalClientMetaDataId();
    }
@ MainThread public static String getClientMetadataId ( Context context , PayPalDataCollectorRequest request ) { if ( context == null ) { return "" ; } MagnesSDK magnesInstance = MagnesSDK . getInstance ( ) ; MagnesSettings . Builder magnesSettingsBuilder = new MagnesSettings . Builder ( context ) . setMagnesSource ( MagnesSource . BRAINTREE ) . disableBeacon ( request . isDisableBeacon ( ) ) . setMagnesEnvironment ( Environment . LIVE ) . setAppGuid ( request . getApplicationGuid ( ) ) ; magnesInstance . setUp ( magnesSettingsBuilder . build ( ) ) ; MagnesResult result = magnesInstance . collectAndSubmit ( context , request . getClientMetadataId ( ) , request . getAdditionalData ( ) ) ; return result . getPaypalClientMetaDataId ( ) ; }
Gets a Client Metadata ID at the time of payment activity. Once a user initiates a PayPal payment
from their device, PayPal uses the Client Metadata ID to verify that the payment is
originating from a valid, user-consented device and application. This helps reduce fraud and
decrease declines. This method MUST be called prior to initiating a pre-consented payment (a
"future payment") from a mobile device. Pass the result to your server, to include in the
payment request sent to PayPal. Do not otherwise cache or store this value.

@param context An Android context.
@param request configures what data to collect.
@return
Gets a Client Metadata ID at the time of payment activity . Once a user initiates a PayPal payment from their device PayPal uses the Client Metadata ID to verify that the payment is originating from a valid user - consented device and application . This helps reduce fraud and decrease declines . This method MUST be called prior to initiating a pre - consented payment ( a future payment ) from a mobile device . Pass the result to your server to include in the payment request sent to PayPal . Do not otherwise cache or store this value .