Re: Not sure if I am doing django-paypal correctly

2021-12-31 Thread lone...@gmail.com
I found a better article at: Better Django-paypal article 
.  For 
the most part, it does a really thorough explanation of what needs to be 
done.  There were some things that I had to adjust myself, but that was 
easy enough.  My God, I feel like I just ran a mental marathon.

On Thursday, December 30, 2021 at 10:51:57 PM UTC-5 Joel T wrote:

> The code is really simple to implement, but I don't think the explanation 
> was intuitive enough.
>
> You would need to create a signal like so
>
> #hooks.py
> from django.dispatch import Signal
>
> success_signal = Signal(providing_args=[])
>
> #views.py
> from .hooks import success_signal
> ... # after payment
>
> success_signal.connect(handler_function)
> success_signal.send(sender=None, **kwargs)
>
> This assumes that you already have a listener waiting for the signal 
> broadcast, 
> Also replace None with your sender (optional), and replace **kwargs with 
> any kwargs you're sending to your listeners. 
>
> Cheers 
>
>
> On Wed, Dec 29, 2021, 9:23 PM lone...@gmail.com  wrote:
>
>> Hello all,
>>
>>   I decided to try and accept payments on my web application.  I have 
>> chosen the django-paypal application to help me out with this task.  I 
>> found a decent walkthrough at: 
>> how-to-accept-paypal-payments-on-your-django-application 
>> .
>>   
>> I was able to follow everything until the last step of: "6. Setup a 
>> listener to detect successful Paypal payments"  I have never really setup 
>> any listeners before so I did not know what to do.  I decided to read the 
>> Django-PayPal 
>> ReadTheDocs 
>>  and I 
>> found a file that looked structurally similar to what I found on the 
>> original walkthrough I had found.  It looks like I needed to make a 
>> hooks.py file in my project directory.  I have accomplished that, and the 
>> ReadTheDocs says: "Remember to ensure that import the hooks file is 
>> imported i.e. that you are connecting the signals when your project 
>> initializes. The standard way to do this is to create an AppConfig class 
>> 
>>  and 
>> add a ready() 
>> 
>>  method, 
>> in which you can register your signal handlers or import a module that does 
>> this."  This is where I am getting lost.  I am not quite sure what to 
>> do.  Does anyone have a better walkthrough or know what I need to do?
>>
>> Thank you.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d9567663-20fb-4f43-a6c5-131f23497a7bn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8058264-9dda-443c-963f-18a8edfc4737n%40googlegroups.com.


Re: Not sure if I am doing django-paypal correctly

2021-12-30 Thread Joel Tanko
The code is really simple to implement, but I don't think the explanation
was intuitive enough.

You would need to create a signal like so

#hooks.py
from django.dispatch import Signal

success_signal = Signal(providing_args=[])

#views.py
from .hooks import success_signal
... # after payment

success_signal.connect(handler_function)
success_signal.send(sender=None, **kwargs)

This assumes that you already have a listener waiting for the signal
broadcast,
Also replace None with your sender (optional), and replace **kwargs with
any kwargs you're sending to your listeners.

Cheers


On Wed, Dec 29, 2021, 9:23 PM lone...@gmail.com  wrote:

> Hello all,
>
>   I decided to try and accept payments on my web application.  I have
> chosen the django-paypal application to help me out with this task.  I
> found a decent walkthrough at:
> how-to-accept-paypal-payments-on-your-django-application
> .
> I was able to follow everything until the last step of: "6. Setup a
> listener to detect successful Paypal payments"  I have never really setup
> any listeners before so I did not know what to do.  I decided to read the 
> Django-PayPal
> ReadTheDocs
>  and I
> found a file that looked structurally similar to what I found on the
> original walkthrough I had found.  It looks like I needed to make a
> hooks.py file in my project directory.  I have accomplished that, and the
> ReadTheDocs says: "Remember to ensure that import the hooks file is
> imported i.e. that you are connecting the signals when your project
> initializes. The standard way to do this is to create an AppConfig class
> 
>  and
> add a ready()
> 
>  method,
> in which you can register your signal handlers or import a module that does
> this."  This is where I am getting lost.  I am not quite sure what to
> do.  Does anyone have a better walkthrough or know what I need to do?
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d9567663-20fb-4f43-a6c5-131f23497a7bn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ4Kmg7mQXtRCh3MCTS-jKVdfoK0ZW5BTc2PLFWTO5142hcyRQ%40mail.gmail.com.


