2

I'm trying to connect Ubercart with Storm's invoicing module. When a new Storm invoice is created and the client is emailed a link to a PDF of it, they should also receive a link to an Ubercart product priced as per the invoice total if they wish to pay online.

Any idea how best to go about this? Is Ubercart even the right module for this type of task? I've been trying to wrap my head around this tutorial, but it leaves a bit to be desired. Much appreciated.

Update: I've also begun looking into alternatives, such as Simple Payments and Payments API. Both leave something to be desired (the former in terms of documentation, the latter in terms of PayPal support); I'm also at this point looking for ways to create a PayPal form and simply submit the price value from Storm as the total for the PayPal transaction.

  • Is it possible to use Drupal 7? Anyways for Drupal 6 ubercart is probably the best option, but there are several headaches to be overcome. – googletorp May 2 '11 at 8:19
  • @Googletorp -- No, not to my knowledge; I use a few D6-specific modules that haven't been ported to D7 yet. Mind briefly outlining what those headaches may be? – aendrew May 2 '11 at 8:22
  • 1
    @aendrew Ubercart in general isn't as flexible and consistent as it could be, and that provides some problems. Static HTML hardcoded different places, some things are hard to alter. It's hard for my to pin point pain points, it depends what you need to build. But the overall developer experience is IMO painful. On the plus side, there is a lot of contrib modules which can get you far. But those last 10% can be tricky to overcome. – googletorp May 2 '11 at 9:26
  • @Googletorp -- Thanks for the heads-up. Really, I just need some way to use PayPal for clients to pay their invoices; Ubercart might really be overkill. – aendrew May 2 '11 at 10:08
  • 1
    @aendrew There are a lot of modules that are integrating with paypal one way or the other. It should be relatively easy to either create your own module or use one to create this functionality. All you need is to send an amount and tekst to PayPal along with configuration. – googletorp May 2 '11 at 11:14
1

I ultimately went with Simple Payments because it provides the most direct path between the invoice and PayPal.

function storminvoice_paypal_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
if ($node->type == 'storminvoice') {

      function storminvoice_paypal_form($form_state, $product_id) {

      $vars = array(
        'module' => 'storminvoice_paypal',
        'type' => 'Invoice Payment',
        'custom' => $node->nid,
        'item_name' => 'Services Rendered',
        'no_shipping' => TRUE,
        'no_note' => TRUE,
        'return' => url('', array('absolute' => TRUE)),
        'amount' => $node->total,
      );

      $form = simple_payments_paypal_payment_form($vars);

      $form['button'] = array(
        '#type' => 'button',
        '#value' => t('Pay with PayPal'),
      );

      return $form;
    }

    $output = drupal_get_form('storminvoice_paypal_form', $node->nid);
    $node->content['payment']['#value'] .= $output;
    break;
  }

  }

Now I need to figure out how to do the handling for Simple Payments...

Edit: Got this working! Contact me if you want more info on how I did it, I may release the code as a contrib module eventually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.