0
PayPal’s New Android SDK:Kicking Ass With PaymentsTim MesserschmidtDroidcon Paris 2013
This talk will be about-  What is PayPal?-  Log In with PayPal-  PayPal Android SDK
Who Am I?Tim Messerschmidt,Developer Evangelistworking for PayPal.Android Developerliving in Berlin.I ♥ Java, Ruby, CSS3,H...
What is PayPal?
Enablemerchants tosell onlineWhat is PayPal?
Enablecustomers tobuy onlineWhat is PayPal?
Payment ScenarioSender ReceiverTransaction
eCommerceSender ReceiverTransactionItem /Service
SecureEasyFastRequirements
128mactive usersWhat is PayPal?
193countries & regionsWhat is PayPal?
25supported currenciesWhat is PayPal?
80localized websitesWhat is PayPal?
Francefully supportedWhat is PayPal?
Local MerchantsBig Mac Menu:-  Fries-  Ketchup-  Water... keeping it healthy
Painless Payments for DroidsTim MesserschmidtIdentity
Login with...Google Facebook Twitter
... or PayPal.Login with...
NameEmailDate of BirthLocaleTime ZoneAddressGenderLanguagePhone NumberVerified AccountCreation DateYour Identity
Log In viaPayPal in thebrowser or aWebView.
Log In with PayPalAuthorization &Authentication
Log In with PayPalOAuth 2.0 &OpenID Connect
No need to (re-)enteryour password afterlogging inSeamless Checkout
Painless Payments for DroidsTim MesserschmidtSummarizing Identity
Painless Payments for DroidsTim MesserschmidtMoney
Lots Of Money
Painless Payments for DroidsTim MesserschmidtDigital Goods
Physical Goods
Physical Goods
2 waysBackend or via SDKUsing PayPal
Android SDKSample App:•  Sell a football jersey•  Fast Checkout•  Nice Interface
Present theproduct & allowto purchase itAndroid SDK
Allow to pay viaPayPal or CardAndroid SDK
The user entershis credentials:•  Email•  PasswordAndroid SDK
The user needsto confirm hispayment...Android SDK
... and will bepresented aconfirmation ofhis purchaseafterwards.Android SDK
That’s nice... BUT:What if the userdoesn’t want to usePayPal or doesn’thave an account?
Accept creditcards in yourapplicationmanually or...Android SDK
... via imagerecognitiontechnology inyour app!Android SDK
ImplementationIn 10 minutesHow-to
<!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandro...
<!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandro...
<!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandro...
<!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandro...
<serviceandroid:name="com.paypal.android.sdk.payments.PayPalService"android:exported="false"/><activityandroid:name="com.p...
<serviceandroid:name="com.paypal.android.sdk.payments.PayPalService"android:exported="false"/><activityandroid:name="com.p...
<serviceandroid:name="com.paypal.android.sdk.payments.PayPalService"android:exported="false"/><activityandroid:name="com.p...
// Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMEN...
// Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMEN...
// Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMEN...
// Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMEN...
@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activ...
@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activ...
PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(...
PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(...
PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(...
PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(...
PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(...
@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_...
@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_...
@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_...
@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_...
@Overridepublic void onDestroy() {stopService(new Intent(this, PayPalService.class));super.onDestroy();}How-toYour Activit...
Your app needs tocommunicate witha server to verifypaymentsVerifying Payments
Criteria to use toverify payments:bit.ly/19FIis6Verifying Payments
{"proof_of_payment": {"rest_api": {"state": "approved","payment_id": "API-PAYMENT-ID-1843"}},"payment": {"short_descriptio...
{"proof_of_payment": {"rest_api": {"state": "approved","payment_id": "API-PAYMENT-ID-1843"}},"payment": {"short_descriptio...
Somebody did thatwork for you:bit.ly/19FHQdeVerifying Payments
Android StudioGradle doesn’tsupportbundling .sofiles with yourapk yet
US onlyEurope coming soon!Important
Documentationdeveloper.paypal.comInformation
Open SourceGitHub.com/paypalInformation
Questions?
Thanks!Tim Messerschmidt@SeraAndroidtmesserschmidt@paypal.comSlideShare.com/paypal
Droidcon Paris: The new Android SDK
Droidcon Paris: The new Android SDK
Upcoming SlideShare
Loading in...5
×

Droidcon Paris: The new Android SDK

1,369

Published on

This speech was held by Tim Messerschmidt at Droidcon Paris 2013.

Published in: Technology, Economy & Finance
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,369
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
7
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Droidcon Paris: The new Android SDK"

  1. 1. PayPal’s New Android SDK:Kicking Ass With PaymentsTim MesserschmidtDroidcon Paris 2013
  2. 2. This talk will be about-  What is PayPal?-  Log In with PayPal-  PayPal Android SDK
  3. 3. Who Am I?Tim Messerschmidt,Developer Evangelistworking for PayPal.Android Developerliving in Berlin.I ♥ Java, Ruby, CSS3,HTML5 & JavaScript!
  4. 4. What is PayPal?
  5. 5. Enablemerchants tosell onlineWhat is PayPal?
  6. 6. Enablecustomers tobuy onlineWhat is PayPal?
  7. 7. Payment ScenarioSender ReceiverTransaction
  8. 8. eCommerceSender ReceiverTransactionItem /Service
  9. 9. SecureEasyFastRequirements
  10. 10. 128mactive usersWhat is PayPal?
  11. 11. 193countries & regionsWhat is PayPal?
  12. 12. 25supported currenciesWhat is PayPal?
  13. 13. 80localized websitesWhat is PayPal?
  14. 14. Francefully supportedWhat is PayPal?
  15. 15. Local MerchantsBig Mac Menu:-  Fries-  Ketchup-  Water... keeping it healthy
  16. 16. Painless Payments for DroidsTim MesserschmidtIdentity
  17. 17. Login with...Google Facebook Twitter
  18. 18. ... or PayPal.Login with...
  19. 19. NameEmailDate of BirthLocaleTime ZoneAddressGenderLanguagePhone NumberVerified AccountCreation DateYour Identity
  20. 20. Log In viaPayPal in thebrowser or aWebView.
  21. 21. Log In with PayPalAuthorization &Authentication
  22. 22. Log In with PayPalOAuth 2.0 &OpenID Connect
  23. 23. No need to (re-)enteryour password afterlogging inSeamless Checkout
  24. 24. Painless Payments for DroidsTim MesserschmidtSummarizing Identity
  25. 25. Painless Payments for DroidsTim MesserschmidtMoney
  26. 26. Lots Of Money
  27. 27. Painless Payments for DroidsTim MesserschmidtDigital Goods
  28. 28. Physical Goods
  29. 29. Physical Goods
  30. 30. 2 waysBackend or via SDKUsing PayPal
  31. 31. Android SDKSample App:•  Sell a football jersey•  Fast Checkout•  Nice Interface
  32. 32. Present theproduct & allowto purchase itAndroid SDK
  33. 33. Allow to pay viaPayPal or CardAndroid SDK
  34. 34. The user entershis credentials:•  Email•  PasswordAndroid SDK
  35. 35. The user needsto confirm hispayment...Android SDK
  36. 36. ... and will bepresented aconfirmation ofhis purchaseafterwards.Android SDK
  37. 37. That’s nice... BUT:What if the userdoesn’t want to usePayPal or doesn’thave an account?
  38. 38. Accept creditcards in yourapplicationmanually or...Android SDK
  39. 39. ... via imagerecognitiontechnology inyour app!Android SDK
  40. 40. ImplementationIn 10 minutesHow-to
  41. 41. <!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandroid:name="android.hardware.camera.autofocus”android:required="false" /><!–- Permissions --><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE" /><uses-permissionandroid:name="android.permission.INTERNET" /><!-- card.io scanning --><uses-permissionandroid:name="android.permission.CAMERA" /><uses-permissionandroid:name="android.permission.VIBRATE" />How-toAndroidManifest.xml:
  42. 42. <!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandroid:name="android.hardware.camera.autofocus”android:required="false" /><!–- Permissions --><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE" /><uses-permissionandroid:name="android.permission.INTERNET" /><!-- card.io scanning --><uses-permissionandroid:name="android.permission.CAMERA" /><uses-permissionandroid:name="android.permission.VIBRATE" />How-toAndroidManifest.xml:
  43. 43. <!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandroid:name="android.hardware.camera.autofocus”android:required="false" /><!–- Permissions --><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE" /><uses-permissionandroid:name="android.permission.INTERNET" /><!-- card.io scanning --><uses-permissionandroid:name="android.permission.CAMERA" /><uses-permissionandroid:name="android.permission.VIBRATE" />How-toAndroidManifest.xml:
  44. 44. <!-- Hardware features --><uses-featureandroid:name="android.hardware.camera”android:required="false" /><uses-featureandroid:name="android.hardware.camera.autofocus”android:required="false" /><!–- Permissions --><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE" /><uses-permissionandroid:name="android.permission.INTERNET" /><!-- card.io scanning --><uses-permissionandroid:name="android.permission.CAMERA" /><uses-permissionandroid:name="android.permission.VIBRATE" />How-toAndroidManifest.xml:
  45. 45. <serviceandroid:name="com.paypal.android.sdk.payments.PayPalService"android:exported="false"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentActivity"/><activityandroid:name="com.paypal.android.sdk.payments.LoginActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentMethodActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentConfirmActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentCompletedActivity"/><activityandroid:name="io.card.payment.CardIOActivity"android:configChanges="keyboardHidden|orientation"/><activityandroid:name="io.card.payment.DataEntryActivity"/>How-toAndroidManifest.xml:
  46. 46. <serviceandroid:name="com.paypal.android.sdk.payments.PayPalService"android:exported="false"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentActivity"/><activityandroid:name="com.paypal.android.sdk.payments.LoginActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentMethodActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentConfirmActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentCompletedActivity"/><activityandroid:name="io.card.payment.CardIOActivity"android:configChanges="keyboardHidden|orientation"/><activityandroid:name="io.card.payment.DataEntryActivity"/>How-toAndroidManifest.xml:
  47. 47. <serviceandroid:name="com.paypal.android.sdk.payments.PayPalService"android:exported="false"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentActivity"/><activityandroid:name="com.paypal.android.sdk.payments.LoginActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentMethodActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentConfirmActivity"/><activityandroid:name="com.paypal.android.sdk.payments.PaymentCompletedActivity"/><activityandroid:name="io.card.payment.CardIOActivity"android:configChanges="keyboardHidden|orientation"/><activityandroid:name="io.card.payment.DataEntryActivity"/>How-toAndroidManifest.xml:
  48. 48. // Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMENT =PaymentActivity.ENVIRONMENT_NO_NETWORK;// note that these credentials will differ between live & sandbox environments.private static final String CONFIG_CLIENT_ID ="credential from developer.paypal.com";// when testing in sandbox, this is likely the -facilitator email address.private static final String CONFIG_RECEIVER_EMAIL ="your@email.com";How-toYour Activity:Define your credentials and Environment first.
  49. 49. // Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMENT =PaymentActivity.ENVIRONMENT_NO_NETWORK;// note that these credentials will differ between live & sandbox environments.private static final String CONFIG_CLIENT_ID ="credential from developer.paypal.com";// when testing in sandbox, this is likely the -facilitator email address.private static final String CONFIG_RECEIVER_EMAIL ="your@email.com";How-toYour Activity:Define your credentials and Environment first.
  50. 50. // Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMENT =PaymentActivity.ENVIRONMENT_NO_NETWORK;// note that these credentials will differ between live & sandbox environments.private static final String CONFIG_CLIENT_ID ="credential from developer.paypal.com";// when testing in sandbox, this is likely the -facilitator email address.private static final String CONFIG_RECEIVER_EMAIL ="your@email.com";How-toYour Activity:Define your credentials and Environment first.
  51. 51. // Can be NO_NETWORK for OFFLINE, SANDBOX for TESTING and LIVE for PRODUCTIONprivate static final String CONFIG_ENVIRONMENT =PaymentActivity.ENVIRONMENT_NO_NETWORK;// note that these credentials will differ between live & sandbox environments.private static final String CONFIG_CLIENT_ID ="credential from developer.paypal.com";// when testing in sandbox, this is likely the -facilitator email address.private static final String CONFIG_RECEIVER_EMAIL ="your@email.com";How-toYour Activity:Define your credentials and Environment first.
  52. 52. @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// your code hereIntent intent = new Intent(this, PayPalService.class);intent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT);intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID);intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL);startService(intent);}How-toYour Activity:Start the PayPal-Service in your onCreate( ) method
  53. 53. @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// your code hereIntent intent = new Intent(this, PayPalService.class);intent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT);intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID);intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL);startService(intent);}How-toYour Activity:Start the PayPal-Service in your onCreate( ) method
  54. 54. PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(this, PaymentActivity.class);intent.putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy);intent.putExtra(PaymentActivity.EXTRA_PAYER_ID, "myPayer");// Repeat passing the credentialsintent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT);intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID);intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL);startActivityForResult(intent, PAYMENT_REQUEST);How-toYour Activity:Start the payment itself via a button or something similar
  55. 55. PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(this, PaymentActivity.class);intent.putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy);intent.putExtra(PaymentActivity.EXTRA_PAYER_ID, "myPayer");// Repeat passing the credentialsintent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT);intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID);intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL);startActivityForResult(intent, PAYMENT_REQUEST);How-toYour Activity:Start the payment itself via a button or something similar
  56. 56. PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(this, PaymentActivity.class);intent.putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy);intent.putExtra(PaymentActivity.EXTRA_PAYER_ID, "myPayer");// Repeat passing the credentialsintent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT);intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID);intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL);startActivityForResult(intent, PAYMENT_REQUEST);How-toYour Activity:Start the payment itself via a button or something similar
  57. 57. PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(this, PaymentActivity.class);intent.putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy);intent.putExtra(PaymentActivity.EXTRA_PAYER_ID, "myPayer");// Repeat passing the credentialsintent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT);intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID);intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL);startActivityForResult(intent, PAYMENT_REQUEST);How-toYour Activity:Start the payment itself via a button or something similar
  58. 58. PayPalPayment thingToBuy =new PayPalPayment(new BigDecimal(“59.99"), "USD", "Paris SG Jersey");Intent intent = new Intent(this, PaymentActivity.class);intent.putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy);intent.putExtra(PaymentActivity.EXTRA_PAYER_ID, "myPayer");// Repeat passing the credentialsintent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT);intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID);intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL);startActivityForResult(intent, PAYMENT_REQUEST);How-toYour Activity:Start the payment itself via a button or something similar
  59. 59. @Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_OK) {PaymentConfirmation confirm =data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);if (confirm != null) {verifyPayment(confirm);}} else if (resultCode == Activity.RESULT_CANCELED) {// Show the user that this got canceled} else if (resultCode == PaymentActivity.RESULT_PAYMENT_INVALID) {// Check the docs ;)}}How-toYour Activity:Check the result after the user used PayPal
  60. 60. @Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_OK) {PaymentConfirmation confirm =data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);if (confirm != null) {verifyPayment(confirm);}} else if (resultCode == Activity.RESULT_CANCELED) {// Show the user that this got canceled} else if (resultCode == PaymentActivity.RESULT_PAYMENT_INVALID) {// Check the docs ;)}}How-toYour Activity:Check the result after the user used PayPal
  61. 61. @Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_OK) {PaymentConfirmation confirm =data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);if (confirm != null) {verifyPayment(confirm);}} else if (resultCode == Activity.RESULT_CANCELED) {// Show the user that this got canceled} else if (resultCode == PaymentActivity.RESULT_PAYMENT_INVALID) {// Check the docs ;)}}How-toYour Activity:Check the result after the user used PayPal
  62. 62. @Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_OK) {PaymentConfirmation confirm =data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);if (confirm != null) {verifyPayment(confirm);}} else if (resultCode == Activity.RESULT_CANCELED) {// Show the user that this got canceled} else if (resultCode == PaymentActivity.RESULT_PAYMENT_INVALID) {// Check the docs ;)}}How-toYour Activity:Check the result after the user used PayPal
  63. 63. @Overridepublic void onDestroy() {stopService(new Intent(this, PayPalService.class));super.onDestroy();}How-toYour Activity:Stop your service in the lifecycle’s onDestroy( ) method to make sure it ends nicelyand doesn’t use unneeded resources.
  64. 64. Your app needs tocommunicate witha server to verifypaymentsVerifying Payments
  65. 65. Criteria to use toverify payments:bit.ly/19FIis6Verifying Payments
  66. 66. {"proof_of_payment": {"rest_api": {"state": "approved","payment_id": "API-PAYMENT-ID-1843"}},"payment": {"short_description": "Paris SG Jersey","amount": ”59.99","currency_code": "USD"},"client": {"platform": "Android","paypal_sdk_version": "1.0.2","environment": "live","product_name": "PayPal Android SDK"}}Verifying PaymentsREST-API proof of payment: Adaptive Payments proof of payment:{"proof_of_payment": {"adaptive_payment": {"pay_key": "AP-70M68096ML426802W","payment_exec_status": "COMPLETED","timestamp": "2013-02-20T00:26:25Z","app_id": "APP-91B933855X481767M"}},"payment": {"short_description": "Paris SG Shirt","amount": "59.99","currency_code": "USD"},"client": {"platform": "Android","paypal_sdk_version": "1.0.2","environment": "live","product_name": "PayPal Android SDK"}}
  67. 67. {"proof_of_payment": {"rest_api": {"state": "approved","payment_id": "API-PAYMENT-ID-1843"}},"payment": {"short_description": "Paris SG Jersey","amount": ”59.99","currency_code": "USD"},"client": {"platform": "Android","paypal_sdk_version": "1.0.2","environment": "live","product_name": "PayPal Android SDK"}}Verifying PaymentsREST-API proof of payment: Adaptive Payments proof of payment:{"proof_of_payment": {"adaptive_payment": {"pay_key": "AP-70M68096ML426802W","payment_exec_status": "COMPLETED","timestamp": "2013-02-20T00:26:25Z","app_id": "APP-91B933855X481767M"}},"payment": {"short_description": "Paris SG Shirt","amount": "59.99","currency_code": "USD"},"client": {"platform": "Android","paypal_sdk_version": "1.0.2","environment": "live","product_name": "PayPal Android SDK"}}
  68. 68. Somebody did thatwork for you:bit.ly/19FHQdeVerifying Payments
  69. 69. Android StudioGradle doesn’tsupportbundling .sofiles with yourapk yet
  70. 70. US onlyEurope coming soon!Important
  71. 71. Documentationdeveloper.paypal.comInformation
  72. 72. Open SourceGitHub.com/paypalInformation
  73. 73. Questions?
  74. 74. Thanks!Tim Messerschmidt@SeraAndroidtmesserschmidt@paypal.comSlideShare.com/paypal
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×