Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<Payment>
	<Code>Payment method code</Code>
	<Debit>
		<ExternalID>External ID</ExternalID>
		<AccountHolder>Account Holder</AccountHolder>
		<AccountNumber>Account Number</AccountNumber>
		<BankCode>Bank Code</BankCode>
		<BankName>Name of Credit Institution</BankName>
		<IBAN>IBAN</IBAN>
		<BIC>BIC</BIC>
	</Debit>
	<CreditCard>
		<Holder>Card Holder</Holder>
		<BrandID>Card Type</BrandID>
		<Number>Card No. without Spaces</Number>
		<ExpiryDate>Expiry Date in Format: YYYY-MM</ExpiryDate>
		<VerificationCode>Card Verification Code</VerificationCode>
	</CreditCard>
</Payment>

The Section <Debit>...</Debit> is only given with the method of payment "direct debit." Otherwise this section is completely absent.

The Section <CreditCard>...<CreditCard> is only given with the method of payment "credit card." Otherwise this section is completely absent.

...

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<response>
	<basicdata>
		<date>Date in Format DD.MM.YYYY</date>
		<time>Time in Format HH:MM:SS</time>
		<mallid>Mallid</mallid>
		<shopid>ShopID</shopid>
		<subshopid>SubShopID</subshopid>
		<result>”OK” or “ERROR”</result>		<!-- The parameter “errorcode“ occurs only with the result=ERROR -->
		<errorcode>Error code</errorcode>		<!-- The parameters "errordetail1" and "errordetail2" are set with many errors.-->
		<errordetail1>Error description 1</errordetail1>
		<errordetail2>Error description 2</errordetail2>
	</basicdata>	<!-- The section <orderdata>...</orderdata> occurs only if result=OK -->
	<orderdata>
		<ordernumber>Order number</ordernumber>
		<subtotal>Subtotal</subtotal>
		<resellersurcharge>Reseller surcharge </resellersurcharge>		<!-- Optional -->
		<paymentcost>Payment method costs</paymentcost>		<!-- Optional -->
		<deliverycost>Delivery costs</deliverycost>		<!-- Optional -->
		<totaldiscount>Total discount</totaldiscount>		<!-- Optional -->
		<vat>VAT</vat>		<!-- Optional, only for netto-prices -->
		<totalsum>Total sum</totalsum>
		<uploadids>			<!-- Optional -->
			<uploadid>
				<UploadID>.<PositionID>
			</uploadid>
			<!-- ... -->
		</uploadids>
		<items>
			<item>				<!--for each order position -->
				<position>Position in Basket</position>
				<number>Product number</number>
				<quantity>Amount</quantity>
				<sum>Total sum of position</sum>
			</item>
			<!-- ... -->
		</items>
	</orderdata>
</response>

Triggering an ASSE process

A section can be defined in the configuration that allows an ASSE process to be triggered for each order item.

To do this, the configuration must be extended as follows:

Code Block
<Asse>
    active= yes
    Template = asse_template.tpl
    EventTemplate = asse_event_template.tpl
    AsseDirectory = /var/spool/wsasse
</Asse>

The templates mentioned in the configuration must be stored in the order generator directory of the respective shop.

The template for the ASSE event can be as follows:

Code Block
{
    "properties": {
        "content_type": "application/json",
        "delivery_mode": 2
    },
    "routing_key": "websale-ftp",
    "payload": "{\"uploadFinished\": \"$DC-FPTimestamp$\",\"shopNumber\": \"$WS-OTPasseordernumber$\",\"uploadId\": \"$WS-OTPasseuploadid$\",\"positionId\": \"$WS-OTPasseposition$\",\"source\": \"websale-ftp\",\"service\": \"autoOrder\",\"uri\": \"sftp://ftp.c1.websale.net:22022/$WS-OTPasseuploadid$/$WS-OTPasseposition$\"}",
    "payload_encoding":"string"
}

It is important here that the correct $WS and $DC tags are used, as these are replaced during the ordering process.

The ASSE template can look like this:

Code Block
<Header>
   ShopID               = testshop
   SubShopID            = $WS-SubshopId$
   EventID              = wsOrderGeneratorUploadFinished
   Timestamp            = $DC-FPTimestamp$
   EventCounter         = 1
</Header>
<EventDeliveryTerms>
   Endpoint             = https://websale-asse:fNyb5t-dY5zALcVNwyPdg42ShPEVQWeZ@casual-khaki-bobcat.rmq2.cloudamqp.com/api/exchanges/websale/file.upload/publish
   Type                 = POST
   ConnectionTimeoutInMS = 5000
   ConnectionRetries    = 5
   ConnectionDelayInMinutes = 10
   ServiceCategory      = FileUpload
<DefinitionOfOK>
<+ConditionGroup>
<+Condition>
       Proof                = HTTPStatusCode
       Type                 = value
       Value                = 200
</+Condition>
</+ConditionGroup>
</DefinitionOfOK>
</EventDeliveryTerms>
<PayloadHEX>
$WS-AsseText$
</PayloadHEX>

The $WS-AsseText$ tag is replaced by the hex-encoded content of the ASSE event template.

The file is stored under <shopid>_<subshopid>_autoorderUploadFinish-<Bestellnummer>-<Positionsnummer>.asse in the directory /var/spool/wsasse.

Rules

An order will only be generated when all transferred data are correct. The following checks are performed by the order generator, among others:

...