メインコンテンツにジャンプ
チュートリアル

CloudflareのCapacitorにおけるStripe Payments: 新しいAppleガイドライン

新しいAppleガイドラインに準拠したCapacitorアプリでStripe Payment Linksを実装する方法を学びます。デジタル商品の支払いを処理するために、2025年5月1日以降に有効となるAppleガイドラインに準拠しています。

マーティン・ドナディュー

マーティン・ドナディュー

コンテンツマーケター

CloudflareのCapacitorにおけるStripe Payments: 新しいAppleガイドライン

CapacitorのStripe Payment LinksをAppleの新しいガイドラインに従って実装する

2025年5月1日以降、AppleはEpic v. Apple裁判の判決に基づいてApp Store Reviewガイドラインを大幅に変更しました。 これらの変更により、アメリカのアプリ開発者はデジタル商品やサービスに対する外部の支払い方法へのリンクを許可され、Appleのインアプリ購入システムへの代替を可能にしました。永遠に変えるモバイル決済のエピックバトル

この瞬間までの道のりは長く、紛争が続きました。すべては2020年8月に始まりました。Epic Gamesは、Fortniteという人気のゲームの作成者が、AppleのApp Storeガイドラインを意図的に違反し、Appleの30%のコミッションを回避する直接の支払いオプションを実装しました。AppleはFortniteをApp Storeから削除し、EpicはAppleがiOSアプリの配布とインアプリ決済を制御することを挑戦する訴訟を提起しました。

数年間の法廷闘争、上告、反対上告の後、裁判所はAppleがユーザーをアプリ外の代替支払い方法に直接リンクすることを許可することを決定しました。この決定は、2008年に始まったApp Storeのエコシステムの基本的な財政モデルを根本的に変えました。

最終判決 - さらに上告はありません

__CAPGO_KEEP_0__

__CAPGO_KEEP_0__は、この判決が特に重要なのは、最終的であり、更に上訴することはできません。最高裁判所は2025年初頭にAppleの上訴を却下し、下級裁判所の決定を法律の域に固定しました。このことは、開発者が信頼性を持って外部の支払い方法を実装できることを意味します。Appleは、この決定を更に法律上の挑戦を通じて逆転させることはできません。

法によって等しく扱われる

最も重要なのは、判決は明確にAppleが外部の支払い方法を使用するアプリに差別することはできないと述べていることです。裁判所は、以下のことをAppleに禁止しました。

  1. Appleが外部の支払い方法を使用するアプリに追加の料金を請求したり、追加の要件を課したりすることはできません。
  2. AppleがIAPシステムを独占的に使用するアプリに、検索結果や特集を優遇することはできません。
  3. Appleが外部の支払い体験をAppleのシステムと比較して劣ったものにし、技術的な措置を講じることはできません。
  4. Appleが基本的な消費者情報を超える、負担の大きい開示要件を課すことはできません。

これらの明確な保護措置により、開発者はStripeや他の外部の支払いプロバイダーを使用することなく、Appleの微妙な報復や差別から恐れる必要がなくなりました。プレイヤーフィールドは法律上平等化され、Appleはアプリの支払い方法の選択に関係なく、すべてのアプリを等しく扱う必要があります。

The ruling represents one of the most significant challenges to Apple’s walled garden approach and marks a pivotal shift in how mobile app monetization can work. For developers who have long complained about Apple’s 30% commission (reduced to 15% for small businesses), this ruling offers a path to higher profit margins and more control over the customer experience.

Appleのインアプリ購入と比較してStripeを使用することの財務的利点

The financial implications of this change are substantial for developers:

  • Appleのインアプリ購入料金の削減: Apple通常、インアプリ購入に対して30%のコミッションを徴収(小規模企業の場合15%)、一方、Stripeの手数料は約2.9% + $0.30あたり取引です。この差は、収益マージンを大幅に増やすことができます。

  • 迅速な支払い: Appleでは、通常45-90日間待って、資金を受け取ります。Stripeでは、銀行口座に支払いを2-3営業日以内に送金します。

  • 簡素化された返金処理: Stripeのダッシュボードを通じて返金を直接処理するのではなく、Appleの複雑な返金システムを通じて処理するのではなく。

