Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

Make Payments with Google Pay

Google Pay
Made by Google Pay

Makes a payment with Google Pay via one or more supported Payment Service Providers, and writes the response to Cloud Firestore.

Cara kerja ekstensi ini

Use this extension to make payments with your preferred Payment Service Provider (PSP) using Google Pay.

With this extension installed, you can pass a payment token from the Google Pay API to your Cloud Firestore database. The extension will listen for a request written to the path defined during installation, and then send the request to the PSP's API. It will then write the response back to the same Firestore node.

Write the following JSON payload to your Cloud Firestore instance to make a payment request:

{
  psp: 'braintree',
  total: 100,
  currency: 'USD',
  paymentToken: <Google Pay API payment token>
}

As you can see, the PSP is specified in the request payload, which means you can configure and support multiple PSPs using this extension. The following PSPs are currently supported (the value for the 'psp' field above is noted in parentheses):

  • Adyen (adyen)
  • Braintree (braintree)
  • Checkout.com (checkoutltd)
  • Cybersource (cybersource)
  • Square (square)

Additional setup

Before installing this extension, make sure that you've created an account with your selected PSP. When installing this extension, you will need to provide PSP-specific configuration in the form of a JSON string. These are the expected configurations for each PSP:

{ "environment": "", "merchantAccount": "" }

{ "environment": "Sandbox", "merchantId": "", "publicKey": "" }

{ "publicKey": "" }

{ "authenticationType": "", "runEnvironment": "", "merchantID": "", "merchantKeyId": "" }

{ "environment": "" }

Each PSP also requires a parameter that the extension will store using Cloud Secrets Manager, such as an API key or access token, specific to the PSP.

Billing

To install an extension, your project must be on the Blaze (pay as you go) plan

  • You will be charged a small amount (typically around $0.01/month) for the Firebase resources required by this extension (even if it is not used).
  • This extension uses other Firebase and Google Cloud Platform services, which have associated charges if you exceed the service's free tier:
  • Cloud Firestore
  • Cloud Functions (Node.js 10+ runtime. See FAQs)

You are also responsible for any fees charged by the PSPs you use.

Cara menginstal ekstensi ini

Menggunakan Firebase console

Anda dapat menggunakan Firebase console untuk menginstal dan mengelola ekstensi.

Instal menggunakan konsol

Menggunakan Firebase CLI

Anda juga dapat menggunakan Firebase CLI untuk menginstal dan mengelola ekstensi:

Langkah 1: Jalankan perintah npm berikut untuk menginstal CLI atau mengupdate ke versi CLI terbaru.

npm install -g firebase-tools
Tidak berhasil? Lihat referensi Firebase CLI atau ubah izin npm Anda.

Langkah 2: Instal ekstensi ini dengan menjalankan perintah berikut

firebase ext:install google-pay/make-payment --project=projectId_or_alias
Dukungan
Cloud Firestore
Penulis
Lisensi
Apache-2.0
Versi
0.1.1