Skip to content

PokepayClient.topup() が checkId に文字列リテラル 'check.id' を渡している #59

Description

@masatoi

概要

PokepayClient.topup()check.id ではなく 'check.id' という文字列リテラルを送っています。呼べば必ず失敗します。

lib/pokepay_sdk.dart:275-279:

  Future<UserTransaction> topup(
      {required Check check, String? accountId}) async {
    return await this.api.createUserTransactionWithCheck(
        checkId: 'check.id', accountId: accountId);
  }

checkId には引数 checkid を渡すのが意図のはずです。

-        checkId: 'check.id', accountId: accountId);
+        checkId: check.id, accountId: accountId);

引数 check が本文で一度も使われておらず、クォートの付け忘れがそのまま残ったものと見られます。

影響

PokepayClient.topup() は現状使い物になりません。checkId"check.id" が渡るため、サーバ側で UUID として解決できず必ずエラーになります。

PokepayAPI.createUserTransactionWithCheck() を直接呼んでいる利用者には影響しません。

確認状況

コードリーディングのみで、実行はしていません。 残高を動かす API のため dev 環境での疎通確認からは意図的に除外しました。

補足

同じ PokepayClientpay()billId: bill.token を渡しており、こちらは token (URL 文字列) を billId という名前のパラメータに入れています。ネイティブ側が URL を受ける前提なら正しい可能性がありますが、topup() を直すときに併せて確認したほうがよさそうです。

環境

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions