mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-25 08:23:46 +00:00
Merge branch 'compay_fix' into 'dev'
Fix comnpay url See merge request federez/re2o!251
This commit is contained in:
commit
65fed7455c
3 changed files with 48 additions and 1 deletions
20
cotisations/migrations/0031_comnpaypayment_production.py
Normal file
20
cotisations/migrations/0031_comnpaypayment_production.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.10.7 on 2018-08-11 23:03
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cotisations', '0030_custom_payment'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='comnpaypayment',
|
||||||
|
name='production',
|
||||||
|
field=models.BooleanField(default=True, verbose_name='Production mode enabled (production url, instead of homologation)'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -65,6 +65,16 @@ class ComnpayPayment(PaymentMethodMixin, models.Model):
|
||||||
decimal_places=2,
|
decimal_places=2,
|
||||||
default=1,
|
default=1,
|
||||||
)
|
)
|
||||||
|
production = models.BooleanField(
|
||||||
|
default=True,
|
||||||
|
verbose_name=_l("Production mode enabled (production url, instead of homologation)"),
|
||||||
|
)
|
||||||
|
|
||||||
|
def return_url_comnpay(self):
|
||||||
|
if self.production:
|
||||||
|
return 'https://secure.comnpay.com'
|
||||||
|
else:
|
||||||
|
return 'https://secure.homologation.comnpay.com'
|
||||||
|
|
||||||
def end_payment(self, invoice, request):
|
def end_payment(self, invoice, request):
|
||||||
"""
|
"""
|
||||||
|
@ -87,8 +97,9 @@ class ComnpayPayment(PaymentMethodMixin, models.Model):
|
||||||
"",
|
"",
|
||||||
"D"
|
"D"
|
||||||
)
|
)
|
||||||
|
|
||||||
r = {
|
r = {
|
||||||
'action': 'https://secure.homologation.comnpay.com',
|
'action': self.return_url_comnpay(),
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
'content': p.buildSecretHTML(
|
'content': p.buildSecretHTML(
|
||||||
_("Pay invoice no : ")+str(invoice.id),
|
_("Pay invoice no : ")+str(invoice.id),
|
||||||
|
|
16
users/migrations/0075_merge_20180815_2202.py
Normal file
16
users/migrations/0075_merge_20180815_2202.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.10.7 on 2018-08-15 20:02
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('users', '0074_auto_20180814_1059'),
|
||||||
|
('users', '0074_auto_20180810_2104'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
]
|
Loading…
Reference in a new issue