SlideShare a Scribd company logo
1 of 47
Download to read offline
Developer
Painless Payments for Droids
Tim Messerschmidt
Painless Payments for Droids
Tim Messerschmidt
Log In with PayPal



   The Artist
formerly known
   as access
Log In with PayPal




   Authentication
Log In with PayPal




    Authorization
Log In with PayPal




     OAuth 2.0 &
   OpenID Connect
Log In with PayPal

           Client                          Server
1.  Open Authorization          2.  Provide a login page
    Endpoint URL                3.  Return the Authorization
4.  Check callbacks for             Token after a successful
    Authorization Token             login
5.  Request a valid Access      6.  Check Authorization Token
    Token                           & return the Access Token
7.  Retrieve user’s resources       if it’s valid
Log In with PayPal


   NAME                  Date of Birth
                                           Creation Date
               EMAIL            Language

                     Gender          Locale
   Time Zone
         Phone Number             Address
                     Verified
Painless Payments for Droids
Tim Messerschmidt
Painless Payments for Droids
Tim Messerschmidt
Painless Payments for Droids
Tim Messerschmidt
Simple Payment




                 10 €
       Sender           Receiver
Parallel Payment


                   20 €




                   10 €
       Sender
Chained Payment


                    20 €
            100 €
                           30 €


                    10 €
1 transaction
Mobile Payments Library




          Download
           the SDK
Mobile Payments Library




  API Credentials
      At x.com
Mobile Payments Library




  Sandbox APP ID:
  APP-80W284485P519543T
Mobile Payments Library




   Add The .JAR To
    Your Project
Mobile Payments Library




         Modify the
          Manifest
Mobile Payments Library


Adding the PayPal Activity:
<activity
  	android:name="com.paypal.android.MEP.PayPalActivity"	
  	android:configChanges="keyboardHidden|orientation" />


Best to be used with a translucent Theme
android:theme="@android:style/Theme.Translucent.NoTitleBar"	
  
Mobile Payments Library

DECLARING THE NEEDED PERMISSIONS:
Internet
<uses-permission
  	android:name="android.permission.INTERNET" />	

READ Phone state
<uses-permission
  	android:name="android.permission.READ_PHONE_STATE" />


Access Wifi State
<uses-permission	
  	android:name="android.permission.ACCESS_WIFI_STATE" />
Mobile Payments Library




      Initialize The
         Library
Mobile Payments Library

new Thread() {	
 	public void run() {	
 	 	instance = PayPal.getInstance();	
 	 	if (instance == null) {	
 	 	 	instance = PayPal.initWithAppID(	
 	 	 	 	context,	
 	 	 	 	ID, // YOUR APP'S ID	
 	 	 	 	PayPal.ENV_SANDBOX	
 	 	 	);	
 	 	}	
 	}	
}.start();	
  
Mobile Payments Library




         Create the
          PAYMENT
Mobile Payments Library

