CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_contribution.trxn_id uniqueness
Pages: [1]

Author Topic: civicrm_contribution.trxn_id uniqueness  (Read 299 times)

sdragnev

  • I post occasionally
  • **
  • Posts: 40
  • Karma: 0
  • CiviCRM version: 4.6.2
  • CMS version: Drupal 7
  • PHP version: 5.4
civicrm_contribution.trxn_id uniqueness
June 10, 2014, 12:47:43 pm
I came upon an issue caused by the trxn_id field in the contributions table being unique.

We're using drupal commerce for member signup (more powerful than civi for our [complicated] purposes). However, we end up breaking up the single payment into multiple contributions because the funds are going into different accounts and we need this recorded in civi.
Saving the transaction ID that comes back from the payment processor is impossible because the trxn_id field in the database is a unique index.

Now, our implementation is specific and I don't expect civi to support that out of the box or anything. It just got me thinking about that database field.

Is there a reason why this is unique? This is a field that comes back from a 3rd party software.
I understand (and encourage) having database constraints for data that's purely civicrm's, but unless there's a bigger reason, this one appears to be added just because it makes sense. Surely all transaction IDs that we get back will be unique!

I don't think that should be up to civicrm to decide since it's a value coming from an external source.

Again, I'm not worried about our implementation (there are decent workarounds). Just thinking out loud here.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_contribution.trxn_id uniqueness

This forum was archived on 2017-11-26.