ตั้งค่า Google Pay API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ก่อนเริ่มต้น
หากต้องการเตรียมแอป ให้ทำตามขั้นตอนในส่วนต่อไปนี้
ข้อกำหนดเบื้องต้นของแอป
หากต้องการใช้ Google Pay API ใน Android แอปของคุณต้องมีคุณสมบัติดังนี้
- จัดจำหน่ายผ่าน Google Play Store
- สร้างขึ้นโดยใช้การกำหนดค่าต่อไปนี้
minSdkVersion ตั้งแต่ 23 ขึ้นไป
compileSdkVersion ตั้งแต่ 34 ขึ้นไป
ตั้งค่าแอปและบัญชี Google Pay
หากต้องการกำหนดค่าแอป ให้ทำตามขั้นตอนในส่วนต่อไปนี้
การอ้างอิงของแอป
เพิ่มทรัพยากร Dependency ของ Google Play Services
สำหรับ Google Pay API ลงในไฟล์บิลด์ Gradle ของโมดูล
(โดยปกติคือ app/build.gradle หรือ app/build.gradle.kts)
ดึงดูด
dependencies {
implementation 'com.google.android.gms:play-services-wallet:19.5.0'
}
Kotlin
dependencies {
implementation("com.google.android.gms:play-services-wallet:19.5.0")
}
เมื่อพร้อมที่จะเผยแพร่แล้ว โปรดดูข้อมูลสำคัญในเผยแพร่การผสานรวม
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-12-16 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-12-16 UTC"],[],["To utilize the Google Pay API, ensure your app is on the Google Play store and meets `minSdkVersion` 21 and `compileSdkVersion` 34 or higher. Install the Google Wallet app with a payment method. If Google processes payments or you sell digital goods, use Google Play In-app Billing. Add the `com.google.android.gms:play-services-wallet:19.4.0` dependency to your module's Gradle file. In your `AndroidManifest.xml`, enable the API with the `meta-data` element: `com.google.android.gms.wallet.api.enabled` with a value of `true`.\n"]]