• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Codemotion Magazine

Codemotion Magazine

We code the future. Together

  • Discover
    • Live
    • Tech Communities
    • Hackathons
    • Coding Challenges
    • For Kids
  • Watch
    • Talks
    • Playlists
    • Edu Paths
  • Magazine
    • AI/ML
    • Backend
    • Frontend
    • Dev Life
    • DevOps
    • Soft Skills
  • Talent
  • Partners
  • For Companies
Home » Frontend » Mobile Developer » XPay Mobile App: integrazione con Google Pay e Apple Pay
Mobile Developer

XPay Mobile App: integrazione con Google Pay e Apple Pay

Codemotion and Facebook organized the Tech Leadership Training boot camp, heres a personal reportage from one of our attendees.

Last update June 11, 2019 by Codemotion


Scopri di più sul programma e iscriviti gratuitamente!

Google Pay e Apple Pay sono ormai da alcuni mesi delle realtà anche in Italia e il loro uso è in costante crecita. Per facilitare l’integrazione di Google Pay e Apple Pay da parte dei merchant, NEXI mette a disposizione una soluzione di sviluppo semplificata, rendendo l’applicazione del merchant “dipendente” solamente dall’SDK di XPay e non da quelle specifiche delle piattaforme che vengono astratte e inglobate al suo interno.

Vediamo nel dettaglio come integrare le due soluzioni.

Google Pay

Il primo passo per l’utilizzo di Google Pay, è quello di includere i Google Play services e l’AppCompat, ad esempio aggiungendo al build.grandle le seguenti dipendenze:

Dopo aver aggiunto le dipendenze di base è necessario aggiungere il seguente meta-data element nella sezione del AndroidManifest per abilitare Google Pay:

A questo punto per poter utilizzare le API messe a disposizione dalla SDK XPay, la nostra Activity dovrà estendere la classe GooglePayActivity dell’SDK XPay (it.nexi.xpay.GooglePay.GooglePayActivity). In questo modo all’interno della nostra Activity potremo avviare il processo di pagamento tramite Google Pay invocando il metodo “payWithGoogle” ereditato GooglePayActivity.

Di seguito un esempio di codice:

Per poter rilasciare un’app che utilizza Google Pay sullo store, è necessario verificare che la checklist richiesta da Google (https://developers.google.com/pay/api/android/guides/test-and-deploy/integration-checklist) sia rispettata e seguire la procedura di generazione del certificato e firma presente al seguente link: https://developers.google.com/pay/api/android/guides/test-and-deploy/deploy-your-application ).

Apple Pay

Per poter utilizzare Apple Pay il primo passaggio obbligatorio è quello di creare un Merchat Identifier (https://help.apple.com/developer-account/#/devb2e62b839?sub=dev103e030bb) e il relativo certificato (https://help.apple.com/developer-account/#/devb2e62b839?sub=devf31990e3f) tramite il portale Apple o XCode (https://help.apple.com/xcode/mac/current/#/deva43983eb7).

Ottenuto il certificato, questo dovrà essere caricarto sul Back Office di XPay per permettere al Server XPay di validare le chiamate provenienti dall’app alla quale è stato associato il certificato.

A questo punto per poter utilizzare Apple Pay tramite le API messe a disposizione dalla SDK XPay, è sufficiente estendere il proprio ViewController dalla classe “ApplePayViewController” e utilizzare il metodo ereditato “payWithApple” per iniziare il processo di pagamento simile a quanto normalmente fatto con una WebView.

Di seguito un esempio di codice:

facebooktwitterlinkedinreddit
Share on:facebooktwitterlinkedinreddit

Tagged as:Google

The right and wrong with JavaScript: interview with Douglas Crockford
Previous Post
Call for Code!
Next Post

Related articles

  • Kotlin Users Group – Interview with organiser, Jakub Jablonski
  • Async code on Kotlin: coroutines VS RxJava
  • Become a Mobile Developer and Connect the Virtual and Physical Worlds
  • Flutter for Android Developers explained by Faisal Abid
  • 5 Mobile App Predictions for 2020
  • Building mobile applications in JavaScript with React Native
  • Kotlin loves React
  • Facebook Hermes becomes open source
  • The state of Developer Ecosystem in 2019: the rise of Kotlin and React
  • Nexi Dev Training Program: Nexi SmartPOS

Primary Sidebar

The IT Industry in Italy: Trending Positions, Salaries, and Main Skills for 2022

Codemotion and Adecco’s guide to understanding the IT working environment in Italy. Download here:

Adecco Whitepaper IT Report

Latest

Do You Love Open Source Too? Then Don’t Miss This Survey by Linux Foundation

Dev Life

grpc, http, rest

GRPC Approach for Improved Software Development

Web Developer

Using the Twelve-Factor Methodology in Cloud-Native Microservices

Microservices

svelte, javascript frameworks, vue.js, angular

Svelte: Why Is It an Innovation to Javascript Frameworks?

JavaScript

blockchain, avascan, avalanche, defikingdom, subnet

How to Deploy a Subnet on Avalanche Blockchain: The Case of DeFi Kingdom

Blockchain

Related articles

  • Kotlin Users Group – Interview with organiser, Jakub Jablonski
  • Async code on Kotlin: coroutines VS RxJava
  • Become a Mobile Developer and Connect the Virtual and Physical Worlds
  • Flutter for Android Developers explained by Faisal Abid
  • 5 Mobile App Predictions for 2020
  • Building mobile applications in JavaScript with React Native
  • Kotlin loves React
  • Facebook Hermes becomes open source
  • The state of Developer Ecosystem in 2019: the rise of Kotlin and React
  • Nexi Dev Training Program: Nexi SmartPOS

Footer

  • Magazine
  • Events
  • Community
  • Learning
  • Kids
  • How to use our platform
  • Contact us
  • Become a contributor
  • About Codemotion Magazine
  • How to run a meetup
  • Tools for virtual conferences

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • YouTube
  • RSS

DOWNLOAD APP

© Copyright Codemotion srl Via Marsala, 29/H, 00185 Roma P.IVA 12392791005 | Privacy policy | Terms and conditions

  • Magazine
  • Events
  • Community
  • Learning
  • Kids
  • How to use our platform
  • Contact us
  • Become a contributor
  • About Codemotion Magazine
  • How to run a meetup
  • Tools for virtual conferences

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • YouTube
  • RSS

DOWNLOAD APP

CONFERENCE CHECK-IN