Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Provider Class example raises an exception #405

Open
radekholy24 opened this issue Apr 6, 2024 · 3 comments
Open

Create a Provider Class example raises an exception #405

radekholy24 opened this issue Apr 6, 2024 · 3 comments

Comments

@radekholy24
Copy link

The example in the Create a Provider Class section of the documentation does not work.

Reproducer:

  1. Copy the example from the Create a Provider Class section of the documentation
  2. Implement the process_data and get_form methods
  3. Run an app that uses the provider

Actual behavior:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'payments.providers'

Expected behavior:

The app is integrated with my payment provider.

@Abhishek-jha-96
Copy link

Abhishek-jha-96 commented Apr 19, 2024

Though you are correct there is no 'payments.providers' module. one thing you can try is use:
from payments.core import BasicProvider

i think this might will serve the purpose.
(Note* : Use a factory method or function to instantiate the subclass rather than instantiating BasicProvider directly.)

@radekholy24
Copy link
Author

Yes, from payments.core import BasicProvider works. Could you fix the example, please?

@Abhishek-jha-96
Copy link

Sure

Abhishek-jha-96 added a commit to Abhishek-jha-96/django-payments that referenced this issue Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants