You could use my Simple payments module as the backend instead of re-inventing the wheel.

Implement hook_simple_payment_process() to record when an invoice has been paid.

Comments

cweagans’s picture

Status: Active » Postponed

Oh! I'll look at migrating to that at some point.

Right now, I just kind of needed to get this out the door and it does the basics.

In the future, for sure though. Thanks for the pointer!

cweagans’s picture

Assigned: Unassigned » cweagans
Status: Postponed » Needs review
StatusFileSize
new5.2 KB

Changed my mind. Simple Payments really is simple enough for everyday use. I hit a couple of barriers with it, but I think it's a great module :)

Patch attached. Could you take a look at the approach taken and verify that it was the correct way to go (or not)?

Thanks!

cweagans’s picture

StatusFileSize
new6.68 KB

Whoops. Wrong patch.

jbrown’s picture

Version: » 6.x-1.x-dev
Status: Needs review » Needs work

drupal_get_destination() doesn't return a path, so can't be passed in the first parameter of url.

just do url('node/' . $node->nid, array('absolute' => TRUE))

simple_payments is designed to attach an nid to a payment - just set vars['nid'] to $node->nid and then flag based on $payment['nid'].

You need to verify that the correct amount was paid in the payment hook. simple_payments does not cryptographically sign the payment vars.