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

PayPal Buisness #16

Open
wants to merge 83 commits into
base: vpos_urls
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
782cf09
Fixing get_type_help bug
Mar 13, 2017
01b54c3
Release 1.4
Mar 14, 2017
17da909
Add enviroment to VPOSPaymentOperation
Mar 14, 2017
fa3c3fd
Release 1.5
Mar 14, 2017
bc7d697
Environment must be assigned in the VPOSPaymentOperation
Mar 14, 2017
5f44a2a
New version (1.6) that fixes the problems with VPOSPaymentOperation
Mar 14, 2017
2853292
Allow reverse relation VPOSPaymentOperation -> VirtualPointOfSale
Mar 17, 2017
0e9a6d3
Fixing bug of calling a non-existant class
Mar 20, 2017
d1f114e
New version in setup.py (1.6.2)
Mar 20, 2017
cfa3048
New version in setup.py (1.6.3)
Mar 20, 2017
7988f80
Forgotten add migrations
Mar 29, 2017
af50e68
1.6.4 release
Mar 29, 2017
1913870
Add method to allow partial refund and full refund, specific to Redsy…
Apr 4, 2017
4e0561d
Improving documentation
Apr 4, 2017
4602151
Register VPOSRefundOperation in admin zone
Apr 4, 2017
a608364
Description param in refund example view
Apr 4, 2017
2093a9d
Add more comments about refund method
Apr 4, 2017
6da30ed
Add more comments about refund method
Apr 4, 2017
9474911
Add more comments about refund method
Apr 4, 2017
2781fbc
Add more comments about refund method
Apr 4, 2017
8ee500f
Forgotten add migrations
Apr 4, 2017
0ca622c
Merge pull request #2 from josemlp91/master
diegojromerolopez Apr 17, 2017
f767c25
Move set_payment_attributes.js
diegojromerolopez May 9, 2017
1d7bf58
Merge branch 'master' of https://github.com/intelligenia/django-virtu…
diegojromerolopez May 9, 2017
2c07809
Set payment attributes JS
diegojromerolopez May 10, 2017
4eeebe2
Confirm payment URL and view
diegojromerolopez May 10, 2017
a55fc14
Generic views
diegojromerolopez May 10, 2017
fe34ee9
Move set_payment_attributes to its correct path
May 11, 2017
a082ffa
Set payment attributes templatetag
May 11, 2017
02d644d
Set payment attributes templatetag
May 11, 2017
71a5c26
Set payment attributes templatetag
May 11, 2017
b2185e3
Fixing bad exception in view
May 11, 2017
48ad9fd
Preparing for new pypi version
May 11, 2017
758d7d7
Fixing regression
May 17, 2017
49237fb
Payment by reference
May 23, 2017
cbccab8
Payment by reference
May 23, 2017
e8e200e
REDSYS integration with SOAP confirmation method with reference number
May 25, 2017
bfca6d6
Add DS_ERROR_CODE logging, default message for unknown Ds_Response, a…
mbarchein Feb 9, 2018
cff4933
Bitpay payment integration, main connection logic
Feb 9, 2018
4fd8b79
Update changelog with new release
Feb 9, 2018
31231af
Add Bitpay config model to Django Admin panel
Feb 9, 2018
c6d41cf
Erase version field in VPOBitpay
Feb 9, 2018
26d547e
minor change
Feb 9, 2018
f66d2f3
Merge pull request #6 from josemlp91/master
mbarchein Feb 9, 2018
4e27fc6
add rst readme file
Feb 12, 2018
57a8ea5
Merge pull request #7 from josemlp91/master
mbarchein Feb 12, 2018
4999196
add bitpay documentation
Feb 12, 2018
c91901e
add bitpay documentation
Feb 12, 2018
8f4d9f7
add bitpay documentation
Feb 12, 2018
5593469
add bitpay documentation
Feb 12, 2018
d888a0a
minors changes
Feb 12, 2018
494fa0b
Merge pull request #9 from josemlp91/master
mbarchein Feb 12, 2018
a0e07bb
Paid mark operation as confirmed
Feb 19, 2018
9650665
Merge pull request #10 from josemlp91/master
mbarchein Feb 19, 2018
80d3cef
redsys preauth policy
Apr 3, 2018
67383b8
change package version
Apr 3, 2018
20feda4
improve bitpay error manage
Apr 3, 2018
6aa2257
refactor preauth selector from checkbox to choice
Apr 3, 2018
5d0c2e7
change response redsys charge
Apr 3, 2018
9a7d1da
format readme file
Apr 3, 2018
8fffd87
format readme file
Apr 3, 2018
74e0e09
add exception VPOSOperationAlreadyConfirmed Bitpay
Apr 4, 2018
78a7527
Merge pull request #11 from josemlp91/master
mbarchein Apr 6, 2018
9841cf2
fix README text format
Apr 6, 2018
d3e9dc2
new setup.py based on https://github.com/kennethreitz/setup.py
mbarchein Apr 6, 2018
be03711
Merge pull request #12 from josemlp91/master
mbarchein Apr 6, 2018
20f0fb9
debug messages
Apr 9, 2018
89d2c75
Merge pull request #13 from josemlp91/master
mbarchein Apr 9, 2018
f648fa8
gitignore
mbarchein Apr 9, 2018
d7d8c5c
Update models.py
Apr 9, 2018
bb4d888
Update __version__.py
Apr 9, 2018
e9c9ef6
Merge pull request #14 from josemlp91/master
mbarchein Apr 9, 2018
b1a7f46
Update models.py
Apr 10, 2018
9451906
Update __version__.py
Apr 10, 2018
f542a91
Update models.py
Apr 10, 2018
edf951a
Merge pull request #15 from josemlp91/master
mbarchein Apr 10, 2018
431acd1
Managing refund async confirmations for Redsys
mbarchein Oct 2, 2018
1391a6e
Fix refund operations where there are more than one VPOSPaymentOperat…
mbarchein Mar 18, 2020
a55e1df
fix Redsys message parsing for signature calculation in SOAP mode
mbarchein Apr 20, 2020
57066ee
version bump
mbarchein Apr 20, 2020
9ec899a
Pago por referencia (#18)
kezoyu Jul 23, 2024
240bc2e
bump version and enable extra debug in _confirm_preauthorization
mbarchein Jul 23, 2024
583abd4
fixing RedSys preauth response. Version 1.7.1
mbarchein Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,7 @@ ENV/
.DS_Store

# Backup files
*~
*~

MANIFEST
.pypirc
66 changes: 60 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,58 @@
# django-virtual-pos
Django module that abstracts the flow of several virtual points of sale including PayPal.
Django module that abstracts the flow of several virtual points of sale.

# Releases
## 1.6.11
- On refund operations, select the 'completed' VPOSPaymentOperation matching the sale_code if there are more than one

## 1.6.10
- Managing refund async confirmations for Redsys

## 1.6.8
- Integration with [BitPay](https://bitpay.com/)

## 1.6.7
- Add DS_ERROR_CODE logging default message for unknown Ds_Response, allow SOAP responses with empty Ds_AuthorisationCode

## 1.6.6
- Simplify integration.
- Add example integration.

## 1.6.5
- Add method to allow partial refund and full refund, specific to Redsys TPV Platform.
- New model to register refund operations.
- Add refund view example.


## 1.6.4
- Include migrations.


## 1.6.4
- Include migrations.


## 1.6.1
- Allow reverse relation VPOSPaymentOperation -> VirtualPointOfSale


## 1.5
- Adding environment to VPOSPaymentOperation
- Changing labels in models


## 1.3
- Fixing get_type_help_bug


## 1.2
- Add new permission view_virtualpointofsale to ease management.
- Add method specificit_vpos in VirtualPointOfSale that returns the specific model object according to the VPOS type.


## 1.1
Minor changes in README.md.


## 1.0 Features
- Integration with PayPal Checkout.
Expand All @@ -10,9 +61,12 @@ Django module that abstracts the flow of several virtual points of sale includin
- [Santander Elavon](https://www.santanderelavon.com/)
- [CECA](http://www.cajasdeahorros.es/).

## 1.1
Minor changes in README.md.

## 1.2
- Add new permission view_virtualpointofsale to ease management.
- Add method specificit_vpos in VirtualPointOfSale that returns the specific model object according to the VPOS type.








2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-exclude venv *
recursive-exclude dist *
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ This module abstracts the use of the most used virtual points of sale in Spain.

# Implemented payment methods

## PayPal
### Paypal
[Paypal](https://www.paypal.com/) paypal payment available.

Easy integration with PayPal.
### Bitpay
[Bitpay](http://bitpay.com) bitcoin payments, from wallet to checkout

## Spanish Virtual Points of Sale


### Ceca
[CECA](http://www.cajasdeahorros.es/) is the Spanish confederation of savings banks.

Expand All @@ -38,6 +41,7 @@ Easy integration with PayPal.
- [lxml](https://pypi.python.org/pypi/lxml)
- [pycrypto](https://pypi.python.org/pypi/pycrypto)
- [Pytz](https://pypi.python.org/pypi/pytz)
- [Requests](https://pypi.python.org/pypi/requests)


Type:
Expand Down Expand Up @@ -85,12 +89,15 @@ You will need to implement this skeleton view using your own **Payment** model.
This model has must have at least the following attributes:
- **code**: sale code given by our system.
- **operation_number**: bank operation number.
- **status**: status of the payment: "paid", "pending" or "canceled".
- **status**: status of the payment: "paid", "pending" (**pending** is mandatory) or "canceled".
- **amount**: amount to be charged.

And the following methods:
- **online_confirm**: mark the payment as paid.

## Integration examples
- [djshop](https://github.com/diegojromerolopez/djshop)


## Needed views
### Sale summary view
Expand Down Expand Up @@ -123,6 +130,9 @@ def payment_confirmation(request, virtualpos_type):
"""
This view will be called by the bank.
"""
# Directly call to confirm_payment view

# Or implement the following actions

# Checking if the Point of Sale exists
virtual_pos = VirtualPointOfSale.receiveConfirmation(request, virtualpos_type=virtualpos_type)
Expand Down Expand Up @@ -200,6 +210,40 @@ def payment_cancel(request, sale_code):
return render(request, '<payment_canceled template>', {'context': context, 'payment': payment})
````

### Refund view

````python
def refund(request, tpv, payment_code, amount, description):
"""
:param request:
:param tpv: TPV Id
:param payment_code: Payment code
:param amount: Refund Amount (Example 10.89).
:param description: Description of refund cause.
:return:
"""

amount = Decimal(amount)

try:
# Checking if the Point of Sale exists
tpv = VirtualPointOfSale.get(id=tpv)
# Checking if the Payment exists
payment = Payment.objects.get(code=payment_code, state="paid")

except Payment.DoesNotExist as e:
return http_bad_request_response_json_error(message=u"Does not exist payment with code {0}".format(payment_code))

refund_status = tpv.refund(payment_code, amount, description)

if refund_status:
message = u"Refund successful"
else:
message = u"Refund with erros"

return http_response_json_ok(message)
````


# Authors
- Mario Barchéin [email protected]
Expand Down
Loading