これらのコスト削減とキャッシュフロー改善は、特に小規模の開発者や企業にとってゲームチェンジャーです。

この記事では、CapacitorアプリにStripe Payment Linksを実装する方法について説明します。これにより、Appleの 更新されたガイドラインに準拠しながら、これらの新しい規則を利用できます。.

This implementation is based on __CAPGO_KEEP_0__ Stripeの公式ドキュメントのPayment Linksの部分を、特にCapacitorアプリ向けに適応

新しいガイドラインの理解

App Storeの更新されたレビュー ガイドラインでは、開発者はユーザーを外部サイトにリダイレクトして、特にデジタル商品やサブスクリプションのための支払い処理に使用することを許可しています。この変更は現在、アメリカApp Storeで配布されているアプリにのみ適用されます。

理解するポイント

  1. デジタル商品のための外部支払いオプションをアプリ内でリンクすることができます
  2. この変更は、アメリカApp Storeで配布されているアプリにのみ適用されます
  3. Appleの披露要件に従う必要があります
  4. すべての顧客サポートと返金処理の責任はあなたに残ります

技術的な実装に進みましょう

最初に、Stripe ダッシュボードで支払いリンクを作成してください:

  1. Stripe ダッシュボードの「支払いリンク」セクションに移動する
  2. 「+新規」ボタンをクリックして新しい支払いリンクを作成する
  3. 製品またはサブスクリプションの詳細を定義する
  4. 「支払い後」の設定で、「確認画面を表示しない」に選択する
  5. 成功URLとしてユニバーサルリンクを設定する (後で設定する)
  6. 「リンクを作成」ボタンをクリックして支払いリンクを生成する

支払い完了後ユーザーをアプリにリダイレクトするには、ユニバーサルリンクを設定する

  1. ドメイン上に「ファイル」を作成する apple-app-site-association ファイル
{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appIDs": ["YOURTEAMID.com.yourdomain.yourapp"],
        "components": [
          {
            "/": "/checkout_redirect*",
            "comment": "Matches any URL whose path starts with /checkout_redirect"
          }
        ]
      }
    ]
  }
}
  1. このファイルをホストしてください https://yourdomain.com/.well-known/apple-app-site-association

  2. 正しいMIMEタイプでサーバーしてください application/json

  3. CapacitorアプリをUniversal Linkを処理できるように設定するには、適切な特権を追加する必要があります。まず、 capacitor.config.ts:

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  // Your existing app configuration (appId, appName, etc.)
  plugins: {
    Geolocation: {
      // Request precise location access on iOS
      iosLocationAccuracy: 'reduced'
    }
  }
};

export default config;
  1. Xcodeプロジェクトにアソシエーテッドドメイン特権を追加してください:
    • Xcodeプロジェクトを開いてください
    • アプリターゲットを選択してください
    • 「Signing & Capabilities」に移動してください
    • 「+ Capability」をクリックし、「アソシエーテッドドメイン」を選択してください
    • 追加 applinks:yourdomain.com

ステップ3:フォールバックページを作成する

フォールバックページを作成してください。フォールバックページは、ユーザーがアプリをインストールしていない場合に、リダイレクトURLにアクセスしたときに表示されます。

<!DOCTYPE html>
<html>
<head>
  <title>Redirecting...</title>
  <meta http-equiv="refresh" content="0;url=https://yourdomain.com/app-download">
</head>
<body>
  <p>Redirecting to download page...</p>
</body>
</html>

ステップ4:Capacitorアプリに決済ボタンを実装する

Now, add the payment button to your app:

import { Capacitor } from '@capacitor/core';

export async function openPaymentLink(userEmail, userId) {
  // Use your actual Stripe payment link
  const baseUrl = 'https://buy.stripe.com/your_payment_link';
  
  // Add URL parameters to customize the experience
  const params = new URLSearchParams({
    prefilled_email: encodeURIComponent(userEmail),
    client_reference_id: userId
  });

  const fullUrl = `${baseUrl}?${params.toString()}`;
  
  // Simple window.open works in both web and Capacitor
  // Using _blank opens in Safari on iOS which is important for users with saved Stripe Link credentials
  window.open(fullUrl, '_blank');
}

