Closed3

iOS/Android課金実装

yagi_engyagi_eng

iOS

Verify Receipt

  • Receive Payload from the Frontend (FE):
    • Upon successful completion of a transaction on the mobile app, send a payload containing the transaction details (including the transactionId and other details like the product identifier, quantity, etc.) to server (BE).
  • Invoke the App Store API:
  • Compare the Data:
    • Once receive data from the App Store, compare the information from TransactionInfo with the payload sent by the FE. Ensure that all details such as product identifier, quantity, etc. match.
  • Confirm or Reject the Transaction:
    • If all the details match, validate the transaction and update the status in database.
      If there are any discrepancies, reject the transaction and send an appropriate response back to the mobile app.

Necessary stuffs to call App store api

App Store Server Notifications

https://developer.apple.com/documentation/appstoreservernotifications
https://qiita.com/mogmet/items/c6f8f4485e4c354a170c
https://qiita.com/Masataka-n/items/6f98a5a9fee7b28ccd1f

Details

Upgrade / Downgrade

https://developer.apple.com/jp/help/app-store-connect/reference/auto-renewable-subscription-information/

Upgrade
ユーザが現在登録しているサブスクリプションより、高いレベルのサブスクリプションに切り替える場合。切り替える前の低いレベルのサブスクリプションから比例配分された金額が、元の支払い方法で返金されます。その後、高いレベルのサブスクリプションに対する料金が請求され、当該サブスクリプションが直ちに適用されます。アップグレードを行なった日付が、新しいレベルのサブスクリプションの更新日となります。
Downgrade
ユーザが現在登録しているサブスクリプションより、低いレベルのサブスクリプションに切り替える場合。低いレベルのサブスクリプションに対する料金は、次回更新日に請求されます。
Crossgrade
ユーザが現在登録しているサブスクリプションと、同じレベルのサブスクリプションに切り替える場合。サブスクリプションの期間が異なる場合、クロスグレードは次回更新日から適用されます。サブスクリプションの期間が同じ場合、切り替える前のサブスクリプションから比例配分された金額が、元の支払い方法で返金されます。その後、新しいサブスクリプションに対する料金が請求され、当該サブスクリプションが直ちに適用されます。クロスグレードを行なった日付が、新しいレベルのサブスクリプションの更新日となります。

Promote subscription on App store

Can do it from here.

To promote this subscription on the App Store, add a 1024 x 1024 pixel promotional image below. It'll appear on your app's product page and when a customer redeems an offer code. Promotional images may also appear in search results or be featured by the editorial team. You can promote up to 20 in-app purchases at a time. Make sure your app supports the required StoreKit APIs. Learn More

Library for Golang

https://github.com/awa/go-iap

このスクラップは2023/10/28にクローズされました