Inquiries: please send a message from within your SWREG control panel.


Variable Product Pricing

To do this you must first enable variable pricing for each product delivery type (the default being variable pricing disabled).

To do this, click your product name and click Edit on the Summary page. Navigate to the product variations, and you will see a checkbox to enable variable pricing. It will expand an option to set a minimum price.

To set the price for an item specified on the command line, use vp=<price>. You can use the standard ':' notation for specifying multiple prices.

Prices specified as '-1' (or if you omit the vp= parameter) will be as you have set them up on the setup page. If you have set up a delivery charge, this will be added on. Banding will be ignored.

 

Secure Variable Pricing

To prevent URL manipulation of the variable pricing parameter, SWREG has added digest support to validate certain fields related to variable pricing.

To enable enforcement of this feature you will need to login to your account and go to your "Configuration" page and scroll down to the "Secure Variable Pricing" section. You will need to generate shared private keys that will be used to generate the digest. For existing clients we recommend that you create the keys and update your URLs before you enable enforcement of this feature; otherwise, SWREG will reject the variable price.

Generating vphash parameter

You have two options to generate the vphash parameter--Either generate it yourself or use "Direct Link Builder" in the vendor menu.

Generating the vphash yourself.
  1. The message will be built in the following format: p=(products)&q=(quantities)&v=(variations)&d=(delivery methods)&vp=(variable prices)&vpexp=(epoch expiration)&vpkeyid=(key ID)
  2. Parameter order matters. If it doesn't match the above order, the vphash will not match SWREG and will fail.
  3. Prices will always be provided with decimals to the hundredth with no currency symbol (for example, $100 would be entered as 100.00).
  4. vpexp is required for "Secure Variable Pricing."
  5. Generate the vphash based on the "message"
    1. Use HMAC-MD5 to encode the message.
    2. Convert to hex.
    3. Truncate the digest result to the first 16 characters.
    4. Convert the result to lowercase.

Example 1:

Product Code Quantity Variation ID Delivery ID Variable Price
100-1 1 0 0 9.95
  • Expiration: 9/19/2011 23:59:59 (epoch = 1316476799)
  • Key ID: 1
  • Key: 27d02c05-8227-4de4-9aad-f2fe24ebe226
  • Message: p=100-1&q=1&v=0&d=0&vp=9.95&vpexp=1316476799&vpkeyid=1
  • Digest result: 06adc8fd478c36efd959be5b0395a6e7 (hex)
  • vphash: 06adc8fd478c36ef (truncate to left 16 characters, lower case)
  • s.cgi query string: s=100&p=100-1&q=1&v=0&d=0&vp=9.95&vpexp=1316476799&vpkeyid=1&vphash=06adc8fd478c36ef

Example 2:

Product Code Quantity Variation ID Delivery ID Variable Price
100-1 1 0 0 9.95
100-2 3 1 1 15.50
  • Expiration: 9/19/2011 23:59:59 (epoch = 1316476799)
  • Key ID: 1
  • Key: 27d02c05-8227-4de4-9aad-f2fe24ebe226
  • Message: p=100-1:100-2&q=1:3&v=0:1&d=0:1&vp=9.95:15.50&vpexp=1316476799&vpkeyid=1
  • Digest result: 4d4ec3832dde66483e77494c67424fad (hex)
  • vphash: 4d4ec3832dde6648 (truncate to left 16 characters, lower case)
  • s.cgi query string: s=100&p=100-1:100-2&q=1:3&v=0:1&d=0:1&vp=9.95:15.50&vpexp=1316476799&vpkeyid=1&vphash=4d4ec3832dde6648

 

Return to Summary >>

SWREG offers a paypal alternative, affordable ecommerce, payment processing, ecommerce solution, and an online software store with the ability to sell shareware.