Where do the payment results go? Are they stored in the Drupal database?

I would have expected something in the webfom submissions.

Even if it's just the amount that has been paid... that could make it clear to the receiver of a submission that a payment happened.

Comments

xano’s picture

Are you familiar with Administer » Content » Payments?

helmo’s picture

Title: Payment result » Payment result linked to webform submission
Category: support » feature

Well no.

When views is not enabled the tab was not shown on /admin/content. Was that intentional? After activating the admin_menu module I saw the admin/content/payments menu entry.

Adding

 'type' => MENU_LOCAL_TASK,

to $base in payment_menu() seems to do the trick.

But this is not really what I meant.
The payments on admin/content/payments have no relation to webform submissions, by them self they have little meaning (atleast when anonymous visitors use the form).

I guess this is a feature request then...

I would like to have some data in the webform submission to relate it to the payment.

xano’s picture

Title: Payment result linked to webform submission » DIsplay component value
Component: User interface » Code
Assigned: Unassigned » xano
Status: Active » Needs review
StatusFileSize
new1.02 KB

The attached patch ensures that results are displayed when viewing them in HTML or plain text mode. It does not yet provide this feature for the table view or CSV exports.

helmo’s picture

Title: DIsplay component value » Display component value

Thanks, that works great.

I guess it needs another hook implementation for csv:


/**
 * Implements _webform_csv_headers_component().
 */
function _webform_csv_headers_payment_webform($component, $export_options) {
  $header = array();
  $header[0] = '';
  $header[1] = '';
  $header[2] = $component['name'];
  return $header;
}

/**
 * Implements _webform_csv_data_component().
 */
function _webform_csv_data_payment_webform($component, $export_options, $value) {
  if ($value[0]) {
    return $value[0]; // TODO I guess the paid amount would be appropriate.
  }
  else {
    return '';
  }
}

And hooks for the table and analyse pages:


/**
 * Implements _webform_analysis_component().
 */
function _webform_analysis_date($component, $sids = array()) {


/**
 * Implements _webform_table_component().
 */
function _webform_table_date($component, $value) {


xano’s picture

StatusFileSize
new1.79 KB

Added CSV support. Let's keep the analysis for another issue.

helmo’s picture

StatusFileSize
new914 bytes

CSV look OK.

What about this as a table hook.

Status: Needs review » Needs work

The last submitted patch, payment_webform_1991814_02.patch, failed testing.

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new2.09 KB

Use payment_amount_human_readable() to format payment amounts.

However, for consistency, we may just want to link to the payment instead.

xano’s picture

This needs tests as well.

helmo’s picture

Yes #8 looks OK, a link there is better.

xano’s picture

Status: Needs review » Fixed

Forget the tests. The Webform API is too undocumented and messy for me to spend time on those.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xano’s picture

Assigned: xano » Unassigned
xano’s picture

Issue summary: View changes

typo