Merci/Ubercart Integration

Component ID

1866118

Component name

Merci/Ubercart Integration

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This project is running on an actively used intranet site as of October 2013. I don't plan to update this page much, but if you'd like to use this module send me a message and I'd be more than happy to answer questions & help you make it work. It will need a bit of work, in the interests of full disclosure.

This module will integrate MERCI and Ubercart as flexibly as possible.

This is already accomplished by AGReservations but this module aims to be simpler and more flexible by accomplishing less. Essentially, this adds a "Payment status" field to your MERCI reservations and exposes an Add to Cart button to users looking at the MERCI reservation page.

Here are the specifications of the module (work in progress):

  • Whenever you make a reservation, an associated payment product (defined by a product class) is created and referenced by an entityreference field.
  • The payment has its price automatically calculated and filled in, and a few more things associate it with the reservation. For instance, deleting the reservation deletes the payment.
  • Payment objects additionally have an entity reference to Ubercart orders that contain them as a product - add stuff to your theme to display "paid" or "no payment yet" in your reservation.

What this means is that reservations are able to have a paid/unpaid status, and that Ubercart handles all the heavy lifting of payment.

TODO List:

  • The price calculation needs work. It might not handle buckets properly - I haven't tested that. There is a hook for changing the price calculation, but no other modules use the hook so it's not super helpful to non-developers.
  • I'd like to make a better API for determining reservation payment status with one function.
  • Maybe this could be made more user friendly.
  • A user could, theoretically, make more than one payment and then be really pissed off. But it is pretty hard for them to accomplish that.
  • Test the module to generate issues and bug reports.
  • Updating the reservation needs to update the payment.
  • Updating reservations that are already paid will be super messy and is not handled yet.
  • Reservations with a price of $0 should have Payment status = Complete by default.

Getting started:

1) Install modules, set up MERCI with at least one item of equipment.
2) Create a valid reservation that has a price.
3) Now visit Structure > Content Types > Reservation > Manage Display to make sure Payments are displayed as a rendered entity.
4) View your reservation - it should have a payment field referenced.
5) Customize payment display how you like it with .tpl.php files or something. I made it show up as a price, a Payment Status field saying either Incomplete or Complete, and an Add to Cart button if the status was Incomplete.

Contributions are welcome!