Simple Payment:
PayPalPayment payment = new PayPalPayment();	
payment.setRecipient("foo@bar.com");	
payment.setCurrencyType("USD");	
payment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);	
payment.setSubtotal(new BigDecimal(”29.99"));	
	
PayPalInvoiceItem item = new PayPalInvoiceItem();	
item.setName("Hipster T-Shirt");	
item.setQuantity(1);	
item.setTotalPrice(new BigDecimal(”29.99"));	
	
PayPalInvoiceData data = new PayPalInvoiceData();	
data.add(item);	
payment.setInvoiceData(data);	
  
Mobile Payments Library

Parallel Payment:
PayPalAdvancedPayment payment = new PayPalAdvancedPayment();	
payment.setCurrencyType("USD");	
	
PayPalReceiverDetails firstReceiver =	
  	new PayPalReceiverDetails();	
firstReceiver.setRecipient("first@bar.com");	
firstReceiver.setSubtotal(new BigDecimal("10.00"));	
	
PayPalReceiverDetails secondReceiver =	
  	new PayPalReceiverDetails();	
secondReceiver.setRecipient("second@bar.com");	
secondReceiver.setSubtotal(new BigDecimal("20.00"));	
	
payment.getReceivers().add(firstReceiver);	
payment.getReceivers().add(secondReceiver);	
  
Mobile Payments Library




       Execute The
         Payment
Mobile Payments Library

GET THE INTENT:
Intent payIntent =	
 	instance.checkout(invoice, context);	
startActivityForResult(payIntent, REQUEST);	
  

Can be used with a Delegate instead
Intent payIntent =	
 	instance.checkout(	
 	 	invoice, context, delegate	
 	);	
startActivity(payIntent);	
  
Mobile Payments Library

Receive the result:
protected void onActivityResult(	
  	int requestCode, int resultCode, Intent data) {	
  	 	if (requestCode == REQUEST) {	
  	 	 	switch (resultCode) {	
  	 	 	 	case Activity.RESULT_OK:	
  	 	 	 	 	showText("Success");	
  	 	 	 	 	break;	
  	 	 	 	case Activity.RESULT_CANCELED:	
  	 	 	 	 	showText("Canceled");	
  	 	 	 	 	break;	
  	 	 	 	case PayPalActivity.RESULT_FAILURE:	
  	 	 	 	 	showText("Failure");	
  	 	 	 	 	break;	
  	 	 	}	
  	 	}	
  	}	
  
Mobile Payments Library




       Advantage:
      Intent-based
Mobile Payments Library




Use IPN to update
   your stock
Mobile Payments Library

Verify Payments:
payment.setIpnUrl("http://example.com/callback.php");	
  


                            POST
             PayPal                 Server

            Server                   PayPal
Mobile Payments Library




                  CODE
Droidcon DE 2013
Droidcon DE 2013
Droidcon DE 2013
Droidcon DE 2013
Droidcon DE 2013
Droidcon DE 2013

More Related Content

Similar to Droidcon DE 2013

2012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML52012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML5Jonathan LeBlanc
 
Monetizing your apps with PayPal API:s
Monetizing your apps with PayPal API:sMonetizing your apps with PayPal API:s
Monetizing your apps with PayPal API:sDisruptive Code
 
Monetize with PayPal X Payments Platform
Monetize with PayPal X Payments PlatformMonetize with PayPal X Payments Platform
Monetize with PayPal X Payments Platformguest72b121
 
HTML5 Gaming Payment Platforms
HTML5 Gaming Payment PlatformsHTML5 Gaming Payment Platforms
HTML5 Gaming Payment PlatformsJonathan LeBlanc
 
One Gateway for All Kinds of Payments—the Payflow Integration
One Gateway for All Kinds of Payments—the Payflow IntegrationOne Gateway for All Kinds of Payments—the Payflow Integration
One Gateway for All Kinds of Payments—the Payflow IntegrationPayPalX Developer Network
 
Barcelona Developers Conference 2011
Barcelona Developers Conference 2011Barcelona Developers Conference 2011
Barcelona Developers Conference 2011PayPal
 
Monetizing your Applications with PayPal X Payments Platform
Monetizing your Applications withPayPal X Payments PlatformMonetizing your Applications withPayPal X Payments Platform
Monetizing your Applications with PayPal X Payments PlatformPayPalX Developer Network
 
The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016Robert Nyman
 
The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016Robert Nyman
 
Paypal REST api ( Japanese version )
Paypal REST api ( Japanese version )Paypal REST api ( Japanese version )
Paypal REST api ( Japanese version )Yoshi Sakai
 
The recurring nightmare - Rosa Gutierrez - Codemotion Amsterdam 2016
The recurring nightmare  - Rosa Gutierrez - Codemotion Amsterdam 2016The recurring nightmare  - Rosa Gutierrez - Codemotion Amsterdam 2016
The recurring nightmare - Rosa Gutierrez - Codemotion Amsterdam 2016Codemotion
 
Active Merchant
Active MerchantActive Merchant
Active MerchantJohn Ward
 
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split Payments
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split PaymentsAdaptive Payments: Changing How We Pay with PIN, Pre-approved and Split Payments
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split PaymentsPayPalX Developer Network
 
PayPal Dev Con 2009 Driving Business
PayPal Dev Con 2009 Driving BusinessPayPal Dev Con 2009 Driving Business
PayPal Dev Con 2009 Driving BusinessAduci
 
Seedhack 2012 FIn Tech
Seedhack 2012 FIn TechSeedhack 2012 FIn Tech
Seedhack 2012 FIn TechPayPal
 
Integration of payment gateways using Paypal account
Integration of payment gateways using Paypal account Integration of payment gateways using Paypal account
Integration of payment gateways using Paypal account Phenom People
 
Srikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce Mobile
Srikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce MobileSrikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce Mobile
Srikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce MobileSrikanth Nandiraju
 

Similar to Droidcon DE 2013 (20)

2012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML52012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML5
 
Hacking with PayPal
Hacking with PayPalHacking with PayPal
Hacking with PayPal
 
Monetizing your apps with PayPal API:s
Monetizing your apps with PayPal API:sMonetizing your apps with PayPal API:s
Monetizing your apps with PayPal API:s
 
Monetize with PayPal X Payments Platform
Monetize with PayPal X Payments PlatformMonetize with PayPal X Payments Platform
Monetize with PayPal X Payments Platform
 
HTML5 Gaming Payment Platforms
HTML5 Gaming Payment PlatformsHTML5 Gaming Payment Platforms
HTML5 Gaming Payment Platforms
 
One Gateway for All Kinds of Payments—the Payflow Integration
One Gateway for All Kinds of Payments—the Payflow IntegrationOne Gateway for All Kinds of Payments—the Payflow Integration
One Gateway for All Kinds of Payments—the Payflow Integration
 
Barcelona Developers Conference 2011
Barcelona Developers Conference 2011Barcelona Developers Conference 2011
Barcelona Developers Conference 2011
 
Monetizing your Applications with PayPal X Payments Platform
Monetizing your Applications withPayPal X Payments PlatformMonetizing your Applications withPayPal X Payments Platform
Monetizing your Applications with PayPal X Payments Platform
 
The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016
 
The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016
 
Paypal REST api ( Japanese version )
Paypal REST api ( Japanese version )Paypal REST api ( Japanese version )
Paypal REST api ( Japanese version )
 
The recurring nightmare - Rosa Gutierrez - Codemotion Amsterdam 2016
The recurring nightmare  - Rosa Gutierrez - Codemotion Amsterdam 2016The recurring nightmare  - Rosa Gutierrez - Codemotion Amsterdam 2016
The recurring nightmare - Rosa Gutierrez - Codemotion Amsterdam 2016
 
Active Merchant
Active MerchantActive Merchant
Active Merchant
 
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split Payments
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split PaymentsAdaptive Payments: Changing How We Pay with PIN, Pre-approved and Split Payments
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split Payments
 
PayPal Dev Con 2009 Driving Business
PayPal Dev Con 2009 Driving BusinessPayPal Dev Con 2009 Driving Business
PayPal Dev Con 2009 Driving Business
 
Seedhack 2012 FIn Tech
Seedhack 2012 FIn TechSeedhack 2012 FIn Tech
Seedhack 2012 FIn Tech
 
Integration of payment gateways using Paypal account
Integration of payment gateways using Paypal account Integration of payment gateways using Paypal account
Integration of payment gateways using Paypal account
 
Payments Anywhere with PayPal
Payments Anywhere with PayPalPayments Anywhere with PayPal
Payments Anywhere with PayPal
 
Using the GSMA OneAPI Gateway
Using the GSMA OneAPI GatewayUsing the GSMA OneAPI Gateway
Using the GSMA OneAPI Gateway
 
Srikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce Mobile
Srikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce MobileSrikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce Mobile
Srikanth Nandiraju: Monetize Your Mobile Apps Using Titanium Commerce Mobile
 

More from PayPal

PayPal's Private Cloud @ Scale
PayPal's Private Cloud @ ScalePayPal's Private Cloud @ Scale
PayPal's Private Cloud @ ScalePayPal
 
Kraken Front-Trends
Kraken Front-TrendsKraken Front-Trends
Kraken Front-TrendsPayPal
 
Kraken
KrakenKraken
KrakenPayPal
 
Death To Passwords Droid Edition
Death To Passwords Droid EditionDeath To Passwords Droid Edition
Death To Passwords Droid EditionPayPal
 
Future Of Payments
Future Of PaymentsFuture Of Payments
Future Of PaymentsPayPal
 
The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...
The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...
The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...PayPal
 
Death To Passwords
Death To PasswordsDeath To Passwords
Death To PasswordsPayPal
 
KrakenJS
KrakenJSKrakenJS
KrakenJSPayPal
 
Battle Hack London Intro
Battle Hack London IntroBattle Hack London Intro
Battle Hack London IntroPayPal
 
Authentication for Droids
Authentication for DroidsAuthentication for Droids
Authentication for DroidsPayPal
 
Concrete indentity really getting to know your users
Concrete indentity   really getting to know your usersConcrete indentity   really getting to know your users
Concrete indentity really getting to know your usersPayPal
 
Online Identity: Getting to know your users
Online Identity: Getting to know your usersOnline Identity: Getting to know your users
Online Identity: Getting to know your usersPayPal
 
Mobile payments at Droidcon Eastern Europe
Mobile payments at Droidcon Eastern EuropeMobile payments at Droidcon Eastern Europe
Mobile payments at Droidcon Eastern EuropePayPal
 
Reinvigorating Stagnant Innovation Through Your Developer Network
Reinvigorating Stagnant Innovation Through Your Developer NetworkReinvigorating Stagnant Innovation Through Your Developer Network
Reinvigorating Stagnant Innovation Through Your Developer NetworkPayPal
 
The Profitable Startup
The Profitable StartupThe Profitable Startup
The Profitable StartupPayPal
 
Startup Highway Workshop
Startup Highway WorkshopStartup Highway Workshop
Startup Highway WorkshopPayPal
 
Berlin Battle hack presentation
Berlin Battle hack presentationBerlin Battle hack presentation
Berlin Battle hack presentationPayPal
 
From Good To Great
From Good To GreatFrom Good To Great
From Good To GreatPayPal
 
Hack & Tell
Hack & TellHack & Tell
Hack & TellPayPal
 
Payments for the REST of us
Payments for the REST of usPayments for the REST of us
Payments for the REST of usPayPal
 

More from PayPal (20)

PayPal's Private Cloud @ Scale
PayPal's Private Cloud @ ScalePayPal's Private Cloud @ Scale
PayPal's Private Cloud @ Scale
 
Kraken Front-Trends
Kraken Front-TrendsKraken Front-Trends
Kraken Front-Trends
 
Kraken
KrakenKraken
Kraken
 
Death To Passwords Droid Edition
Death To Passwords Droid EditionDeath To Passwords Droid Edition
Death To Passwords Droid Edition
 
Future Of Payments
Future Of PaymentsFuture Of Payments
Future Of Payments
 
The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...
The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...
The web can do that better - My adventure with HTML5 Vide, WebRTC and Shared ...
 
Death To Passwords
Death To PasswordsDeath To Passwords
Death To Passwords
 
KrakenJS
KrakenJSKrakenJS
KrakenJS
 
Battle Hack London Intro
Battle Hack London IntroBattle Hack London Intro
Battle Hack London Intro
 
Authentication for Droids
Authentication for DroidsAuthentication for Droids
Authentication for Droids
 
Concrete indentity really getting to know your users
Concrete indentity   really getting to know your usersConcrete indentity   really getting to know your users
Concrete indentity really getting to know your users
 
Online Identity: Getting to know your users
Online Identity: Getting to know your usersOnline Identity: Getting to know your users
Online Identity: Getting to know your users
 
Mobile payments at Droidcon Eastern Europe
Mobile payments at Droidcon Eastern EuropeMobile payments at Droidcon Eastern Europe
Mobile payments at Droidcon Eastern Europe
 
Reinvigorating Stagnant Innovation Through Your Developer Network
Reinvigorating Stagnant Innovation Through Your Developer NetworkReinvigorating Stagnant Innovation Through Your Developer Network
Reinvigorating Stagnant Innovation Through Your Developer Network
 
The Profitable Startup
The Profitable StartupThe Profitable Startup
The Profitable Startup
 
Startup Highway Workshop
Startup Highway WorkshopStartup Highway Workshop
Startup Highway Workshop
 
Berlin Battle hack presentation
Berlin Battle hack presentationBerlin Battle hack presentation
Berlin Battle hack presentation
 
From Good To Great
From Good To GreatFrom Good To Great
From Good To Great
 
Hack & Tell
Hack & TellHack & Tell
Hack & Tell
 
Payments for the REST of us
Payments for the REST of usPayments for the REST of us
Payments for the REST of us
 

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Droidcon DE 2013

  • 1.
  • 3. Painless Payments for Droids Tim Messerschmidt
  • 4. Painless Payments for Droids Tim Messerschmidt
  • 5. Log In with PayPal The Artist formerly known as access
  • 6. Log In with PayPal Authentication
  • 7. Log In with PayPal Authorization
  • 8. Log In with PayPal OAuth 2.0 & OpenID Connect
  • 9. Log In with PayPal Client Server 1.  Open Authorization 2.  Provide a login page Endpoint URL 3.  Return the Authorization 4.  Check callbacks for Token after a successful Authorization Token login 5.  Request a valid Access 6.  Check Authorization Token Token & return the Access Token 7.  Retrieve user’s resources if it’s valid
  • 10. Log In with PayPal NAME Date of Birth Creation Date EMAIL Language Gender Locale Time Zone Phone Number Address Verified
  • 11. Painless Payments for Droids Tim Messerschmidt
  • 12. Painless Payments for Droids Tim Messerschmidt
  • 13.
  • 14. Painless Payments for Droids Tim Messerschmidt
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Simple Payment 10 € Sender Receiver
  • 20. Parallel Payment 20 € 10 € Sender
  • 21. Chained Payment 20 € 100 € 30 € 10 € 1 transaction
  • 22.
  • 23. Mobile Payments Library Download the SDK
  • 24. Mobile Payments Library API Credentials At x.com
  • 25. Mobile Payments Library Sandbox APP ID: APP-80W284485P519543T
  • 26. Mobile Payments Library Add The .JAR To Your Project
  • 27. Mobile Payments Library Modify the Manifest
  • 28. Mobile Payments Library Adding the PayPal Activity: <activity android:name="com.paypal.android.MEP.PayPalActivity" android:configChanges="keyboardHidden|orientation" /> Best to be used with a translucent Theme android:theme="@android:style/Theme.Translucent.NoTitleBar"  
  • 29. Mobile Payments Library DECLARING THE NEEDED PERMISSIONS: Internet <uses-permission android:name="android.permission.INTERNET" /> READ Phone state <uses-permission android:name="android.permission.READ_PHONE_STATE" /> Access Wifi State <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  • 30. Mobile Payments Library Initialize The Library
  • 31. Mobile Payments Library new Thread() { public void run() { instance = PayPal.getInstance(); if (instance == null) { instance = PayPal.initWithAppID( context, ID, // YOUR APP'S ID PayPal.ENV_SANDBOX ); } } }.start();  
  • 32. Mobile Payments Library Create the PAYMENT
  • 33. Mobile Payments Library Simple Payment: PayPalPayment payment = new PayPalPayment(); payment.setRecipient("foo@bar.com"); payment.setCurrencyType("USD"); payment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS); payment.setSubtotal(new BigDecimal(”29.99")); PayPalInvoiceItem item = new PayPalInvoiceItem(); item.setName("Hipster T-Shirt"); item.setQuantity(1); item.setTotalPrice(new BigDecimal(”29.99")); PayPalInvoiceData data = new PayPalInvoiceData(); data.add(item); payment.setInvoiceData(data);  
  • 34. Mobile Payments Library Parallel Payment: PayPalAdvancedPayment payment = new PayPalAdvancedPayment(); payment.setCurrencyType("USD"); PayPalReceiverDetails firstReceiver = new PayPalReceiverDetails(); firstReceiver.setRecipient("first@bar.com"); firstReceiver.setSubtotal(new BigDecimal("10.00")); PayPalReceiverDetails secondReceiver = new PayPalReceiverDetails(); secondReceiver.setRecipient("second@bar.com"); secondReceiver.setSubtotal(new BigDecimal("20.00")); payment.getReceivers().add(firstReceiver); payment.getReceivers().add(secondReceiver);  
  • 35. Mobile Payments Library Execute The Payment
  • 36. Mobile Payments Library GET THE INTENT: Intent payIntent = instance.checkout(invoice, context); startActivityForResult(payIntent, REQUEST);   Can be used with a Delegate instead Intent payIntent = instance.checkout( invoice, context, delegate ); startActivity(payIntent);  
  • 37. Mobile Payments Library Receive the result: protected void onActivityResult( int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST) { switch (resultCode) { case Activity.RESULT_OK: showText("Success"); break; case Activity.RESULT_CANCELED: showText("Canceled"); break; case PayPalActivity.RESULT_FAILURE: showText("Failure"); break; } } }  
  • 38. Mobile Payments Library Advantage: Intent-based
  • 39. Mobile Payments Library Use IPN to update your stock
  • 40. Mobile Payments Library Verify Payments: payment.setIpnUrl("http://example.com/callback.php");   POST PayPal Server Server PayPal