Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
developer:api_specification:xml_payment_features_googlepay [2019/06/04 11:13]
vinayh [Availability]
developer:api_specification:xml_payment_features_googlepay [2019/06/04 11:23]
vinayh [Integrating]
Line 43: Line 43:
 ===== Integrating ===== ===== Integrating =====
  
-In this integration method you ned to implement a few steps:+In this integration method you need to implement a few steps:
  
-**Step 01**: Setup +**Step 01**: Integrate the Google Pay API to your website
- +
-To process google pay payments, you will need to be sure that the terminals you want to use are configured for that, so: +
- +
-  * **First**, register with Google: In order to use the Google Pay API in Production, you must register with Google. To do this, simply navigate to the Google Payment API Support page. You will be asked to register the website you wish to make payments with, and Google will give you a Google Merchant ID which you will use during your Google Pay requests. +
- +
-  * **Then**, have your Google Pay details configured: Contact our support team and ask for Google Pay to be enabled on the desired terminals and then provide the Google Merchant ID that Google assigned to you. +
- +
-\\ +
- +
-**Step 02**: Integrate the Google Pay API to your website+
  
 The merchant’s developer team will need to implement the **[[https://​developers.google.com/​pay/​api/​web/​setup|Google Payment API]]** to the merchant website in order to retrieve the customers (encrypted) card details (to be informed as **GOOGLEPAYLOAD**). The merchant’s developer team will need to implement the **[[https://​developers.google.com/​pay/​api/​web/​setup|Google Payment API]]** to the merchant website in order to retrieve the customers (encrypted) card details (to be informed as **GOOGLEPAYLOAD**).
Line 62: Line 52:
  
   * **merchantId** - The Merchant ID given to you by Google   * **merchantId** - The Merchant ID given to you by Google
-  * **gateway** - "Nuvei" (but all lower case)+  * **gateway** - "nuvei" (all lower case)
   * **gatewayMerchantId** - The Merchant ID given to you by the gateway   * **gatewayMerchantId** - The Merchant ID given to you by the gateway
  
 +To do this, your team must implement use Google'​s Test Environment and examples first.
 \\ \\
  
-**Step ​03**: Send Payment ​Request+**Step ​02**: Integrate with The Payment ​Gateway
  
-After you’ve retrieved the Google Payload, ​ convert the users Google Pay data to Hexadecimal, ​place it in the XML Payment ​Request ​in the GOOGLEPAYLOAD tag, and send the XML Payment ​Request to our servers as normal.+After you’ve retrieved the Google Payload, ​now you need to send the payload to our payment gateway. To do that, convert the users Google Pay data to Hexadecimal, ​and submit a Payment ​(more details ​in **[[developer:​api_specification:​xml_payment_features#​payment|XML Payment ​Features]]**).
  
-Consult ​the **[[developer:​api_specification:​xml_payment_features|XML Payment ​Features]]** for details on the URL for the request and other body fields tooUsing the example below (change the data inside the tags) shows you how to perform a simple transaction using google pay.+Send a POST request to the following URL: 
 +| Request URL (test) | https://​testpayments.nuvei.com/​merchant/​xmlpayment | 
 +| Request URL (live) | Remove "​test"​ from the test URL | 
 + 
 +Your request can contain any of the details present in a **[[developer:​api_specification:​xml_payment_features#payment|Common ​XML Payment ​Request Body]]**. 
 + 
 +The fields ADDRESS1, ADDRESS2 and POSTCODE are reserved for AVS services, in case your terminal supports it. 
 + 
 +__Request Example__
  
 <code xml> <code xml>
-<PAYMNET>+<PAYMENT>
     <​ORDERID>​123456</​ORDERID>​     <​ORDERID>​123456</​ORDERID>​
-    <​DATETIME>​05-01-2017:​11:​04:​55:​055</​DATETIME>​ 
     <​TERMINALID>​1234001</​TERMINALID>​     <​TERMINALID>​1234001</​TERMINALID>​
-    <GOOGLEPAYLOAD>7b0d0a2020227368697070696e67436f6e74616374223a207b0d0a2020202022656d61696c41646472657373223a20226578616d706c6540776f726c646e65747470732e636f6d222c0d0a202020202266616d696c794e616d65223a2022222c0d0a2020202022676976656e4e616d65223a2022222c0d0a202020202270686f6e6574696346616d696c794e616d65223a2022222c0d0a202020202270686f6e65746963476976656e4e616d65223a2022220d0a20207d2c0d0a202022746f6b656e223a207b0d0a20202020227061796d656e7444617461223a207b0d0a20202020276c6a59544d7559334a734d41344741315564447745422f775145417749486744415042676b71686b694739324e6b42683045416755414d416f4743437147534d343942414d4341306b414d4559434951446148474f75692b583254343452364756704e376d326e456372365436734d6a4f685a354e75536f316567774968414c31612b2f68703838444b4a3073763365543346785763733731786d624...... (etc it's quite long)</​GOOGLEPAYLOAD>​ +    <AMOUNT>152.26</​AMOUNT>​ 
-    <​CARDTYPE>​APPLEPAY</​CARDTYPE>​+    <​DATETIME>​05-01-2019:​11:​04:​55:​055</​DATETIME>​ 
 +    <​GOOGLEPAYLOAD>​7b0d0a2020227368697070696e67436f6e74616374223a207b0d0a2020202022656d61696c41646472657373 
 +    223a20226578616d706c6540776f726c646e65747470732e636f6d222c0d0a202020202266616d696c794e616d65223a2022222 
 +    c0d0a2020202022676976656e4e616d65223a2022222c0d0a202020202270686f6e6574696346616d696c794e616d65223a2022 
 +    222c0d0a202020202270686f6e65746963476976656e4e616d65223a2022220d0a20207d2c0d0a202022746f6b656e223a207b0 
 +    d0a20202020227061796d656e7444617461223a207b0d0a20202020276c6a59544d7559334a734d41344741315564447745422f 
 +    775145417749486744415042676b71686b694739324e6b42683045416755414d416f4743437147534d343942414d4341306b414 
 +    d4559434951446148474f75692b583254343452364756704e376d326e456372365436734d6a4f685a354e75536f316567774968 
 +    414c31612b2f68703838444b4a3073763365543346785763733731786d62072368072315780a99e8d8c07230f090912e802358c</​GOOGLEPAYLOAD>​ 
 +    <​CARDTYPE>​GOOGLEPAY</​CARDTYPE>​
     <​CARDHOLDERNAME>​John Junior Jameson</​CARDHOLDERNAME>​     <​CARDHOLDERNAME>​John Junior Jameson</​CARDHOLDERNAME>​
-    <​HASH>​2db545a97060c95c33bd2844418ff6e7</​HASH>​+    <​HASH>​ab17ee1ec5285719cb41afab02bc9b565ca8fe76647fa93eca12d922feb1325da58f65fbb1fa8151363da33d7c8abe5f 
 +    1848b2b7d27ffb4ccc1560a410e987ac</​HASH>​
     <​CURRENCY>​USD</​CURRENCY>​     <​CURRENCY>​USD</​CURRENCY>​
     <​TERMINALTYPE>​2</​TERMINALTYPE>​     <​TERMINALTYPE>​2</​TERMINALTYPE>​
     <​TRANSACTIONTYPE>​7</​TRANSACTIONTYPE>​     <​TRANSACTIONTYPE>​7</​TRANSACTIONTYPE>​
-    <​POSTCODE>​12345</​POSTCODE>​+    ​<​ADDRESS1>​N 29, St. James St. - Hommerstown</​ADDRESS1>​ 
 +    <​ADDRESS2>​chicago,​ Illinois</​ADDRESS2>​ 
 +    ​<​POSTCODE>​60176</​POSTCODE>​
 </​PAYMENT>​ </​PAYMENT>​
 </​code>​ </​code>​
  
 +__About the Data__
 +
 +When using a Single Currency Terminal, the string to generate the HASH field is going to be formed using:
 +<WRAP center box 100%>
 +TERMINALID:​ORDERID:​AMOUNT:​DATETIME:​SECRET
 +</​WRAP>​
 +
 +When using a Multi Currency Terminal, the string to generate the HASH field is going to formed using:
 +<WRAP center box 100%>
 +TERMINALID:​ORDERID:​CURRENCY:​AMOUNT:​DATETIME:​SECRET
 +</​WRAP>​
 +
 +Depending on your terminal settings, you might need to use a different way to generate your HASH (MD5 or SHA512). Take a look at the **[[developer:​api_specification:​special_fields_and_parameters#​the_hash_parameter|HASH Parameter]]**.
 +
 +All data sent to us should be correctly encoded using UTF-8 as the character encoding.
 \\ \\
  
-Variations of this request are possible, but for that, consult the complete reference for a payment at the **[[developer:​api_specification:​xml_payment_features|XML Payment Features]]** page and don't forget that the **GOOGLEPAYLOAD** tag replaces the **TRACKDATA** (for transactions using cards) or **CARDNUMBER** (for transctions using secure card) tags.+**Step 03**: Setup to Go Live
  
 +After successfully testing your integration,​ to process google pay payments in production, you will need to be sure that the terminals you want to use are configured for that, so:
  
 +  * **First**, register with Google: In order to use the Google Pay API in Production, you must register with Google. To do this, simply navigate to the Google Payment API Support page. You will be asked to register the website you wish to make payments with, and Google will give you a Google Merchant ID which you will use during your Google Pay requests.
 +
 +  * **Secondly**,​ have your Google Pay details configured: Contact our support team and ask for Google Pay to be enabled on the desired terminals
 +\\
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International