capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 74 forks source link

feat: React Provider component #142

Closed hideokamoto closed 2 years ago

hideokamoto commented 2 years ago

Purpose

Easy to set up the plugin from React application.

import { CapacitorStripeProvider } from '@capacitor/stripe';

const App: React.FC = () => (
  <CapacitorStripeProvider
    publishableKey="pk_test_xxxx"
    fallback={<p>Loading...</p>}
  >
    <IonApp>
       ...
    </IonApp>
  </CapacitorStripeProvider>
);

And easy to get the Stripe client class and native payment availability.

import { useCapacitorStripe } from '@capacitor/stripe';

...
const {
  isGooglePayAvailable,
  isApplePayAvailable,
  stripe
} = useCapacitorStripe()
netlify[bot] commented 2 years ago

✔️ Deploy Preview for capacitor-community-stripe ready!

🔨 Explore the source changes: 10a4e1a5babc60bbe106dffa57050e60277bcc12

🔍 Inspect the deploy log: https://app.netlify.com/sites/capacitor-community-stripe/deploys/61d1729561fea4000705779f

😎 Browse the preview: https://deploy-preview-142--capacitor-community-stripe.netlify.app/

rdlabo commented 2 years ago

という問題でした。修正した!