summaryrefslogtreecommitdiff
path: root/doc/modules.rst
blob: 745a7bc11dabf6f80702f100de70a65381d18b9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
Provided backends
=================


Dummy
-----

.. class:: payments.dummy.DummyProvider

   This is a dummy backend suitable for testing your store without contacting any payment gateways. Instead of using an external service it will simply show you a form that allows you to confirm or reject the payment.

Example::

      PAYMENT_VARIANTS = {
          'dummy': ('payments.dummy.DummyProvider', {})}


Authorize.Net
-------------

.. class:: payments.authorizenet.AuthorizeNetProvider(login_id, transaction_key[, endpoint='https://test.authorize.net/gateway/transact.dll'])

   This backend implements payments using the Advanced Integration Method (AIM) from `Authorize.Net <https://www.authorize.net/>`_.

   :param login_id: Your API Login ID assigned by Authorize.net
   :param transaction_key: Your unique Transaction Key assigned by Authorize.net
   :param endpoint: The API endpoint to use. For the production environment, use ``'https://secure.authorize.net/gateway/transact.dll'`` instead

Example::

      # use staging environment
      PAYMENT_VARIANTS = {
          'authorizenet': ('payments.authorizenet.AuthorizeNetProvider', {
              'login_id': '1234login',
              'transaction_key': '1234567890abcdef',
              'endpoint': 'https://test.authorize.net/gateway/transact.dll'})}

This backend does not support fraud detection.

Braintree
---------

.. class:: payments.braintree.BraintreeProvider(merchant_id, public_key, private_key[, sandbox=True])

   This backend implements payments using `Braintree <https://www.braintreepayments.com/>`_.

   :param merchant_id: Merchant ID assigned by Braintree
   :param public_key: Public key assigned by Braintree
   :param private_key: Private key assigned by Braintree
   :param sandbox: Whether to use a sandbox environment for testing

Example::

      # use sandbox
      PAYMENT_VARIANTS = {
          'braintree': ('payments.braintree.BraintreeProvider', {
              'merchant_id': '112233445566',
              'public_key': '1234567890abcdef',
              'private_key': 'abcdef123456',
              'sandbox': True})}


This backend does not support fraud detection.


Coinbase
--------

.. class:: payments.coinbase.CoinbaseProvider(key, secret[, endpoint='sandbox.coinbase.com'])

   This backend implements payments using `Coinbase <https://www.coinbase.com/>`_.

   :param key: Api key generated by Coinbase
   :param secret: Api secret generated by Coinbase
   :param endpoint: Coinbase endpoint domain to use. For the production environment, use ``'coinbase.com'`` instead

Example::

      # use sandbox
      PAYMENT_VARIANTS = {
          'coinbase': ('payments.coinbase.CoinbaseProvider', {
              'key': '123abcd',
              'secret': 'abcd1234',
              'endpoint': 'sandbox.coinbase.com'})}

This backend does not support fraud detection.


Cybersource
-----------

.. class:: payments.cybersource.CyberSourceProvider(merchant_id, password[, org_id=None, fingerprint_url='https://h.online-metrix.net/fp/', sandbox=True, capture=True])

   This backend implements payments using `Cybersource <http://www.cybersource.com/www/>`_.

   :param merchant_id: Your Merchant ID
   :param password: Generated transaction security key for the SOAP toolkit
   :param org_id: Provide this parameter to enable Cybersource Device Fingerprinting
   :param fingerprint_url: Address of the fingerprint server
   :param sandbox: Whether to use a sandbox environment for testing
   :param capture: Whether to capture the payment automatically.  See :ref:`capture-payments` for more details.

Example::

      # use sandbox
      PAYMENT_VARIANTS = {
          'cybersource': ('payments.cybersource.CyberSourceProvider', {
              'merchant_id': 'example',
              'password': '1234567890abcdef',
              'capture': False,
              'sandbox': True})}

This backend supports fraud detection.