Safariの重要性: Safariで開く場合 ( window.open) としてインストール済みのアプリ内ブラウザではなく、Safariを使用すると、Stripe Linkで以前保存したクレジット情報を持っているユーザーは自動的にクレジット情報を入力する必要がなくなるため、チェックアウトのスムーズな経験が実現し、ユーザーが再度クレジット情報を入力する必要がなくなるため、摩擦と放棄率が大幅に減少します。

ユーザーがリダイレクトされたときにアプリが Universal Links を処理できるように設定してください。

  1. 最初に App プラグインをインストールしてください。
npm install @capacitor/app
  1. App プラグインをアプリに登録してください。
import { App } from '@capacitor/app';

// In your initialization code
App.addListener('appUrlOpen', (event) => {
  // Example URL: https://yourdomain.com/checkout_redirect?session_id=cs_test_...
  const url = new URL(event.url);
  
  if (url.pathname.startsWith('/checkout_redirect')) {
    // Extract any parameters you need
    const params = new URLSearchParams(url.search);
    const sessionId = params.get('session_id');
    
    // Handle successful payment
    if (sessionId) {
      // Verify the payment on your server if needed
      verifyPayment(sessionId);
      
      // Update UI to reflect successful purchase
      updatePurchaseStatus(true);
    }
  }
});

async function verifyPayment(sessionId) {
  // Call your backend to verify the payment
  // This is optional if you're relying on webhooks
}

function updatePurchaseStatus(success) {
  // Update your app UI to reflect purchase status
}

ステップ 6: 注文処理の Webhook を設定する

最後に、成功した支払いを処理する Webhook をサーバーに設定してください。

// Using Express.js as an example
const express = require('express');
const stripe = require('stripe')('sk_test_your_stripe_secret_key');
const app = express();

// Use raw body parser for webhook signature verification
app.post('/webhook', express.raw({type: 'application/json'}), async (req, res) => {
  const sig = req.headers['stripe-signature'];
  const webhookSecret = 'whsec_your_webhook_secret';
  
  let event;
  
  try {
    event = stripe.webhooks.constructEvent(req.body, sig, webhookSecret);
  } catch (err) {
    console.log(`Webhook Error: ${err.message}`);
    return res.status(400).send(`Webhook Error: ${err.message}`);
  }
  
  // Handle the checkout.session.completed event
  if (event.type === 'checkout.session.completed') {
    const session = event.data.object;
    
    // Retrieve client_reference_id (your user ID)
    const userId = session.client_reference_id;
    
    // Grant access to the purchased content
    await grantAccess(userId, session.id);
  }
  
  res.status(200).send();
});

async function grantAccess(userId, sessionId) {
  // Your logic to grant access to the purchased content
  // This could be updating a database, sending a notification, etc.
}

app.listen(3000, () => console.log('Webhook server running on port 3000'));

Androidの互換性

明確に言えば、Epic v. Apple の判決は、モバイル決済のランドスケープを根本的に変えました。iOSアプリに直接影響を与えるだけでなく、外部の決済方法を使用してきたAndroid開発者にとっては、Android開発者の立場を強化しました。

Android開発者は、完全な自信を持って外部の決済ソリューションを実装できます。 Appleの判決の先例は、開発者がさまざまなプラットフォームから潜在的な将来の制限から守っています。この裁判の判決は、多くのAndroid開発者が何年も前から行ってきたことの正当性を証明しています - 低い手数料のオプションを提供することです。

GoogleのPlayストアは、Appleと比べて外部の決済方法については常に制限が少なかったのですが、法律の先例が確立された今、Stripeや他の外部の決済プロバイダーをAndroidアプリに実装するリスクはほとんどありません。Stripe Payment Linksのアプローチを使用して、安全な法律の土台の上で進んでください。

iOS向けの実装と同様に、Androidデバイス向けの実装はほぼ同じです。Google Playストアでは外部の決済方法について制限が少ないため、Stripe Payment Linksのアプローチを使用するだけで、特別な披露ダイアログが必要ありません。

