Re: database update after paypal payment

2018-04-25 Thread mab . mobile . 01
Hello Michael, 

I am having the same problem. I have no problems submitting the data from 
my website to paypal. I am using Django 2.0.x and just need the django 
IPN-listener code in an easy to understand way. I want to receive data back 
from paypal IPN and be able to store it in my database ie customer name, 
product_id, transaction_date etc. 

I have read http://django-paypal.readthedocs.io but it is difficult to 
follow and incomplete when it comes to returning the IPN completion. 

Thanks

Marc

On Wednesday, March 22, 2017 at 9:32:51 PM UTC-5, Michael Goytia wrote:
>
> Hello, 
>
> If you still need help please email me and I can assist you. also look at 
> this page 
> 
>
> Michael Goytia
>
> On Wednesday, March 1, 2017 at 7:11:08 PM UTC-7, Agoulou Zegouna wrote:
>>
>> Thanks all ! I tried to Use django-paypal. can you please give me a 
>> concrete example after from step 5 to 6? I have no idea of what to do?
>> https://django-paypal.readthedocs.io/en/stable/standard/ipn.html
>>
>>
>> On Wed, Mar 1, 2017 at 1:46 PM, Mario Gudelj  wrote:
>>
>>> You should use Django-PayPal app. It has views for IPN and PDT, stores 
>>> transaction details in DB, does TX verification and it fires of a signal 
>>> when when a successful transaction comes in to your webhook. 
>>>
>>> All you have to do is specify some URLs and settings. It'll even render 
>>> that front end form for you using a Django form. It really is a bomb. 
>>>
>>> Cheers,
>>>
>>> M
>>>
>>>
>>>
>>> On Wed, 1 Mar 2017 at 11:10 pm, Melvyn Sopacua  
>>> wrote:
>>>
 On Tuesday 28 February 2017 21:13:39 agoulou...@gmail.com wrote:

 > hello! I am trying to update my database after paypal has received 

 > the payment from customer. The problem is that I don't really know to

 > do it. This is what I am doing now

  

 This code is all irrelevant. This is the important URL:

 > >>>
 > name="return" type="hidden" value="http://www.example.com/thank-you";>

  

 Wouldn't name it "thank-you" either. That would be the final page, but 
 the flow is:

  

 - Submit to PayPal

 - At above return_url, receive data from PayPal:

 - Check for success / failure

 - If success:

 set paid to True, redirect to /thank-you

 - else:

 display error and cart

  

 -- 

 Melvyn Sopacua

 -- 
 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 post to this group, send email to django...@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/3452662.H3dCPjKHmD%40devstation
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/django-users/ZUBd-vcyjrs/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAHqTbjmeT%3D8U0wPqLTPBcb6FxSPnECiaFR0Y99-%2B0ooZhKQK6Q%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54beedf2-3d07-4c5f-8fd6-af1a7cc6a23f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: database update after paypal payment

2017-03-22 Thread Michael Goytia
Hello, 

If you still need help please email me and I can assist you. also look at 
this page 


Michael Goytia

