Zum Hauptinhalt springen
@capgo/capacitor-zahlung Handel Offene Quelle

Zahlung Capacitor Plugin

Zahlungen mit Apple Pay und Google Pay für einen reibungslosen Checkout-Prozess akzeptieren

Installieren

bun add @capgo/capacitor-pay bunx cap sync
npm, pnpm oder yarn
  • npm install @capgo/capacitor-pay
  • pnpm add @capgo/capacitor-pay
  • yarn add @capgo/capacitor-pay

Anleitung

Verwenden Sie Pay in Capacitor

Testen Sie auf Gerät

Laden Sie die Capgo-App herunter, dann scannen Sie die QR-Code code.

QR-code für die Voransicht des Pay-Plugins

Verwendung von @capgo/capacitor-pay

Das Capacitor-Plugin zum Auslösen von nativen Zahlungen für iOS (Apple Pay) und Android (Google Pay).

Installieren

bun add @capgo/capacitor-pay
bunx cap sync

bunx cap sync kopiert das native code-Plugin in Ihre native Projekte. Führen Sie es erneut aus, nachdem jede Plugin-Upgrade durchgeführt wurde.

Importieren

import { Pay } from '@capgo/capacitor-pay';

API im Überblick

Methode Beschreibung
isPayAvailable Überprüft, ob native Pay auf der aktuellen Plattform verfügbar ist. Auf iOS wird Apple Pay und auf Android Google Pay bewertet.
requestPayment Präsentiert das native Pay-Blatt für die aktuelle Plattform. Bereitstellen Sie die Apple Pay-Konfiguration auf iOS und die Google Pay-Konfiguration auf Android.

Beispiele

isPayAvailable()

Überprüft, ob native Pay auf der aktuellen Plattform verfügbar ist. Auf iOS wird Apple Pay und auf Android Google Pay bewertet.

import { Pay } from '@capgo/capacitor-pay';

const result = await Pay.isPayAvailable();
console.log(result);

requestPayment()

Präsentiert das native Pay-Blatt für die aktuelle Plattform. Bereitstellen Sie die Apple Pay-Konfiguration auf iOS und die Google Pay-Konfiguration auf Android.

import { Pay } from '@capgo/capacitor-pay';

const result = await Pay.requestPayment({
  apple: {
    merchantIdentifier: 'merchant-identifier-123',
    countryCode: 'US',
    currencyCode: 'USD',
    paymentSummaryItems: [
      {
        label: 'Hello from Capacitor',
        amount: 'amount',
      },
    ],
    supportedNetworks: ['AmEx'],
  },
});
// The result holds sensitive values: use it without logging it.

Vollständige Referenz

Weitermachen von Using @capgo/capacitor-pay

Wenn Sie native Pay verwenden Mit @capgo/capacitor-pay um Zahlungen und Kaufabschlüsse zu planen und es mit @capgo/capacitor-pay zur Implementierungsdetail in @capgo/capacitor-pay, Anleitung zum Starten zur Implementierungsdetail in Anleitung zum Starten, Capgo Preisgestaltung zur Produktworkflow in Capgo Preisgestaltung, Zahlungssystem zur Implementierungsdetail in Zahlungssystem, und @capgo/native-purchases zur Implementierungsdetail in @capgo/native-purchases.

FAQ

FAQ zur Zahlungsplatinform

Wie installiere ich die Zahlungsplatinform in einer Capacitor-App?

Run "bun add @capgo/capacitor-pay" (or "npm install @capgo/capacitor-pay"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-pay" in your app code.

Funktioniert @capgo/capacitor-pay mit React, Vue und Angular?

Ja. Pay ist ein Capacitor-Paket, also funktioniert es mit jedem Webframework, das innerhalb von Capacitor läuft, einschließlich Ionic, React, Vue, Angular, Svelte und plain JavaScript.

Welche Capacitor-Version unterstützt @capgo/capacitor-pay?

Capgo-Plugins folgen der Capacitor-Version: Verwenden Sie die Plugin-Major-Version, die Ihrem Capacitor-Major-Version entspricht (z.B. Plugin v8 mit Capacitor 8). Die Kompatibilitäts-Tabelle im GitHub-README listet die unterstützten Versionen auf.

Ist @capgo/capacitor-pay kostenlos und Open-Source?

Ja. Der Quellcode von code ist öffentlich auf GitHub unter https://github.com/Cap-go/capacitor-pay/ verfügbar und das Paket kann kostenlos installiert werden von npm. Bug-Reports und Pull-Requests sind willkommen.

Kann ich code mit Pay aktualisieren, ohne eine App-Store-Überprüfung?

Das Installieren oder Upgraden des Plugins ändert die native code, daher benötigt es eine neue Store-Build. Danach können JavaScript-, HTML- und CSS-Änderungen, die den Plugin aufrufen, sofort mit Capgo-Live-Updates verschickt werden.

Shippe Pay-Änderungen ohne Wartezeit auf die App-Überprüfung

Bauen Sie den Plugin in Ihrem Store, Capgo lebendige Updates drücken Ihre JavaScript-, HTML- und CSS-Änderungen an die Benutzer in Minuten aus.

Starten Sie mit Capgo