デープリンクを処理するには、次の手順を実行する必要があります。

  1. App Linksを設定する AndroidManifest.xml リダイレクトURLを処理する
  2. ドメインにアプリの詳細を含むファイルを作成する .well-known/assetlinks.json 同じリスナーロジックを使用して、成功した決済を処理する
  3. Capgoの美しさは、プラットフォーム固有の設定を実装した後、実際の決済フローは両方のプラットフォームで同じままであるということです。 appUrlOpen Capgoの美しさは、プラットフォーム固有の設定を実装した後、実際の決済フローは両方のプラットフォームで同じままであるということです。

The beauty of Capacitor is that once you’ve implemented the platform-specific configurations, the actual payment flow code remains the same across both platforms.

支払いUIの作成

Vueで使用できる支払いボタンコンポーネントの例を以下に示します。Capacitorアプリに追加できます。

<template>
  <div class="payment-container">
    <div class="pricing-card">
      <h2 class="mb-4 text-xl font-bold">{{ product.name }}</h2>
      <p class="mb-6 text-gray-600">{{ product.description }}</p>
      <div class="mb-6 price-tag">
        <span class="text-2xl font-bold">${{ product.price }}</span>
        <span v-if="product.isSubscription" class="text-sm text-gray-500">/month</span>
      </div>
      <button 
        @click="handlePayment" 
        class="py-3 w-full font-medium text-white bg-indigo-600 rounded-lg transition-colors hover:bg-indigo-700"
      >
        Purchase Now
      </button>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { Dialog } from '@capacitor/dialog';

const props = defineProps({
  product: {
    type: Object,
    required: true
  },
  userEmail: {
    type: String,
    default: ''
  },
  userId: {
    type: String,
    required: true
  }
});

const isLoading = ref(false);

async function showExternalPaymentDisclosure() {
  const { value } = await Dialog.confirm({
    title: 'Leaving App for Payment',
    message: 'You are about to leave this app to make a payment. Apple is not responsible for the privacy or security of payments that are not made through the App Store. All payment-related issues, including refunds, must be handled by our support team.',
    okButtonTitle: 'Continue',
    cancelButtonTitle: 'Cancel'
  });
  
  return value;
}

async function openPaymentLink() {
  // Use your actual Stripe payment link
  const baseUrl = 'https://buy.stripe.com/your_payment_link';
  
  // Add URL parameters to customize the experience
  const params = new URLSearchParams({
    prefilled_email: encodeURIComponent(props.userEmail),
    client_reference_id: props.userId
  });

  const fullUrl = `${baseUrl}?${params.toString()}`;
  
  // Simple window.open works in both web and Capacitor
  // Using _blank opens in Safari on iOS which is important for users with saved Stripe Link credentials
  window.open(fullUrl, '_blank');
}

async function handlePayment() {
  isLoading.value = true;
  try {
    // Only show the disclosure on iOS
    if (window.Capacitor?.getPlatform() === 'ios') {
      const userConfirmed = await showExternalPaymentDisclosure();
      if (!userConfirmed) return;
    }
    
    await openPaymentLink();
  } catch (error) {
    console.error('Payment error:', error);
    await Dialog.alert({
      title: 'Payment Error',
      message: 'There was an error initiating the payment. Please try again.'
    });
  } finally {
    isLoading.value = false;
  }
}
</script>

地域の差異を処理する

新しいAppleガイドラインは、アメリカのApp Storeにのみ適用されるため、ユーザーの地域を検出して適切な支払い方法を適用する戦略が必要になります。IP地理位置を使用したより信頼性の高いアプローチを以下に示します。

import { Capacitor } from '@capacitor/core';

async function determinePaymentMethod() {
  // Always use Stripe for Android
  if (Capacitor.getPlatform() !== 'ios') {
    return 'external';
  }
  
  try {
    // Use a geolocation service to determine user's country
    const response = await fetch('https://ipapi.co/json/');
    const locationData = await response.json();
    
    // Check if the user is in the United States
    if (locationData.country_code === 'US') {
      return 'external'; // Can use Stripe Payment Links
    } else {
      return 'iap'; // Must use In-App Purchases
    }
  } catch (error) {
    console.error('Error detecting region:', error);
    return 'iap'; // Default to IAP to be safe
  }
}

