{"id":22069965,"url":"https://github.com/napolab/react-native-gmo-payment","last_synced_at":"2026-05-01T01:32:19.600Z","repository":{"id":195841163,"uuid":"693837974","full_name":"napolab/react-native-gmo-payment","owner":"napolab","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-15T15:32:06.000Z","size":477,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-13T19:50:15.082Z","etag":null,"topics":["gmo-payment","react-native","webview"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-gmo-payment","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/napolab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-19T20:15:56.000Z","updated_at":"2023-09-21T03:20:11.000Z","dependencies_parsed_at":"2023-09-19T20:45:49.067Z","dependency_job_id":"ed8d454b-19b5-400d-a262-94a7dee79405","html_url":"https://github.com/napolab/react-native-gmo-payment","commit_stats":null,"previous_names":["napolab/react-native-gmo-payment"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/napolab/react-native-gmo-payment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napolab%2Freact-native-gmo-payment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napolab%2Freact-native-gmo-payment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napolab%2Freact-native-gmo-payment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napolab%2Freact-native-gmo-payment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/napolab","download_url":"https://codeload.github.com/napolab/react-native-gmo-payment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napolab%2Freact-native-gmo-payment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32482460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gmo-payment","react-native","webview"],"created_at":"2024-11-30T20:14:15.937Z","updated_at":"2026-05-01T01:32:19.578Z","avatar_url":"https://github.com/napolab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GMO Multipayment Library for React Native\n\nこのライブラリは、React Native アプリケーションで GMO ペイメントゲートウェイの Multipayment API を簡単に利用できるように設計されました。通常、Multipayment API はブラウザ環境を対象としていますが、このライブラリを使用することで、React Native アプリケーションから WebView 経由で API を呼び出すことが可能になります。\n\n## インストール\n\n```bash\nnpm install react-native-gmo-payment\n# または\nyarn add react-native-gmo-payment\n```\n\n## 使い方\n\n### 1. `GMOMultipaymentProvider` の設定\n\nアプリケーションのルートコンポーネントで `GMOMultipaymentProvider` を設定します。このプロバイダーは、GMO Multipayment の環境設定とショップIDを受け取ります。\n\n```jsx\nimport { GMOMultipaymentProvider } from \"react-native-gmo-payment\";\n\nfunction App() {\n  return (\n    \u003cGMOMultipaymentProvider\n      env=\"production\"\n      shopId=\"YOUR_SHOP_ID\"\n      onReady={() =\u003e console.log(\"GMO Multipayment is ready\")}\n    \u003e\n      {/* 他のアプリケーションコンポーネント */}\n    \u003c/GMOMultipaymentProvider\u003e\n  );\n}\n\nexport default App;\n```\n\n### 2. ペイメントトークンの取得\n\n`getMultiPaymentToken` 関数を使用してペイメントトークンを取得します。この関数は、カード情報とトークンの取得数をパラメータとして受け取ります。\n\n```jsx\nimport { getMultiPaymentToken } from \"react-native-gmo-payment\";\n\nasync function fetchPaymentToken() {\n  try {\n    const paymentData = {\n      cardno: \"4111111111111111\",\n      expire: \"2302\",\n      securitycode: \"123\",\n      holdername: \"TARO YAMADA\",\n      tokennumber: 1,\n    };\n\n    const result = await getMultiPaymentToken(paymentData);\n    console.log(\"Payment Token Result:\", result);\n  } catch (error) {\n    console.error(\"Error fetching payment token:\", error);\n  }\n}\n```\n\n### 3. クライアント状態の監視\n\n新しい `watchClientState` 関数を使用して GMO Multipayment クライアントの状態を監視できます。この関数はコールバック関数を受け取り、クライアントの状態が変更されるたびに呼び出されます。\n\n```jsx\nimport { watchClientState } from \"react-native-gmo-payment\";\n\nconst subscription = watchClientState((state) =\u003e {\n  console.log(\"Client state:\", state);\n});\n\n// サブスクリプションを後で解除する場合\nsubscription.unsubscribe();\n```\n\n## API ドキュメント\n\n### Types\n\n- `PaymentResultCode`: ペイメント処理の結果コードを表します。\n- `PaymentTokenObject`: ペイメントトークンの詳細情報を含むオブジェクトです。\n- `PaymentResult`: ペイメントトークン取得の結果を表すオブジェクトです。\n- `Payment`: カード情報とトークン取得数を含むオブジェクトです。\n- `MultipaymentConfig`: Multipayment API の設定を表すオブジェクトです。\n- `State`: クライアントの現在の状態を表します。この型は \"loading\" または \"ready\" のいずれかの値を取ります。\n- `GMOMultipaymentProviderProps`: `GMOMultipaymentProvider` コンポーネントのプロパティを表します。\n\n### Functions\n\n- `getClientState`: GMO Multipayment クライアントの現在の状態を取得します。この関数は非同期であり、状態を表\n\nす文字列を返します。\n\n- `getMultiPaymentConfig`: 現在の Multipayment API の設定を取得します。\n- `getMultiPaymentToken`: カード情報を使用してペイメントトークンを取得します。\n- `initMultiPayment`: ショップIDを使用して Multipayment API を初期化します。\n- `watchClientState`: クライアントの状態変更を監視する関数です。状態が変更されるたびにコールバック関数が呼び出されます。\n\n詳細な型情報については、ソースコードを参照してください。\n\n## ライセンス\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnapolab%2Freact-native-gmo-payment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnapolab%2Freact-native-gmo-payment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnapolab%2Freact-native-gmo-payment/lists"}