From c49742cb6f392e3aa8a63583157b94ab549c2fee Mon Sep 17 00:00:00 2001 From: Florian Strzelecki Date: Mon, 18 Apr 2016 15:42:40 +0200 Subject: [PATCH] Add *_address keys in payment data doc 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 --- adyen/scaffold.py | 2 +- docs/howto/use.rst | 57 +++++++++++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/adyen/scaffold.py b/adyen/scaffold.py index 4f89438..acc5361 100644 --- a/adyen/scaffold.py +++ b/adyen/scaffold.py @@ -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 diff --git a/docs/howto/use.rst b/docs/howto/use.rst index c8decf5..c605742 100644 --- a/docs/howto/use.rst +++ b/docs/howto/use.rst @@ -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