export async function processPayment(product, userEmail, userId) {
  const paymentMethod = await determinePaymentMethod();
  
  if (paymentMethod === 'external') {
    // Use Stripe Payment Links
    await initiateExternalPayment(userEmail, userId);
  } else {
    // Use Apple's In-App Purchase
    await initiateInAppPurchase(product.appleProductId);
  }
}

このアプローチでは、ユーザーのIPアドレスに基づいてユーザーの国を決定するために、無料の ipapi.co サービスを使用します。MaxMindなどの他の地理位置サービスを使用することもできます。また、セキュリティの向上のために、このチェックをサーバー側で実行することもできます。

注意: このアプローチは機能しますが、IP地理位置は常に100%の精度ではありません。 mission-criticalアプリケーションでは、複数の検出方法を使用するか、ユーザーに地域を手動で選択させることを検討してください。

Capacitor プラグインを使用したより正確な位置検出

より正確な位置検出を実現するには、Capacitor Geolocation プラグインと@capgo/capacitor-nativegeocoderを使用して、ユーザーの国をより高精度で決定できます。

  1. 最初に必要なプラグインをインストールします。
npm install @capacitor/geolocation @capgo/capacitor-nativegeocoder
  1. Capacitor プロジェクトでプラグインを設定します。Capacitorプロジェクトに次のコードを追加します。 capacitor.config.ts:
import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  // Your existing app configuration (appId, appName, etc.)
  plugins: {
    Geolocation: {
      // Request precise location access on iOS
      iosLocationAccuracy: 'reduced'
    }
  }
};

export default config;
  1. 地理位置を基にした地域検出を実装する:
import { Capacitor } from '@capacitor/core';
import { Geolocation } from '@capacitor/geolocation';
import { NativeGeocoder } from '@capgo/capacitor-nativegeocoder';

async function isUserInUSA() {
  try {
    // Request permission first
    const permissionStatus = await Geolocation.requestPermissions();
    
    if (permissionStatus.location === 'granted') {
      // Get current position
      const position = await Geolocation.getCurrentPosition({
        timeout: 10000,
        enableHighAccuracy: false
      });
      
      // Use NativeGeocoder to reverse geocode the coordinates
      const results = await NativeGeocoder.reverseGeocode({
        latitude: position.coords.latitude,
        longitude: position.coords.longitude,
        useLocale: true,
        maxResults: 1
      });
      
      if (results.addresses.length > 0) {
        // Check if the user is in the USA
        return results.addresses[0].countryCode === 'US';
      }
    }
    
    // If we couldn't determine location or permission denied, fall back to IP detection
    return await isUserInUSAByIP();
  } catch (error) {
    console.error('Error detecting location:', error);
    // Fall back to IP detection on error
    return await isUserInUSAByIP();
  }
}

async function isUserInUSAByIP() {
  try {
    const response = await fetch('https://ipapi.co/json/');
    const data = await response.json();
    return data.country_code === 'US';
  } catch (error) {
    console.error('Error detecting IP location:', error);
    return false; // Default to false to be safe
  }
}

export async function determinePaymentMethod() {
  // Always use Stripe for Android
  if (Capacitor.getPlatform() !== 'ios') {
    return 'external';
  }
  
  // Check if user is in the USA
  const isUSA = await isUserInUSA();
  return isUSA ? 'external' : 'iap';
}

export async function processPayment(product, userEmail, userId) {
  const paymentMethod = await determinePaymentMethod();
  
  if (paymentMethod === 'external') {
    // Use Stripe Payment Links
    await initiateExternalPayment(userEmail, userId);
  } else {
    // Use Apple's In-App Purchase
    await initiateInAppPurchase(product.appleProductId);
  }
}

この実装では、ユーザーが物理的にアメリカにいるかどうかをより正確に判断する方法を提供します。まず、デバイスのGPSとネイティブのジオコーダーを使用して国を決定します。許可の問題やその他のエラーにより失敗した場合、IPベースの検出にフォールバックします。

必要な権限をあなたの info.plist (iOS)と AndroidManifest.xml (Android)ファイルに追加することを忘れないでください:

iOS (ios/App/App/Info.plist):

<key>NSLocationWhenInUseUsageDescription</key>
<string>We need your location to determine which payment method to use based on regional availability.</string>

