I have been developing a direct payment method where payments are collected on third-party sites, hence I don't need to set the payment types for the form, the user doesn't need to give the credit card details at all.

According to the current behaviour _webform_submit_pay() tries to mask the credit card number even when it wasn't given by the user. This is causing theme_webform_display_pay() to fail, because the cc_number is set to **** **** ****, but I didn't implemented payment_types() because - like I said - it is a direct method.

function theme_webform_display_pay($element) {
  if ($element['#value']['cc_number']) {
    $value = $element['#value'];
    $pay_method = pay_method_load($element['#pmid']);
    $payment_types = $pay_method->payment_types();
    ...

We should check on submit if the credit card type and number is set, before doing anything with it.

CommentFileSizeAuthor
#1 webform_pay.977302_01.patch1.2 KBsgabe
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sgabe’s picture

Status: Active » Needs review
FileSize
1.2 KB

Patch attached.

quicksketch’s picture

Thanks, so far I haven't used Webform Pay with anything but credit cards. This looks good to me and I'll include it next time I'm working on Webform Pay.

quicksketch’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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