title: How to enable PayPal for Google Pay online
body: <p>I have got a task to use Google Pay with PayPal in web applications and for that I have gone through numbers of posts over the internet, but not found any well documentation or guide. I have found only google pay codes with payment-gateway mostly and PayPal uses documentation only on PayPal and google blogs, I found that while using it with payment gateway, we don't need any self-created tokenization codes to pass in payment method but when we go with PayPal we must have to use DIRECT token specification method that means we have to create tokenization self for rotation or may be I didn't get it right. My question is that, do we still need public key while working with payment gateway or it belongs to direct method only. I am successfully running payment-gateway integration with test environment but not got any success over PayPal.
  While learning about Direct method I understand that we have need to use public key in both payment request and in google pay developer profile but how we can run PayPal in test environment still not found neither any sample nor any success over that.</p>
  
  <p>Below are links I have tried you can use for reference:</p>
  
  <pre><code>https://developers.google.com/pay/api/web/guides/tutorial
  https://developers.google.com/pay/api/web/guides/resources/sample-tokens
  https://developers.google.com/pay/api/web/reference/request-objects#purchasecontext
  https://developers.google.com/pay/api/web/reference/request-objects#gateway
  https://developers.google.com/pay/api/web/guides/paymentrequest/tutorial
  https://stackoverflow.com/search?page=5&amp;tab=Relevance&amp;q=integrate%20google%20pay
  https://developer.paypal.com/docs/archive/checkout/how-to/googlepay-integration/
  https://developers.google.com/pay/api/web/guides/tutorial 
  </code></pre>
  
  <p>Here you can see sample of json for payment request in google pay with PayPal.</p>
  
  <pre><code>    { 
     "apiVersion":2,
     "apiVersionMinor":0,
     "allowedPaymentMethods":[ 
        { 
           "type":"PAYPAL",
           "parameters":{ 
              "purchase_context":{ 
                 "payment_intent":"AUTHORIZE",
                 "purchase_units":[ 
                    { 
                       "reference_id":"PUHF",
                       "description":"Sporting Goods",
                       "custom_id":"CUST-HighFashions",
                       "soft_descriptor":"HighFashions",
                       "payee":{ 
                          "merchant_id":"xxxxx"
                       },
                       "shipping":{ 
                          "method":"United States Postal Service",
                          "address":{ 
                             "name":{ 
                                "full_name":"John Doe"
                             },
                             "address_line_1":"123 Townsend St",
                             "address_line_2":"Floor 6",
                             "admin_area_2":"San Francisco",
                             "admin_area_1":"CA",
                             "postal_code":"94107",
                             "country_code":"US"
                          }
                       }
                    }
                 ]
              }
           },
           "tokenizationSpecification":{ 
              "type":"DIRECT"
           }
        }
     ],
     "transactionInfo":{ 
        "displayItems":[ 
           { 
              "label":"Subtotal",
              "type":"SUBTOTAL",
              "price":"1.00"
           },
           { 
              "label":"Tax",
              "type":"TAX",
              "price":"1.00"
           }
        ],
        "countryCode":"US",
        "currencyCode":"INR",
        "totalPriceStatus":"FINAL",
        "totalPrice":"1.00",
        "totalPriceLabel":"Total"
     },
     "merchantInfo":{ 
        "merchantName":"shopgradframes"
     },
     "callbackIntents":[ 
        "SHIPPING_ADDRESS",
        "SHIPPING_OPTION",
        "PAYMENT_AUTHORIZATION"
     ],
     "shippingAddressRequired":false,
     "shippingAddressParameters":{ 
        "allowedCountryCodes":[ 
           "US"
        ],
        "phoneNumberRequired":true
     },
     "shippingOptionRequired":false
  }
  </code></pre>
  
  <p>I think we can't use direct method in test environment because this may need merchant details, i have also some doubt over test token given in google blog, you can see that below:</p>
  
  <pre><code>https://developers.google.com/pay/api/web/guides/resources/sample-tokens
  </code></pre>
  
  <p>I also didn't understand how we can use those test token, do we have to pass it our payment gateway for processing or other stuff. </p>