FlexWin (Method 1)
Handelsbanken Finans
Parameters specific for invoice payments
Short example for basic overview.
|
<html> <body> <form name="payform" method="post" action="https://payment.architrade.com/paymentweb/start.action"> <input type="text" name="merchant" value="Enter your DIBS merchant id here" /> <input type="hidden" name="orderid" value="your_order_id_ABC123" /> <input type="hidden" name="lang" value="en" /> <input type="hidden" name="amount" value="400" /> <input type="hidden" name="currency" value="752" /> <input type="hidden" name="accepturl" value="http://www.yourshop.com/payment_accepted.html" /> <input type="hidden" name="structuredOrderInformation" value="<?xml version="1.0" encoding="UTF-8"?><orderInformation> <orderItem itemDescription="prod1" itemID="3363" orderRowNumber="1" price="400" quantity="1" unitCode="pcs" VATPercent="0" /></orderInformation>"> <input type="submit"> </form> </body> </html> |
Parameters marked [parameter] are optional.
All parameters specified below only has effect for invoice payments, except the ‘orderid’ and ‘paytype’ parameters that are also available in the standard Flexwin integration applicable for various payment methods.
Parameter | Type | Description |
| amount | long - Minimum value of 1 | Amount of transaction in smallest unit. Used to validate against prices in structured orderInformation. |
| accepturl | string. No max length | The URL of the page to be displayed if the purchase is approved. |
| orderid | string. Max 16 characters | For invoice payments the orderid is limited to 16 characters |
| currency | string. 3 digits or 3 letters | Currency specification as indicated in ISO4217 where the EUR is no. 978. Either the numeric or alphabetic code is accepted. Also see our list of currencies. |
| email (optional, but strongly recommended to always provide) | string | This is the customer's email address. It is strongly recommended to always provide this information to DIBS for all invoice payment methods. |
| structuredOrderInformation | string | This is a string which specifies order information. E.g., the items purchased and their quantity, item description, unit price, sum total, etc., all formatted in XML. |
| [billingFirstName] | string | Customer's billing first name. |
| [billingLastName] | string | Customer's billing last name. |
| [billingAddress] | string | Customer's billing street address. If acquirer doesn't support getAddress but requires user to enter some billing address information, this parameter can be used to prepopulate values on IW 1st page/or set values on merchant's/legacy system's side. If acquirer returns appropriate value in getAddress/placeOrder - value from acquirer will override value sent in this parameter. |
| [billingAddress2] | string | Customer's billing street address (continued). |
| [billingPostCode] | string | Customer's billing postal code |
| [billingPostalPlace] | string | Customer's billing postal place (city, town, etc). |
| [shippingFirstName] | string | Customer's first name. |
| [shippingLastName] | string | Customer's last name. |
| [shippingAddress] | string | Customer's shipping street address. If acquirer supports delivery to address specified by merchant (different from registered on acquirer), this parameter should be used. |
| [shippingAddress2] | string | Customer's shipping street address (continued). |
| [shippingPostCode] | string | Customer's shipping postal code. |
| [shippingPostalPlace] | string | Customer's shipping postal place (town, city, etc.). |
| [shippingFee] | string | Shipping Fee (expressed in smallest unit of currency). |
| [ShippingFeeVAT] | string | Shipping Fee VAT (e.g. "25%" is expressed as "2500"), must be filled if shippingFee is present. |
| [customerIpAddress] | Customer's IP address. | |
| [merchantName] | string | Merchant's name to be displayed. Default is read from the merchants Dibs agreement. |
| [invoiceFee] | number | Invoice fee (expressed in minor unit of currency). |
| [invoiceFeeVAT] | number | Invoice Fee VAT (e.g. "25%" is expressed as "2500"), must be filled if invoiceFee is present. |
| [paytype] | string. max 30 characters | Used to show and control the shops selection of payment methods in Flexwin. This list must be comma separated with no spaces in between. Example: <input type="hidden" name="paytype" value="VISA,MC,AMEX,MTRO,ELEC" /> See our list of possible paytypes. |
| [customerId] | string | If the shop holds IDs (customer numbers) for it’s customers this information should be passed to the invoice service provider using this parameter. The customerId is limited to 20 characters. |
| [createInvoiceNow] | Specifies whether the invoice is to be created in direct connection to the order placement. This functionality can be used if the order is to be shipped automatically upon order creation. Allowed values: true, false. Default: false. | |
| [distributionType] | Defines on which media should the bill be sent to the customer. | |
| [orgno] | number | Organization number. If not sent as input parameter to FlexWin, the customer may be prompted for it in the DIBS invoice payment flow (invoice window). |
| [doNotShowLastPage] | Whether to show the receipt page (last page) in the DIBS invoice payment flow (invoice window). | |
| [ssn] | number | Social security number. If not sent as input parameter to FlexWin, the customer may be prompted for it in the DIBS invoice payment flow (invoice window). |
| [zip] | The customer’s registered postal/zip code. If not specified, the customer may be prompted for it in the Dibs invoice payment flow. | |
| [round] | boolean | input type= true or false |
Structured order information
Please notice that the contents of the parameter structuredOrderInformation needs to be UTF-8 and HTML-encoded. Below is a short example of the same parameter before and after HTML encoding.
Plain text
|
<?xml version="1.0"
encoding="UTF-8"?><orderInformation> <orderItem
itemDescription="prod1" itemID="3363" orderRowNumber="1" price="400"
quantity="1" unitCode="pcs" VATPercent="0"
/></orderInformation> |
HTML encoded
|
<?xml version="1.0"
encoding="UTF-8"?><orderInformation>
<orderItem itemDescription="prod1"
itemID="3363" orderRowNumber="1"
price="400" quantity="1"
unitCode="pcs" VATPercent="0"
/></orderInformation> |
Below are the parameters for the structured order information.
Special characters
Special characters as < > & ” ’ are not valid in XML data and cannot be used. More information can be found here. We recommend that you convert these characters to:
| < : < > : > ' : ' " : " & : & |
To use characters like å, ä, ö you need to use the character entities i.e
| å = å Å = Å ä = ä Ä = Ä ö = ö Ö = Ö æ = æ Æ = Æ ø = ø Ø = Ø |
More entities can be found here. More information on FlexWin and charsets as well as example PHP code of how to rewrite data chars and charsets can be found in the zip file provided in the examples section at the bottom of this page.
Return values
Returns from Flexwin are described in general under return pages. In addition to the normal return parameters you will receive the invoice specific values listed below.
Please note:
-
Some of the return values are only returned to callbackurl, not to accepturl, which means you need to use the callback functionality for all invoice payment methods.
-
You need to enable the return of all CGI variables in DIBS Admin under Integration > Return Values. (check all the boxes)
-
Normally, it is a requirement from the invoice service providers that that shipment of goods is made to the customers registered address and not any other address.The customers registered address is the address returned from FlexWin to the shop via some of the parameters specified in the table below.
Parameter | Description |
| lastName | Customer's last or company name from national registry. |
| customerId | Customer id / Customer number |
| deliveryAddress | Delivery address from national registry. Normally, the goods have to be delivered to the address returned here. |
| deliveryCountryCode | Customer's country code returned by acquirer, e.g.‘SE’. |
| deliveryPostalCode | Delivery postal code from national registry |
| deliveryPostalPlace | Delivery postal place from national registry |
| invoiceId | Invoic id in SHB's database. |
| creditLimit | Indicates credit limit of customer. |
| round | Indicates wether rounding was used in this invoice. |
Discounts
Discounts are specified as normal order items but with negative prefix for both the price and the VAT parameter values. VAT must be specified either as VATAmount or VATPercent.
Important:
Handelsbanken Finans allows only VAT percentage equal to 0, 6, 12 and 25% - all other values will be rejected.
Invoice fees
Invoice fees may be added to the transactions by either:
Option 1.
Invoice fee as a separate order line in your webshop posted to DIBS as part of the transaction amount. This requires the use of the paytype parameter to ensure that the fee is added only for invoice transactions since the ‘amount’ parameter value sent to FlexWin will need to include the fee amount. This solution makes it impossible to provide anything but invoice payment methods to the customer in DIBS FlexWin, This is because other payment methods must probably not be affected by the invoice fee. Please refer to this document, point 9 for further information.
Option 2.
Only available for some invoice service providers. Invoice fee added in the invoice service provider’s system. Please contact your invoice service provider directly for more details.
Testing
To activate test mode for any invoice payment method you need to send a test parameter along with the post parameters.<input type="hidden" name="test" value="foo" />.
General invoice test information can be found here.
If you cannot see the invoice payment method as an option in DIBS FlexWin when sending the test parameter it most likely means that the test functionality is not activated in DIBS backend and you should contact DIBS support according to the contact details below.
Please contact our support via one of the following links regarding any integration issues.
Denmark http://help.dibs.dk
Norway http://help.dibs.no
Sweden http://help.dibs.se
Debugging / Technical Integration Issues
Whitescreen: If a whitescreen appears, this is usually because the parameter ‘structuredOrderInformation’ is missing or caused by a syntax error in the XML file. The syntax of the XML file can be validated using XML DOM Validation: http://www.w3schools.com/dom/dom_validate.asp
Technical error: Common reasons if this error message appears is logical errors such as error in the calculation of VAT amount or total order sum. If an error occurs, you can normally find a detailed error description via a link from the error page that appears.
Recommendation
It is recommended to reduce the number of clicks/steps needed for the customer to return to the shop after payment is fullfilled by using both of the two following methods.
-
In DIBS Administration, Integration, Flexwin check the " Skip accept page" checkbox. Please note that if this method is used the accept-url redirect to the web shop from FlexWin will be a GET request.Use the doNotShowLastPage = true described in the list paramater list above.
Examples
The ZIP file below consists of two complete and fully working examples for integrating DIBS Invoice payment methods. The zip file also contains useful information regarding charset handling.
DIBS Invoice examples