Android (android/app/src/main/AndroidManifest.xml):

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

このアプローチを使用すると、ユーザーが新しいAppleガイドラインの下で外部の支払いオプションに適格であるかどうかを判断する最も正確な方法になります。

サブスクリプションの管理

Stripeを使用することで、サブスクリプションを提供および管理することができる一大きな利点があります。ここでは、Capacitorアプリでサブスクリプション管理を取り扱います:

1. サブスクリプション管理ページの作成

アプリ内にサブスクリプション管理ページを追加して、ユーザーの有効なサブスクリプションを表示します:

<template>
  <div class="subscription-manager">
    <div v-if="isLoading" class="loading-indicator">
      Loading subscription data...
    </div>
    
    <div v-else-if="subscription" class="subscription-info">
      <h2 class="mb-4 text-xl font-bold">Your Subscription</h2>
      
      <div class="mb-6 plan-details">
        <p><span class="font-medium">Plan:</span> {{ subscription.planName }}</p>
        <p><span class="font-medium">Status:</span> {{ subscription.status }}</p>
        <p><span class="font-medium">Renews:</span> {{ formatDate(subscription.currentPeriodEnd) }}</p>
      </div>
      
      <button 
        @click="manageSubscription" 
        class="py-3 w-full font-medium text-white bg-indigo-600 rounded-lg transition-colors hover:bg-indigo-700"
      >
        Manage Subscription
      </button>
    </div>
    
    <div v-else class="no-subscription">
      <p class="mb-4">You don't have an active subscription.</p>
      <button 
        @click="goToPricingPage" 
        class="py-3 w-full font-medium text-white bg-indigo-600 rounded-lg transition-colors hover:bg-indigo-700"
      >
        View Plans
      </button>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { getUserSubscription } from '../services/subscription';

const subscription = ref(null);
const isLoading = ref(true);

onMounted(async () => {
  try {
    const userData = await getUserSubscription();
    subscription.value = userData.subscription;
  } catch (error) {
    console.error('Failed to load subscription:', error);
  } finally {
    isLoading.value = false;
  }
});

function formatDate(timestamp) {
  return new Date(timestamp * 1000).toLocaleDateString();
}

function manageSubscription() {
  // Open Stripe Customer Portal
  window.open(subscription.value.portalUrl, '_blank');
}

function goToPricingPage() {
  // Navigate to pricing page
  // router.push('/pricing');
}
</script>

2. サブスクリプション管理用の顧客ポータル

Stripeは、ユーザーがサブスクリプションを管理できる顧客ポータルを提供しています。このポータルへのリンクを作成するには、サーバーから実行します:

// Server-side code (Node.js)
const stripe = require('stripe')('sk_your_stripe_secret_key');

async function createPortalSession(customerId) {
  const session = await stripe.billingPortal.sessions.create({
    customer: customerId,
    return_url: 'https://yourdomain.com/account',
  });
  
  return session.url;
}

アプリストアの規制に準拠する

Appleのガイドラインに準拠するように実装するには:

  1. 外部購入に関する適切な披露を含める
  2. モーダルシートを実装して、ユーザーがアプリを離れることを知らせる (Appleの要件に従う)
  3. アプリ内で行われる購入に対してAppleのコミッションを回避しないようにする
  4. ユーザーにAppleがトランザクションに責任を負っていないことを明確に伝える

必要な披露モーダルの実装例

import { Dialog } from '@capacitor/dialog';

async function showExternalPaymentDisclosure() {
  const { value } = await Dialog.confirm({
    title: 'Leaving App for Payment',
    message: 'You are about to leave this app to make a payment. Apple is not responsible for the privacy or security of payments that are not made through the App Store. All payment-related issues, including refunds, must be handled by our support team.',
    okButtonTitle: 'Continue',
    cancelButtonTitle: 'Cancel'
  });
  
  return value;
}

export async function initiateExternalPayment(userEmail, userId) {
  const userConfirmed = await showExternalPaymentDisclosure();
  
  if (userConfirmed) {
    await openPaymentLink(userEmail, userId);
  }
}

実装をテストする

