Skip to content

payjp.error.InvalidRequestError: Sending credit card numbers directly to the API is generally unsafe. Use Checkout or payjp.js, payjp-ios, payjp-android. #22

@emoto-yasushi

Description

@emoto-yasushi

【使用OS】Windows11
【Python実行環境】WinPython

Python製のデスクトップアプリに決済システムを導入したいと思い、以下のexample.pyを実行してみました。
https://github.com/payjp/payjp-python/blob/master/payjp/example.py

すると、以下のようなエラーが出ました。

Traceback (most recent call last):
  File "C:\Users\emoto\Documents\hold\payjptest.py", line 5, in <module>
    resp = payjp.Charge.create(
  File "C:\Users\emoto\Documents\WPy64-31050\python-3.10.5.amd64\lib\site-packages\payjp\resource.py", line 288, in create
    response, api_key = requestor.request('post', url, params, headers)
  File "C:\Users\emoto\Documents\WPy64-31050\python-3.10.5.amd64\lib\site-packages\payjp\api_requestor.py", line 59, in request
    response = self.interpret_response(body, code)
  File "C:\Users\emoto\Documents\WPy64-31050\python-3.10.5.amd64\lib\site-packages\payjp\api_requestor.py", line 179, in interpret_response
    self.handle_api_error(body, code, response)
  File "C:\Users\emoto\Documents\WPy64-31050\python-3.10.5.amd64\lib\site-packages\payjp\api_requestor.py", line 72, in handle_api_error
    raise error.InvalidRequestError(
payjp.error.InvalidRequestError: Sending credit card numbers directly to the API is generally unsafe. Use Checkout or payjp.js, payjp-ios, payjp-android.

「直接課金を実行すると危険なのでpayjp.jsを使うように」というエラーメッセージが出ています。

デスクトップアプリから、課金を直接実行することはできないのでしょうか?
payjp.jsをデスクトップアプリから呼び出して課金情報をフィードバックするサンプルなどはありますでしょうか?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions