Integrating with Google Pay API for Mobile Payments
Total Page:16
File Type:pdf, Size:1020Kb
Integrating with Google Pay API for Mobile Payments Document version 1.3 Contents 1. HISTORY OF THE DOCUMENT.......................................................................................................3 2. OBTAINING HELP...............................................................................................................................4 Viewing online documentation...........................................................................................................................4 Getting in touch with technical support.............................................................................................................4 3. PRESENTATION...................................................................................................................................5 4. PREREQUISITES................................................................................................................................. 6 5. DECLARING A GOOGLE PAY™ CONTRACT IN THE MERCHANT BACK OFFICE..................7 6. EXCHANGE PROCESS........................................................................................................................ 8 7. MANAGING THE TIMEOUT............................................................................................................. 9 8. VIEWING SAMPLE CODES.............................................................................................................11 9. CONFIGURING YOUR PROJECT................................................................................................... 12 9.1. Activating the API Google Pay™.............................................................................................................. 12 9.2. Adding dependencies.................................................................................................................................12 10. PROCEEDING TO PAYMENT VIA THE MOBILE APPLICATION........................................ 13 10.1. Defining the version of Google Pay™.....................................................................................................13 10.2. Defining the payment gateway............................................................................................................... 13 10.3. Defining supported payment methods.................................................................................................... 13 10.4. Transmitting supported payment methods.............................................................................................. 14 10.5. Creating a PaymentsClient instance........................................................................................................14 10.6. Verifying if payment is possible.............................................................................................................15 10.7. Creating a PaymentDataRequest object............................................................................................. 15 10.8. Registering an event handler for user gesture........................................................................................ 16 10.9. Selecting a payment method................................................................................................................... 18 10.10. Retrieving data from Google Pay™....................................................................................................... 18 11. TRANSMITTING DATA TO THE PAYMENT GATEWAY........................................................21 12. PROCESSING THE PAYMENT RESULT.....................................................................................25 13. GOING TO LIVE MODE................................................................................................................ 27 14. MANAGING YOUR GOOGLE PAY™ TRANSACTIONS VIA THE BACK OFFICE PAYZEN............................................................................................................................................... 28 14.1. Display transaction details Google Pay™................................................................................................ 29 14.2. Validate ing a transaction........................................................................................................................30 14.3. Modify ing a transaction......................................................................................................................... 31 14.4. Canceling a transaction........................................................................................................................... 32 14.5. Editing the order reference......................................................................................................................33 14.6. Resending transaction confirmation e-mail to the buyer........................................................................ 33 14.7. Resending the transaction confirmation e-mail to the merchant.............................................................33 14.8. Capturing a transaction............................................................................................................................34 14.9. Manual reconciliation.............................................................................................................................. 34 14.10. Making a refund.................................................................................................................................... 35 1. HISTORY OF THE DOCUMENT Version Author Date Comment 1.3 Lyra Network 4/25/2019 Indication of the Trade Mark label. 1.2 Lyra Network 1/14/2019 • Updating prerequisites • The creation process of a merchant ID has been updated. 1.1 Lyra Network 10/19/2018 • Update to the latest version of the Google Pay™ API. • Update of code samples 1.0 Lyra Network 7/10/2018 Initial version This document and its contents are confidential. It is not legally binding. Any reproduction and / or distribution of all or part of this document or its content to a third party is strictly prohibited or subject to prior written authorization from Lyra Network. All rights reserved. Integrating with Google Pay API for Mobile Payments - Document version 1.3 All rights reserved - 3 / 35 2. OBTAINING HELP Viewing online documentation Looking for help? See our online documentation France https://payzen.io/fr-FR/faq/sitemap.html Europe https://payzen.io/en-EN/faq/sitemap.html Latin America (except Brazil) https://payzen.io/lat/faq/sitemap.html Brazil https://payzen.io/pt-BR/faq/sitemap.html India https://payzen.io/in/faq/sitemap.html We are constantly improving the understanding and proper use of our technical documentation. We appreciate any constructive remarks on your part. Please send your comments and suggestions about the documentation to the e-mail address [email protected]. Getting in touch with technical support For technical inquiries or support, you can reach us from Monday to Friday, between 9 a.m. and 6 p.m. By phone By e-mail France [email protected] Europe [email protected] Latin America (except Brazil) N/A [email protected] +55 (11) 3336-9217 Brazil [email protected] +55 (11) 3336-9209 India +91 (022) 33864910 / 932 [email protected] and via your Merchant Back Office, Help > Contact support In view of facilitating the processing of your demands, you will be asked to communicate your shop ID (an 8-digit number). This information is available in the “registration of your shop” e-mail or in the Merchant Back Office (Settings > Shop > Configuration). Integrating with Google Pay API for Mobile Payments - Document version 1.3 All rights reserved - 4 / 35 3. PRESENTATION Google Pay™ is a payment method allowing buyers to easily pay for their purchases using the payment card associated with their Google account. It is a simple, fast and secure method of performing purchases online or using a mobile app. There are two types of integration: • mobile app integration • integration on a merchant website (payment is made via buyer’s browser) This document describes mobile app integration using the payload returned by the Google Pay™ API. However, it is possible to adapt the following instructions by using a client payload for the Google Pay™ JavaScript API. Google Pay™ express checkout: During a payment, the buyer must enter their billing and shipping address in the mobile app. In order to facilitate buyer’s payments on different sites or apps, it is possible to manage billing and shipping addresses via Google wallet. The buyer selects his or her payment method and addresses once and the merchant website exploits the data contained in the response (payload). (The information is automatically transmitted to the payment gateway and is visible in the PayZen Back Office). Important: • The current implementation does not allow 3D Secure authentication for Google Pay™ payments. Therefore, there is no liability shift. • The current implementation does not allow to create recurring payments (payments by subscription) with the Google Pay™ payment method. Integrating with Google Pay API for Mobile Payments - Document version 1.3 All rights reserved - 5 / 35 4. PREREQUISITES For the merchant: • Opt for the PayZen Premium or PayZen Expert offer For the buyer: • Have a Google account • Associate a payment method with their Google account • Have mobile equipment that is compatible with Google Pay services Integrating with Google Pay API for Mobile Payments - Document version 1.3 All rights reserved - 6 / 35 5. DECLARING A GOOGLE PAY™ CONTRACT