PPDataCollector.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // PPDataCollector.h
  3. // PayPalDataCollector
  4. //
  5. // Copyright © 2015 PayPal, Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "PPRMOCMagnesResult.h"
  9. /**
  10. Used to collect risk data via the PayPal data collector
  11. */
  12. @interface PPDataCollector : NSObject
  13. /**
  14. Returns a client metadata ID.
  15. @note This returns a raw client metadata ID, which is not the correct format for device data
  16. when creating a transaction. Instead, it is recommended to use `collectPayPalDeviceData`.
  17. @param pairingID a pairing ID to associate with this clientMetadataID must be 10-32 chars long or null
  18. @return a client metadata ID to send as a header
  19. */
  20. + (nonnull NSString *)clientMetadataID:(nullable NSString *)pairingID;
  21. /**
  22. Returns a client metadata ID.
  23. @note This returns a raw client metadata ID, which is not the correct format for device data
  24. when creating a transaction. Instead, it is recommended to use `collectPayPalDeviceData`.
  25. @return a client metadata ID to send as a header
  26. */
  27. + (nonnull NSString *)clientMetadataID DEPRECATED_MSG_ATTRIBUTE("Use [PPDataCollector collectPayPalDeviceData] to generate a device data string.");
  28. /**
  29. Collects device data for PayPal.
  30. This should be used when the user is paying with PayPal or Venmo only.
  31. @return a deviceData string that should be passed into server-side calls, such as `Transaction.sale`,
  32. for PayPal transactions. This JSON serialized string contains a PayPal fraud ID.
  33. */
  34. + (nonnull NSString *)collectPayPalDeviceData;
  35. /**
  36. For internal use only, returns an object with device data and clientMetadataID.
  37. @param clientMetadataID a pairing ID to associate with this clientMetadataID must be 10-32 chars long or null
  38. @return a nonnull Result with the device data
  39. */
  40. + (nonnull PPRMOCMagnesSDKResult *)collectPayPalDeviceInfoWithClientMetadataID:(nullable NSString *)clientMetadataID;
  41. @end