Skip to content

Commit

Permalink
Add *_address keys in payment data doc
Browse files Browse the repository at this point in the history
Add shipping_address, billing_address, shipping_visibility, and
billing_visibility in the list of payment data keys plugin users can
provide to the plugin.

Also fix a typo: shopping_visibility => shipping_visibility
  • Loading branch information
Exirel committed Apr 18, 2016
1 parent 1e9613a commit c49742c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 22 deletions.
2 changes: 1 addition & 1 deletion adyen/scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def get_fields_delivery(self, request, order_data):

# By default delivery details are not visible.
fields[Constants.DELIVERY_ADDRESS_TYPE] = (
order_data.get('shopping_visibility', '2'))
order_data.get('shipping_visibility', '2'))

return fields

Expand Down
57 changes: 36 additions & 21 deletions docs/howto/use.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,42 @@ fields.
List of payment data items
--------------------------

+--------------------+-----------------------+--------------------------------+----------+
| Key | Adyen Form Field | Description | Required |
+====================+=======================+================================+==========+
| ``order_number`` | ``merchantReference`` | Order Number  | Yes |
+--------------------+-----------------------+--------------------------------+----------+
| ``client_id`` | ``shopperReference`` | Customer's identifier | Yes |
+--------------------+-----------------------+--------------------------------+----------+
| ``client_email`` | ``shopperEmail`` | Customer's email | Yes |
+--------------------+-----------------------+--------------------------------+----------+
| ``currency_code`` | ``currencyCode`` | Currency code | Yes |
+--------------------+-----------------------+--------------------------------+----------+
| ``amount`` | ``paymentAmount`` | Payment amount (in cent) | Yes |
+--------------------+-----------------------+--------------------------------+----------+
| ``shopper_locale`` | ``shopperLocale`` | Customer's locale | Yes |
+--------------------+-----------------------+--------------------------------+----------+
| ``country_code`` | ``countryCode`` | Merchant's Country | Yes |
+--------------------+-----------------------+--------------------------------+----------+
| ``source_type`` | ``allowedMethods`` | Selected ``SourceType`` object | No |
+--------------------+-----------------------+--------------------------------+----------+
| ``return_url`` | ``resURL`` | Custom Payment Return URL | No |
+--------------------+-----------------------+--------------------------------+----------+
+-------------------------+-------------------------+--------------------------------+----------+
| Key | Adyen Form Field | Description | Required |
+=========================+=========================+================================+==========+
| ``order_number`` | ``merchantReference`` | Order Number  | Yes |
+-------------------------+-------------------------+--------------------------------+----------+
| ``client_id`` | ``shopperReference`` | Customer's identifier | Yes |
+-------------------------+-------------------------+--------------------------------+----------+
| ``client_email`` | ``shopperEmail`` | Customer's email | Yes |
+-------------------------+-------------------------+--------------------------------+----------+
| ``currency_code`` | ``currencyCode`` | Currency code | Yes |
+-------------------------+-------------------------+--------------------------------+----------+
| ``amount`` | ``paymentAmount`` | Payment amount (in cent) | Yes |
+-------------------------+-------------------------+--------------------------------+----------+
| ``shopper_locale`` | ``shopperLocale`` | Customer's locale | Yes |
+-------------------------+-------------------------+--------------------------------+----------+
| ``country_code`` | ``countryCode`` | Merchant's Country | Yes |
+-------------------------+-------------------------+--------------------------------+----------+
| ``source_type`` | ``allowedMethods`` | Selected ``SourceType`` object | No |
+-------------------------+-------------------------+--------------------------------+----------+
| ``return_url`` | ``resURL`` | Custom Payment Return URL | No |
+-------------------------+-------------------------+--------------------------------+----------+
| ``shipping_address`` | ``deliveryAddress.*`` | Customer shipping address | No |
+-------------------------+-------------------------+--------------------------------+----------+
| ``shipping_visibility`` | ``deliveryAddressType`` | Visibility of the address | No |
+-------------------------+-------------------------+--------------------------------+----------+
| ``billing_address`` | ``billingAddress.*`` | Customer billing address | No |
+-------------------------+-------------------------+--------------------------------+----------+
| ``billing_visibility`` | ``billingAddressType`` | Visibility of the address | No |
+-------------------------+-------------------------+--------------------------------+----------+

Both ``shipping_address`` and ``billing_address`` are expected to be standard
shipping and billing Django-Oscar address objects.

The ``shipping_visibility`` and ``billing_visibility`` take the values defined
in the Adyen documentation: 1 for visible but not editable and 2 for not
visible. By default, 2 is used by the plugin.


Handle payment return
Expand Down

0 comments on commit c49742c

Please sign in to comment.