Skip to content

Commit 9f9afe3

Browse files
author
daniel burg
committed
v 0.1.1
1 parent 1d40132 commit 9f9afe3

File tree

9 files changed

+42
-4
lines changed

9 files changed

+42
-4
lines changed
-7.12 KB
Binary file not shown.
8.07 KB
Binary file not shown.

django_girosolution.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.1
22
Name: django-girosolution
3-
Version: 0.1.0
3+
Version: 0.1.1
44
Summary: Django integration of girosolution
55
Home-page: https://github.com/ParticulateSolutions/django-girosolution
66
Author: Particulate Solutions GmbH

django_girosolution.egg-info/SOURCES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ django_girosolution.egg-info/SOURCES.txt
1616
django_girosolution.egg-info/dependency_links.txt
1717
django_girosolution.egg-info/not-zip-safe
1818
django_girosolution.egg-info/requires.txt
19-
django_girosolution.egg-info/top_level.txt
19+
django_girosolution.egg-info/top_level.txt
20+
django_girosolution/migrations/0001_initial.py
21+
django_girosolution/migrations/__init__.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
django_girosolution
2+
django_girosolution/migrations

django_girosolution/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.0'
1+
__version__ = '0.1.1'

django_girosolution/migrations/__init__.py

Whitespace-only changes.

django_girosolution/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class GIROSOLUTION_PAYMENT_METHODS:
1010
"""
1111
CC = 'CREDIT_CARD'
1212
PD = 'PAYDIREKT'
13+
GP = 'GIROPAY'
1314

1415

1516
GIROSOLUTION_VALID_TRANSACTION_STATUSES = [4000]

django_girosolution/wrappers.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def start_transaction(self, merchant_tx_id, amount, purpose,
8484
redirect_url=GIROSOLUTION_RETURN_URL,
8585
notify_url=GIROSOLUTION_NOTIFICATION_URL,
8686
success_url=GIROSOLUTION_SUCCESS_URL,
87-
error_url=GIROSOLUTION_ERROR_URL):
87+
error_url=GIROSOLUTION_ERROR_URL,
88+
shipping_address=None):
8889
"""
8990
girosolution transaction
9091
:param merchant_tx_id:
@@ -116,6 +117,36 @@ def start_transaction(self, merchant_tx_id, amount, purpose,
116117
#
117118
# todo: add datamapping for other paymentmethods
118119

120+
elif self.payment_type is GIROSOLUTION_PAYMENT_METHODS.GP:
121+
# go with giropay
122+
data = OrderedDict()
123+
data['merchantId'] = self.payment.get('MERCHANT_ID')
124+
data['projectId'] = self.payment.get('PROJECT_ID')
125+
data['merchantTxId'] = merchant_tx_id
126+
data['amount'] = amount
127+
data['currency'] = currency
128+
data['purpose'] = purpose
129+
data['urlRedirect'] = redirect_url
130+
data['urlNotify'] = notify_url
131+
132+
elif self.payment_type is GIROSOLUTION_PAYMENT_METHODS.PD:
133+
# go with paydirekt
134+
data = OrderedDict()
135+
data['merchantId'] = self.payment.get('MERCHANT_ID')
136+
data['projectId'] = self.payment.get('PROJECT_ID')
137+
data['merchantTxId'] = merchant_tx_id
138+
data['amount'] = amount
139+
data['currency'] = currency
140+
data['purpose'] = purpose
141+
data['shippingAddresseFirstName'] = shipping_address['shippingAddresseFirstName']
142+
data['shippingAddresseLastName'] = shipping_address['shippingAddresseLastName']
143+
data['shippingZipCode'] = shipping_address['shippingZipCode']
144+
data['shippingCity'] = shipping_address['shippingCity']
145+
data['shippingCountry'] = 'DE'
146+
data['orderId'] = merchant_tx_id
147+
data['urlRedirect'] = redirect_url
148+
data['urlNotify'] = notify_url
149+
119150
else:
120151
logger.error(_("unknown payment method"))
121152

@@ -173,6 +204,9 @@ def call_api(self, url=None, data=None):
173204
generated_hash = self._generate_hash_from_dict(data)
174205
data.update({'hash': generated_hash})
175206

207+
from pprint import pprint
208+
pprint(data)
209+
176210
try:
177211
response = requests.post(url, data=data)
178212
except requests.HTTPError as e:

0 commit comments

Comments
 (0)