Merchant-Defined Data
"""""""""""""""""""""

Cybersource allows you to pass Merchant-Defined Data, which is additional information about the payment or the order, such as an order number, additional customer information, or a special comment or request from the customer. This can be accomplished by passing your data to the :class:`Payment` instance::

      >>> payment.attrs.merchant_defined_data = {'01': 'foo', '02': 'bar'}


Dotpay
------

.. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0, lock=False, lang='pl', endpoint='https://ssl.dotpay.pl/test_payment/'])

   This backend implements payments using a popular Polish gateway, `Dotpay.pl <http://www.dotpay.pl>`_.

   Due to API limitations there is no support for transferring purchased items.


   :param seller_id: Seller ID assigned by Dotpay
   :param pin: PIN assigned by Dotpay
   :param channel: Default payment channel (consult reference guide)
   :param lang: UI language
   :param lock: Whether to disable channels other than the default selected above
   :param endpoint: The API endpoint to use. For the production environment, use ``'https://ssl.dotpay.pl/'`` instead

Example::

      # use defaults for channel and lang but lock available channels
      PAYMENT_VARIANTS = {
          'dotpay': ('payments.dotpay.DotpayProvider', {
              'seller_id': '123',
              'pin': '0000',
              'lock': True,
              'endpoint': 'https://ssl.dotpay.pl/test_payment/'})}

This backend does not support fraud detection.


Google Wallet
-------------

.. class:: payments.wallet.GoogleWalletProvider(seller_id, seller_secret[, library='https://sandbox.google.com/checkout/inapp/lib/buy.js'])

   This backend implements payments using `Google Wallet <https://developers.google.com/commerce/wallet/digital/>`_ for digital goods API.

   :param seller_id: Seller ID assigned by Google Wallet
   :param seller_secret: Seller secret assigned by Google Wallet
   :param library: The API library to use. For the production environment, use ``'https://wallet.google.com/inapp/lib/buy.js'`` instead

Example::

      # use sandbox
      PAYMENT_VARIANTS = {
          'wallet': ('payments.wallet.GoogleWalletProvider', {
              'seller_id': '112233445566',
              'seller_secret': '1234567890abcdef',
              'library': 'https://sandbox.google.com/checkout/inapp/lib/buy.js'})}

This backend requires js files that should be added to the template using ``{{ form.media }}`` e.g:

.. code-block:: html

      <!-- templates/payment.html -->
      <form action="{{ form.action }}" method="{{ form.method }}">
          {{ form.as_p }}
          <p><input type="submit" value="Proceed" /></p>
      </form>
      {{ form.media }}

To specify the `postback URL` at the Merchant Settings page use direct url to `process payment view` in conjunction with your `variant name`:

E.g: ``https://example.com/payments/process/wallet``


This backend does not support fraud detection.


PayPal
------

.. class:: payments.paypal.PaypalProvider(client_id, secret[, endpoint='https://api.sandbox.paypal.com', capture=True])

   This backend implements payments using `PayPal.com <https://www.paypal.com/>`_.

   :param client_id: Client ID assigned by PayPal or your email address
   :param secret: Secret assigned by PayPal
   :param endpoint: The API endpoint to use. For the production environment, use ``'https://api.paypal.com'`` instead
   :param capture: Whether to capture the payment automatically. See :ref:`capture-payments` for more details.


Example::

      # use sandbox
      PAYMENT_VARIANTS = {
          'paypal': ('payments.paypal.PaypalProvider', {
              'client_id': 'user@example.com',
              'secret': 'iseedeadpeople',
              'endpoint': 'https://api.sandbox.paypal.com',
              'capture': False})}

.. class:: payments.paypal.PaypalCardProvider(client_id, secret[, endpoint='https://api.sandbox.paypal.com'])

   This backend implements payments using `PayPal.com <https://www.paypal.com/>`_ but the credit card data is collected by your site.

   Parameters are identical to those of :class:`payments.paypal.PaypalProvider`.

Example::

      PAYMENT_VARIANTS = {
          'paypal': ('payments.paypal.PaypalCardProvider', {
              'client_id': 'user@example.com',
              'secret': 'iseedeadpeople'})}


This backend does not support fraud detection.


Sage Pay
--------

.. class:: payments.sagepay.SagepayProvider(vendor, encryption_key[, endpoint='https://test.sagepay.com/Simulator/VSPFormGateway.asp'])

   This backend implements payments using `SagePay.com <https://www.sagepay.com/>`_ Form API.

   Purchased items are not currently transferred.

   :param vendor: Your vendor code
   :param encryption_key: Encryption key assigned by Sage Pay
   :param endpoint: The API endpoint to use. For the production environment, use ``'https://live.sagepay.com/gateway/service/vspform-register.vsp'`` instead

Example::

      # use simulator
      PAYMENT_VARIANTS = {
          'sage': ('payments.sagepay.SagepayProvider', {
              'vendor': 'example',
              'encryption_key': '1234567890abcdef',
              'endpoint': 'https://test.sagepay.com/Simulator/VSPFormGateway.asp'})}


This backend does not support fraud detection.

Sofort.com
--------

.. class:: payments.sofort.SofortProvider(key, id, project_id[, endpoint='https://api.sofort.com/api/xml'])

   This backend implements payments using `sofort.com <https://www.sofort.com/>` API.

   :param id: Your sofort.com user id
   :param key: Your secret key
   :param project_id: Your sofort.com project id
   :param endpoint: The API endpoint to use. 

Example::

      PAYMENT_VARIANTS = {
          'sage': ('payments.sofort.SofortProvider', {
              'id': '123456',
              'key': '1234567890abcdef',
              'project_id': '654321',
              'endpoint': 'https://api.sofort.com/api/xml'})}


This backend does not support fraud detection.


Stripe
------

.. class:: payments.stripe.StripeProvider(secret_key, public_key)

   This backend implements payments using `Stripe <https://stripe.com/>`_.

   :param secret_key: Secret key assigned by Stripe.
   :param public_key: Public key assigned by Stripe.
   :param name: A friendly name for your store.
   :param image: Your logo.

Example::

      # use sandbox
      PAYMENT_VARIANTS = {
          'stripe': ('payments.stripe.StripeProvider', {
              'secret_key': 'sk_test_123456',
              'public_key': 'pk_test_123456'})}


This backend does not support fraud detection.