Re: Not sure if I am doing django-paypal correctly

2021-12-30 Thread lone...@gmail.com
Hey man, beggars cannot be choosers!  Thank you!

On Thursday, December 30, 2021 at 1:28:12 AM UTC-5 Yorben Verhoest wrote:

> Hello
>
> I'm a Django Noobie and maybe I'm completely wrong about this but in my 
> app named "core", I have a file called apps.py where I register my signals.
> I just followed a tutorial as well so I can't yet explain what it does but 
> if I had to guess is just to register the app with my signals.
>
> Just when reading your question it reminded me of this:
> [image: appconfig.png]
>
> If this is wrong info I'll delete this but maybe this helps :)
>
> Regards
>
> On Wednesday, 29 December 2021 at 21:22:46 UTC+1 lone...@gmail.com wrote:
>
>> Hello all,
>>
>>   I decided to try and accept payments on my web application.  I have 
>> chosen the django-paypal application to help me out with this task.  I 
>> found a decent walkthrough at: 
>> how-to-accept-paypal-payments-on-your-django-application 
>> .
>>   
>> I was able to follow everything until the last step of: "6. Setup a 
>> listener to detect successful Paypal payments"  I have never really setup 
>> any listeners before so I did not know what to do.  I decided to read the 
>> Django-PayPal 
>> ReadTheDocs 
>>  and I 
>> found a file that looked structurally similar to what I found on the 
>> original walkthrough I had found.  It looks like I needed to make a 
>> hooks.py file in my project directory.  I have accomplished that, and the 
>> ReadTheDocs says: "Remember to ensure that import the hooks file is 
>> imported i.e. that you are connecting the signals when your project 
>> initializes. The standard way to do this is to create an AppConfig class 
>> 
>>  and 
>> add a ready() 
>> 
>>  method, 
>> in which you can register your signal handlers or import a module that does 
>> this."  This is where I am getting lost.  I am not quite sure what to 
>> do.  Does anyone have a better walkthrough or know what I need to do?
>>
>> Thank you.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db143e07-597c-489a-ace7-9bb5847ef69an%40googlegroups.com.


Re: Not sure if I am doing django-paypal correctly

2021-12-29 Thread Yorben Verhoest
Hello

I'm a Django Noobie and maybe I'm completely wrong about this but in my app 
named "core", I have a file called apps.py where I register my signals.
I just followed a tutorial as well so I can't yet explain what it does but 
if I had to guess is just to register the app with my signals.

Just when reading your question it reminded me of this:
[image: appconfig.png]

If this is wrong info I'll delete this but maybe this helps :)

Regards

On Wednesday, 29 December 2021 at 21:22:46 UTC+1 lone...@gmail.com wrote:

> Hello all,
>
>   I decided to try and accept payments on my web application.  I have 
> chosen the django-paypal application to help me out with this task.  I 
> found a decent walkthrough at: 
> how-to-accept-paypal-payments-on-your-django-application 
> .
>   
> I was able to follow everything until the last step of: "6. Setup a 
> listener to detect successful Paypal payments"  I have never really setup 
> any listeners before so I did not know what to do.  I decided to read the 
> Django-PayPal 
> ReadTheDocs 
>  and I 
> found a file that looked structurally similar to what I found on the 
> original walkthrough I had found.  It looks like I needed to make a 
> hooks.py file in my project directory.  I have accomplished that, and the 
> ReadTheDocs says: "Remember to ensure that import the hooks file is 
> imported i.e. that you are connecting the signals when your project 
> initializes. The standard way to do this is to create an AppConfig class 
> 
>  and 
> add a ready() 
> 
>  method, 
> in which you can register your signal handlers or import a module that does 
> this."  This is where I am getting lost.  I am not quite sure what to 
> do.  Does anyone have a better walkthrough or know what I need to do?
>
> Thank you.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e0fc31ee-dc9d-432b-88cb-ec1ff2dd636fn%40googlegroups.com.