On Wednesday, March 1, 2017 at 7:11:08 PM UTC-7, Agoulou Zegouna wrote:
>
> Thanks all ! I tried to Use django-paypal. can you please give me a 
> concrete example after from step 5 to 6? I have no idea of what to do?
> https://django-paypal.readthedocs.io/en/stable/standard/ipn.html
>
>
> On Wed, Mar 1, 2017 at 1:46 PM, Mario Gudelj  > wrote:
>
>> You should use Django-PayPal app. It has views for IPN and PDT, stores 
>> transaction details in DB, does TX verification and it fires of a signal 
>> when when a successful transaction comes in to your webhook. 
>>
>> All you have to do is specify some URLs and settings. It'll even render 
>> that front end form for you using a Django form. It really is a bomb. 
>>
>> Cheers,
>>
>> M
>>
>>
>>
>> On Wed, 1 Mar 2017 at 11:10 pm, Melvyn Sopacua > > wrote:
>>
>>> On Tuesday 28 February 2017 21:13:39 agoulou...@gmail.com  
>>> wrote:
>>>
>>> > hello! I am trying to update my database after paypal has received 
>>>
>>> > the payment from customer. The problem is that I don't really know to
>>>
>>> > do it. This is what I am doing now
>>>
>>>  
>>>
>>> This code is all irrelevant. This is the important URL:
>>>
>>> > >>
>>> > name="return" type="hidden" value="http://www.example.com/thank-you";>
>>>
>>>  
>>>
>>> Wouldn't name it "thank-you" either. That would be the final page, but 
>>> the flow is:
>>>
>>>  
>>>
>>> - Submit to PayPal
>>>
>>> - At above return_url, receive data from PayPal:
>>>
>>> - Check for success / failure
>>>
>>> - If success:
>>>
>>> set paid to True, redirect to /thank-you
>>>
>>> - else:
>>>
>>> display error and cart
>>>
>>>  
>>>
>>> -- 
>>>
>>> Melvyn Sopacua
>>>
>>> -- 
>>> 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 post to this group, send email to django...@googlegroups.com 
>>> .
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/3452662.H3dCPjKHmD%40devstation
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/ZUBd-vcyjrs/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAHqTbjmeT%3D8U0wPqLTPBcb6FxSPnECiaFR0Y99-%2B0ooZhKQK6Q%40mail.gmail.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ee529326-3a6a-4cb4-bdb6-b294204a978a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: database update after paypal payment

2017-03-01 Thread Agoulou Zegouna
Thanks all ! I tried to Use django-paypal. can you please give me a
concrete example after from step 5 to 6? I have no idea of what to do?
https://django-paypal.readthedocs.io/en/stable/standard/ipn.html


On Wed, Mar 1, 2017 at 1:46 PM, Mario Gudelj  wrote:

> You should use Django-PayPal app. It has views for IPN and PDT, stores
> transaction details in DB, does TX verification and it fires of a signal
> when when a successful transaction comes in to your webhook.
>
> All you have to do is specify some URLs and settings. It'll even render
> that front end form for you using a Django form. It really is a bomb.
>
> Cheers,
>
> M
>
>
>
> On Wed, 1 Mar 2017 at 11:10 pm, Melvyn Sopacua 
> wrote:
>
>> On Tuesday 28 February 2017 21:13:39 agoulouzego...@gmail.com wrote:
>>
>> > hello! I am trying to update my database after paypal has received
>>
>> > the payment from customer. The problem is that I don't really know to
>>
>> > do it. This is what I am doing now
>>
>>
>>
>> This code is all irrelevant. This is the important URL:
>>
>> > >
>> > name="return" type="hidden" value="http://www.example.com/thank-you";>
>>
>>
>>
>> Wouldn't name it "thank-you" either. That would be the final page, but
>> the flow is:
>>
>>
>>
>> - Submit to PayPal
>>
>> - At above return_url, receive data from PayPal:
>>
>> - Check for success / failure
>>
>> - If success:
>>
>> set paid to True, redirect to /thank-you
>>
>> - else:
>>
>> display error and cart
>>
>>
>>
>> --
>>
>> Melvyn Sopacua
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/3452662.H3dCPjKHmD%40devstation
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/ZUBd-vcyjrs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAHqTbjmeT%3D8U0wPqLTPBcb6FxSPnECiaFR0Y99
> -%2B0ooZhKQK6Q%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ-4E-OqY5PE65XDoGyM%3DvB%3DN2iGE2MGTPqFdD_8BGQOxGFpMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: database update after paypal payment

2017-03-01 Thread Mario Gudelj
You should use Django-PayPal app. It has views for IPN and PDT, stores
transaction details in DB, does TX verification and it fires of a signal
when when a successful transaction comes in to your webhook.

All you have to do is specify some URLs and settings. It'll even render
that front end form for you using a Django form. It really is a bomb.

Cheers,

M



On Wed, 1 Mar 2017 at 11:10 pm, Melvyn Sopacua 
wrote:

> On Tuesday 28 February 2017 21:13:39 agoulouzego...@gmail.com wrote:
>
> > hello! I am trying to update my database after paypal has received
>
> > the payment from customer. The problem is that I don't really know to
>
> > do it. This is what I am doing now
>
>
>
> This code is all irrelevant. This is the important URL:
>
> > 
> > name="return" type="hidden" value="http://www.example.com/thank-you";>
>
>
>
> Wouldn't name it "thank-you" either. That would be the final page, but the
> flow is:
>
>
>
> - Submit to PayPal
>
> - At above return_url, receive data from PayPal:
>
> - Check for success / failure
>
> - If success:
>
> set paid to True, redirect to /thank-you
>
> - else:
>
> display error and cart
>
>
>
> --
>
> Melvyn Sopacua
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3452662.H3dCPjKHmD%40devstation
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHqTbjmeT%3D8U0wPqLTPBcb6FxSPnECiaFR0Y99-%2B0ooZhKQK6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: database update after paypal payment

2017-03-01 Thread Melvyn Sopacua
On Tuesday 28 February 2017 21:13:39 agoulouzego...@gmail.com wrote:
> hello! I am trying to update my database after paypal has received 
> the payment from customer. The problem is that I don't really know to
> do it. This is what I am doing now

This code is all irrelevant. This is the important URL:
>  name="return" type="hidden" value="http://www.example.com/thank-you";>

Wouldn't name it "thank-you" either. That would be the final page, but the flow 
is:

- Submit to PayPal
- At above return_url, receive data from PayPal:
- Check for success / failure
- If success:
set paid to True, redirect to /thank-you
- else:
display error and cart

-- 
Melvyn Sopacua

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3452662.H3dCPjKHmD%40devstation.
For more options, visit https://groups.google.com/d/optout.


database update after paypal payment

2017-02-28 Thread agoulouzegouna
hello! I am trying to update my database after paypal has received  the 
payment from customer. The problem is that I don't really know to do it. 
This is what I am doing now

here is my model

*class SubmitDoc(models.Model):*
*Student = 'stu'*
*Professional = 'Pro'*

*Status_CHOICES = (*
*(Student, 'Stu'),*
*(Professional, 'Pro'),*
   
*)*

*firstName = models.CharField(max_length =100)*
*lastName = models.CharField(max_length =100)*
*email = models.EmailField()*
*Stud_status = models.CharField(*
*max_length=3,*
*choices=Status_CHOICES,*
*default=Student,*
*)*
*uploadDoc = models.FileField(upload_to='documents/%Y/%m/%d/')   *
*comment = models.TextField()*
*created_on = models.DateTimeField(auto_now_add=True, editable=False)*
*paid = models.BooleanField(default=False)*
*finished_read = models.BooleanField(default=False)*
*read_by = models.CharField(max_length = 100, default="none")*

This is my view function to handle the forms that are submitted

def newSubmit(request):
save= False
form = SubmitDocForm(request.POST, request.FILES)
com =0
compteur=0
message ="bon"
solution = ""
counted=0
stud = False
amount_stu = 0.02
amount_pro = 0.03

   
if form.is_valid():
submitDoc = SubmitDoc()
submitDoc.firstName = form.cleaned_data['firstName'] 
submitDoc.lastName = form.cleaned_data['lastName']
submitDoc.email = form.cleaned_data['email']
submitDoc.Stud_status = form.cleaned_data['Stud_status']
submitDoc.uploadDoc = form.cleaned_data['uploadDoc'] 
# submitDoc.like = form.cleaned_data["like"]  
submitDoc.comment = form.cleaned_data['comment']
submitDoc.save()
save = True
# data = request.FILES["uploadDoc"]
pathy = submitDoc.uploadDoc.path
solution= get_docx_text(pathy)
counted = len(solution.split())
type_of_doc =  form.cleaned_data['Stud_status']

if  form.cleaned_data['Stud_status'] == "on":
stud = True
totals = round(counted*0.02, 2)
else:
stud = False
totals = round(counted *0.03, 2)

else:
form = SubmitDocForm()
 
return render(request, 'francais/saved.html', locals())

My problem is that I would like to update the database, the "*   paid = 
models.BooleanField(default=False)" ** field to true after the payment is 
received from paypal.*

*Here is how I redirect the user to paypal for payment:*

*https://www.paypal.com/cgi-bin/webscr"; method="post">   http://www.example.com/order/21/";> http://www.example.com/thank-you";> 
 *

 

*Please help me to change the paid field to "True".*

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/211bcb0e-23aa-470f-9874-7d9c281398ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.