Xendit Python: AttributeError type object EWallet has no attribute create_ewallet_charge

Calling create_ewallet_charge on the Xendit Python client raised AttributeError: type object 'EWallet' has no attribute 'create_ewallet_charge'. A community member found a workaround: call the static method directly via from xendit.models.ewallet.ewallet import EWallet. A maintainer confirmed it was an import issue with conflicting EWallet classes and raised a fix PR. The fix was released in v0.2.2, and the maintainer confirmed it on the thread. Upgrading past v0.2.2 resolves the AttributeError.

The AttributeError came from conflicting EWallet classes in the SDK's imports, so the method wasn't visible on the class you imported. Fix: upgrade xendit-python to v0.2.2 or later, where the import conflict was fixed. If you cannot upgrade yet, the workaround is to call the static method directly: from xendit.models.ewallet.ewallet import EWallet and then EWallet.create_ewallet_charge(...) with your api_key. The maintainer confirmed the v0.2.2 release fixed it. Source: https://github.com/xendit/xendit-python/issues/64

Source: https://github.com/xendit/xendit-python/issues/64