実装をテストするには:

  1. アプリ内で支払いボタンをクリックし、披露を表示し、次にStripeの支払いページを開く
  2. Stripe テストカードを使用したテスト決済を完了する 4242 4242 4242 4242
  3. 決済後、universal linkを介してアプリに戻されるはずです
  4. ウェブフックがイベントを受信したことを確認する checkout.session.completed イベント

まとめ

iOS アプリでデジタル商品に対する外部決済オプションを使用できるようになったことは、開発者にとって大きな変化です。この変化は現在、アメリカの App Store のアプリにのみ適用されますが、Apple のインアプリ購入システムに代わる重要な代替手段を提供しています。

Stripe Payment Linksを使用することで、Capacitor を使用して、ストリーム化されたチェックアウトエクスペリエンスを実装し、Apple のガイドラインに準拠することができます。このアプローチでは、Apple のインアプリ購入システムに比べて、Stripe の強力な決済インフラストラクチャ、低い処理手数料 (3% vs 30%)、迅速な支払い (日数ではなく月数) の利点を得ることができます。

顧客サポートや返金問題をすべて自分で処理する必要があります。これらの取引は Apple のエコシステム外で発生するためです。

Capacitor アプリで Stripe Payment Links を実装したことはありませんか?コメント欄でご意見をご覧ください。

FAQ

Q: このアプローチは Apple のガイドラインに準拠していますか?
A: 2025 年 5 月 1 日以降、Apple は、アメリカの App Store でのアプリ配布に伴うデジタル商品やサービスに対する外部決済方法へのリンクを許可しています。ただし、必要な披露を含める必要があります。

Q: Appleのコミッションを支払う必要がありますか?外部の決済方法を使用する場合
A: そうでない。新しい規則の1つの中でもあるのは、Appleのシステム外で処理される決済は、そのコミッションの対象外であるということです。

Q: この新しい規則を利用するには、会社がアメリカに本社を持つ必要がありますか?
A: そうでない。世界中の会社が、US App Storeにアプリを公開し、購入を実行するユーザーがアメリカにいる場合に限り、外部の決済方法を実装できます。判決は、市場(US App Store)とユーザーの位置、そして会社の位置とは別のものです。つまり、ヨーロッパ、アジア、南アメリカ、またはどこからでも開発者が、米国に拠点を置く顧客向けにStripe Payment Linksを実装できます。

Q: 米国外のユーザーが外部の決済オプションを使用しようとした場合に何が起こりますか?
A: 米国にいるユーザーだけに外部の決済オプションを提示するように、地域検出(記事で示されているように)を実装する必要があります。米国以外の地域では、Appleのインアプリ購入システムを継続して使用する必要があります。

Q: この機能を物理商品やアプリ外で消費されるサービスに使用できますか?
A: はい、アプリ外で消費される物理商品やサービス(乗り物のシェアリングや食事の宅配など)に対しては、Appleは常に外部の決済方法を許可しています。

Capacitorから続けて:Stripe Payments in New Apple Guidelines

Stripe Payments in __CAPGO_KEEP_0__: New Apple Guidelinesを使用している場合、セキュリティとコンプライアンスの計画を立てるには、それを接続する必要があります。 Capacitorから続けて:Stripe Payments in New Apple Guidelines __CAPGO_KEEP_0__から続けて:Stripe Payments in New Apple Guidelines 暗号化 __CAPGO_KEEP_0__ の実装詳細における暗号化のための 法的適合性 __CAPGO_KEEP_0__ の実装詳細における法的適合性のための Capgo セキュリティ スキャナー Capgo セキュリティ スキャナーの製品ワークフローのための Capgo セキュリティ Capgo セキュリティの製品ワークフローのための Capgo トラスト センター Capgo トラスト センターの製品ワークフローのための

リアルタイムでCapacitorアプリの更新

ウェブ層のバグが生じた場合、Capgoを使用して修正を配信するのではなく、数日待たずにアプリストアの承認の通常のパスを通して修正を配信する。ユーザーはバックグラウンドで更新を受け取り、ネイティブの変更は通常の承認パスを通して残る。

始めましょう

ブログの最新記事

Capgoは、プロフェッショナルなモバイルアプリを作成するために必要な最良の洞察を提供します。