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

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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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
 
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
 

Recently uploaded (20)

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...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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