This project is not covered by Drupal’s security advisory policy.

Extend the Webform module to enable payment/purchase forms that submit to CASHNet eMarket Checkout. Accomplished by providing a "CASHNet Item" Webform Component that when added to any Webform will submit an item to Checkout. Multiple "CASHNet Item" components can be added to a single form, and their individual submission to the CASHNet shopping cart can be controlled by other fields on the form.

Usage

  1. Add items to your CASHNet store. Those items may have defined prices (recommended), or may have variable prices (in which case the price will be provided by the Webform CASHNet item).
  2. Implement hook_webform_cashnet_items() to define corresponding CASHNet items. These should match the items created in CASHNet.
  3. Create your Webform(s). You should add as many fields as necessary to satisfy your particular CASHNet "reference value" requirements, if any.
  4. Add one (or more) "Webform CASHNet Item" items to your Webform, and configure it (or them) by choosing appropriate CASHNet Item(s) (from the list defined by hook_webform_cashnet_items() implementations).
  5. Choose appropriate Webform elements to populate the fields sent to CASHNet by the Webform CASHNet Item when it is submitted.

Webform CASHNet Item Configuration Notes

  1. The Webform CASHNet Item itself returns a unique 16-character ID, visible in Webform's submission emails/results. The CASHNet Item can also reference itself for any reference values (after it has been saved for the first time). This is very useful as it allows you to pass along the unique ID to CASHNet, tying the whole Webform submission to the CASHNet transaction. For example, you can create a ordernumber reference value in CASHNet, then pass the CASHNet Item itself in that field.
  2. When using a referenced field value to derive the amount, the Webform CASHNet Item will apply regular expressions to find anything that looks like a number. This allows great flexibility in sources: for example, you can use an Options element with values like "Red T-Shirt ($20)" and "Blue T-Shirt ($25)", and the Webform CASHNet Item will correspondingly send either "20.0" or "25.0" as the amount of the transaction.
    1. The REGEXP pattern will find the last of any numeric strings (separated by "." or "," characters), and floatval() them.
      Examples:
      • "XYZ 123 - $2.00" will become "2.0"
      • "XYZ 123 - $2.00 ABC" will become "2.0"
      • "123 456" will become "456.0"
      • "123 456 ABC" will become "456.0"
  3. Important: If the amount is not set by the item in CASHNet and is instead passed along by a Webform CASHNet Item, it is potentially alterable during transit (similar to PayPal or other payment gateways: the value is passed by the client's browser and is therefore susceptible to alteration by the client). Use this option with caution, and remember to carefully reconcile charges with amounts due.
  4. Important: Each Webform CASHNet Item defines the store that it belongs to, and any single submission to CASHNet can have multiple items, but only one store for the whole submission. Accordingly, we set the destination store for the whole submission to the store of the first submitted Webform CASHNet Item on the form. It is therefore not recommended to have different items from different stores on a single form. If such a mixed-store form is necessary, be sure to use the "submission control" features of Webform CASHNet Items to prevent mixed-store items from trying to submit at the same time.

Project information

Releases