Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 9 commits
  • 13 files changed
  • 4 comments
  • 1 contributor
3  .travis.yml
... ...
@@ -1,8 +1,9 @@
1 1
 language: python
2 2
 python:
  3
+  - "2.6"
3 4
   - "2.7"
4 5
 install:
5 6
   - python setup.py develop
6 7
   - pip install -r requirements.txt
7 8
 script:
8  
-  - ./run_tests.py
  9
+  - ./runtests.py
3  MANIFEST.in
... ...
@@ -1,2 +1,3 @@
1 1
 include *.rst
2  
-recursive-include paypal/express/templates/paypal *.txt *.html
  2
+include LICENSE
  3
+recursive-include paypal/templates/ *.html
12  README.rst
Source Rendered
@@ -10,7 +10,8 @@ Express`_ and `PayPal Payflow Pro`_.
10 10
 .. _`PayPal Express`: https://www.paypal.com/uk/cgi-bin/webscr?cmd=_additional-payment-ref-impl1
11 11
 .. _`PayPal Payflow Pro`: https://merchant.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=merchant/payment_gateway
12 12
 
13  
-The package is structured so that it can be used without Oscar if you so wish.
  13
+These payment options can be used individually or both together.  Further, the
  14
+package is structured so that it can be used without Oscar if you so wish.
14 15
 
15 16
 * `Full documentation`_
16 17
 * `Continuous integration status`_
@@ -21,7 +22,8 @@ The package is structured so that it can be used without Oscar if you so wish.
21 22
 Having problems or got a question?
22 23
 
23 24
 * Have a look at the sandbox installation as this is a sample Oscar project
24  
-  integrated with both PayPal options.
  25
+  integrated with both PayPal options.  See the contributing guide within the
  26
+  docs for instructions on how to set up the sandbox locally.
25 27
 * Ping `@django_oscar`_ with quick queries.
26 28
 * Ask more detailed questions on the Oscar mailing list: django-oscar@googlegroups.com.
27 29
 * Use Github for submitting issues and pull requests.
@@ -33,6 +35,12 @@ The package is released under the new BSD license.
33 35
 Changelog
34 36
 ---------
35 37
 
  38
+0.2.1
  39
+~~~~~
  40
+* Fix packaging issues
  41
+* Remove dead templates
  42
+* With API docs
  43
+
36 44
 0.2
37 45
 ~~~
38 46
 Includes support for Payflow Pro.
1  docs/conf.py
@@ -18,6 +18,7 @@
18 18
 # documentation root, use os.path.abspath to make it absolute, like shown here.
19 19
 PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '..')
20 20
 sys.path.insert(0, PROJECT_ROOT)
  21
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sandbox.settings')
21 22
 
22 23
 # -- General configuration -----------------------------------------------------
23 24
 
12  docs/index.rst
Source Rendered
@@ -9,10 +9,14 @@ Welcome to django-oscar-paypal's documentation!
9 9
 This package provides integration between django-oscar and two of PayPal's
10 10
 payment options:
11 11
 
12  
-* PayPal Express -
13  
-
14  
-* PayPal PayFlow Pro - Allows you to accept customer payments on your site
15  
-  without requiring a redirect to PayPal.  
  12
+* *PayPal Express* - Involves redirecting customer's over to PayPal's site where
  13
+  they can choose shipping options and confirm payment using their PayPal
  14
+  account.  The customer is then redirected back to the merchant site where they
  15
+  confirm the order.
  16
+
  17
+* *PayPal PayFlow Pro* - Allows you to accept customer payments on your site
  18
+  without requiring a redirect to PayPal.  This allows the customer to pay with
  19
+  a normal bankcard rather than their PayPal account.
16 20
 
17 21
 It's possible to use both of these options individually or at the same time.
18 22
 Further, it's possible to use either without Oscar.
29  docs/payflow.rst
Source Rendered
@@ -109,3 +109,32 @@ Not included
109 109
 * SWIPE transactions (eg card present)
110 110
 * Non-referenced credits (eg refunding to an arbitrary bankcard).  All refunds
111 111
   must correspond to a previously settled transaction.
  112
+
  113
+-------------------
  114
+Using without Oscar
  115
+-------------------
  116
+
  117
+To use Payflow Pro without an Oscar install, you need to use the
  118
+``paypal.payflow.gateway`` module directly.  This module is agnostic of Oscar
  119
+and can be used independently.  
  120
+
  121
+The ``paypal.payflow.facade`` module is a bridging module that provides a
  122
+simpler API designed to link Oscar to the gateway module.
  123
+
  124
+---
  125
+API
  126
+---
  127
+
  128
+Facade
  129
+------
  130
+
  131
+.. automodule:: paypal.payflow.facade
  132
+    :members:
  133
+
  134
+Gateway
  135
+-------
  136
+
  137
+.. automodule:: paypal.payflow.gateway
  138
+    :members:
  139
+
  140
+
2  paypal/__init__.py
... ...
@@ -1 +1 @@
1  
-VERSION = '0.2'
  1
+VERSION = '0.2.1'
2  paypal/express/views.py
@@ -91,7 +91,7 @@ def get_redirect_url(self, **kwargs):
91 91
 
92 92
 
93 93
 class SuccessResponseView(PaymentDetailsView):
94  
-    template_name_preview = 'paypal/preview.html'
  94
+    template_name_preview = 'paypal/express/preview.html'
95 95
     preview = True
96 96
 
97 97
     def get(self, request, *args, **kwargs):
58  paypal/payflow/facade.py
@@ -10,7 +10,13 @@
10 10
 
11 11
 def authorize(order_number, amt, bankcard, billing_address=None):
12 12
     """
13  
-    Make an authorisation request to PayPal.
  13
+    Make an *authorisation* request
  14
+
  15
+    This holds the money on the customer's bank account but does not mark the
  16
+    transaction for settlement.  This is the most common method to use for
  17
+    fulfilling goods that require shipping.  When the goods are ready to be
  18
+    shipped, the transaction can be marked for settlement by calling the
  19
+    delayed_capture method.
14 20
 
15 21
     If successful, return nothing ("silence is golden") - if unsuccessful raise
16 22
     an exception which can be caught and handled within view code.
@@ -18,9 +24,9 @@ def authorize(order_number, amt, bankcard, billing_address=None):
18 24
     :order_number: Order number for request
19 25
     :amt: Amount for transaction
20 26
     :bankcard: Instance of Oscar's Bankcard class (which is just a dumb wrapper
21  
-    around the pertinent bankcard attributes).
  27
+               around the pertinent bankcard attributes).
22 28
     :billing_address: A dict of billing address information (which can come from
23  
-    the `cleaned_data` of a billing address form.
  29
+                      the `cleaned_data` of a billing address form).
24 30
     """
25 31
     return _submit_payment_details(gateway.authorize, order_number, amt, bankcard,
26 32
                                    billing_address)
@@ -28,7 +34,11 @@ def authorize(order_number, amt, bankcard, billing_address=None):
28 34
 
29 35
 def sale(order_number, amt, bankcard, billing_address=None):
30 36
     """
31  
-    Make a sale request to PayPal.
  37
+    Make a *sale* request
  38
+
  39
+    This holds the money on the customer's bank account and marks the
  40
+    transaction for settlement that night.  This is appropriate method to use
  41
+    for products that can be immediately fulfilled - such as digital products.
32 42
 
33 43
     If successful, return nothing ("silence is golden") - if unsuccessful raise
34 44
     an exception which can be caught and handled within view code.
@@ -36,9 +46,9 @@ def sale(order_number, amt, bankcard, billing_address=None):
36 46
     :order_number: Order number for request
37 47
     :amt: Amount for transaction
38 48
     :bankcard: Instance of Oscar's Bankcard class (which is just a dumb wrapper
39  
-    around the pertinent bankcard attributes).
  49
+               around the pertinent bankcard attributes).
40 50
     :billing_address: A dict of billing address information (which can come from
41  
-    the `cleaned_data` of a billing address form.
  51
+                      the `cleaned_data` of a billing address form.
42 52
     """
43 53
     return _submit_payment_details(gateway.sale, order_number, amt, bankcard,
44 54
                                    billing_address)
@@ -77,17 +87,18 @@ def delayed_capture(order_number, pnref=None, amt=None):
77 87
     """
78 88
     Capture funds that have been previously authorized.
79 89
 
80  
-    Note:
  90
+    Notes:
  91
+
81 92
     * It's possible to capture a lower amount than the original auth
82  
-      transaction - however..
83  
-    * Only one delayed capture is allowed for a given PNREF.
84  
-    * If multiple captures are required, a 'reference transaction' needs to be
  93
+      transaction - however...
  94
+    * ...only one delayed capture is allowed for a given PNREF...
  95
+    * ...If multiple captures are required, a 'reference transaction' needs to be
85 96
       used.
86 97
     * It's safe to retry captures if the first one fails or errors
87 98
 
88 99
     :order_number: Order number
89 100
     :pnref: The PNREF of the authorization transaction to use.  If not
90  
-    specified, the order number is used to retrieve the appropriate transaction.
  101
+            specified, the order number is used to retrieve the appropriate transaction.
91 102
     :amt: A custom amount to capture.
92 103
     """
93 104
     if pnref is None:
@@ -110,6 +121,21 @@ def delayed_capture(order_number, pnref=None, amt=None):
110 121
 def referenced_sale(order_number, pnref, amt):
111 122
     """
112 123
     Capture funds using the bank/address details of a previous transaction
  124
+
  125
+    This is equivalent to a *sale* transaction but without the user having to
  126
+    enter their payment details.
  127
+
  128
+    There are two main uses for this:
  129
+
  130
+    1. This allows customers to checkout without having to re-enter their
  131
+       payment details.
  132
+
  133
+    2. It allows an initial authorisation to be settled in multiple parts.  The
  134
+       first settle should use delayed_capture but any subsequent ones should use this method.
  135
+
  136
+    :order_number: Order number.
  137
+    :pnref: PNREF of a previous transaction to use.
  138
+    :amt: The amount to settle for.
113 139
     """
114 140
     txn = gateway.reference_transaction(order_number,
115 141
                                         pnref,
@@ -121,7 +147,10 @@ def referenced_sale(order_number, pnref, amt):
121 147
 
122 148
 def void(order_number, pnref):
123 149
     """
124  
-    Void an auth transaction to prevent it from being settled
  150
+    Void an authorisation transaction to prevent it from being settled
  151
+
  152
+    :order_number: Order number
  153
+    :pnref: The PNREF of the transaction to void.
125 154
     """
126 155
     txn = gateway.void(order_number, pnref)
127 156
     if not txn.is_approved:
@@ -135,8 +164,9 @@ def credit(order_number, pnref=None, amt=None):
135 164
 
136 165
     :order_number: Order number
137 166
     :pnref: The PNREF of the authorization transaction to use.  If not
138  
-    specified, the order number is used to retrieve the appropriate transaction.
139  
-    :amt: A custom amount to capture.
  167
+            specified, the order number is used to retrieve the appropriate transaction.
  168
+    :amt: A custom amount to capture.  If not specified, the entire transaction
  169
+          is refuneded.
140 170
     """
141 171
     if pnref is None:
142 172
         # No PNREF specified, look-up the auth/sale transaction for this order number
39  paypal/templates/paypal/cancel.html
... ...
@@ -1,39 +0,0 @@
1  
-{% extends "checkout/checkout.html" %}
2  
-{% load currency_filters %}
3  
-
4  
-{% block title %}
5  
-Order preview | {{ block.super }}
6  
-{% endblock %}
7  
-
8  
-{% block checkout-nav %}
9  
-{% include 'checkout/nav.html' with step=4 %}
10  
-{% endblock %}
11  
-
12  
-{# Null out the actions as they can't be used here #}
13  
-{% block shipping_address_actions %}{% endblock %}
14  
-{% block order_contents_actions %}{% endblock %}
15  
-
16  
-{% block payment_method %}
17  
-<div class="span6">
18  
-	<div class="sub-header">
19  
-		<h2>Payment</h2>
20  
-	</div>
21  
-	<div class="well well-success">
22  
-		<p>PayPal Express Checkout</p>
23  
-		<p>PayPal user: {{ paypal_user_email }}</p>
24  
-		<p>Amount: {{ paypal_amount|currency }}</p>
25  
-	</div>
26  
-</div>
27  
-{% endblock %}
28  
-
29  
-{% block place_order %}
30  
-<h3>Please review the information above, then click "Place Order"</h3>
31  
-<form method="post" action="{% url paypal-place-order %}">
32  
-	{% csrf_token %}
33  
-	<input type="hidden" name="payer_id" value="{{ payer_id }}" />
34  
-	<input type="hidden" name="token" value="{{ token }}" />
35  
-    <div class="form-actions">
36  
-        <input id='place-order' type="submit" value="Place order" class="pull-right btn btn-primary btn-large js-disable-on-click" />
37  
-    </div>
38  
-</form>
39  
-{% endblock place_order %}
1  paypal/templates/paypal/error.html
... ...
@@ -1 +0,0 @@
1  
-asdf asdfas
0  paypal/templates/paypal/preview.html → paypal/templates/paypal/express/preview.html
File renamed without changes
3  setup.py
@@ -13,8 +13,7 @@
13 13
       keywords="Payment, PayPal, Oscar",
14 14
       license=open('LICENSE').read(),
15 15
       platforms=['linux'],
16  
-      packages=find_packages(),
17  
-      include_package_data = True,
  16
+      packages=find_packages(exclude=['sandbox*', 'tests*']),
18 17
       # See http://pypi.python.org/pypi?%3Aaction=list_classifiers
19 18
       classifiers=['Environment :: Web Environment',
20 19
                    'Framework :: Django',

Showing you all comments on commits in this comparison.

smaggs

Removing this line prevents the templates under paypal from getting installed. The MANIFEST line only gets them into the source distribution, but in order to be installed by pip they need to be included in setup.py through include_package_data or individual listings.

David Winterbottom

Good spot - thanks. I'll push a new release with this fixed

David Winterbottom

Try version 0.2.4 - should be fixed.

smaggs

Thanks!

Something went wrong with that request. Please try again.