Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice to be able to do refunds (credit requests): https://www.datatrans.ch/showcase/settlement/xml-credit-request
For the time being only as an API so that we could call it from custom code.
Are the maintainers interested in this or should I put this in a custom module instead?
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff-5-7.txt | 629 bytes | czigor |
#7 | commerce_datatrans-2602652-7-refund.patch | 2.9 KB | czigor |
Comments
Comment #2
czigor CreditAttribution: czigor at Liip for FREITAG lab. AG commentedThe API function to call is commerce_datatrans_refund_request($transaction, $amount). For usage see the DOxygen.
Comment #3
mikl CreditAttribution: mikl at Liip commentedComment #4
BerdirHm, using a template for this is a bit strange.
Can we use something like the xml writer API instead?
It's pretty easy to use and shouldn't be much more complicated than preparing and passing the values to the template.
See http://api.worldempire.ch/api/tmgmt/translators%21file%21tmgmt_file.form... for an example implementation, you just write out tags and attributes seqentually.
Comment #5
czigor CreditAttribution: czigor at Liip for FREITAG lab. AG commentedThe attached patch uses XMLWriter instead of the template.
Comment #6
BerdirNice, looks a lot better I think. The indendation will make coding sniffers unhappy but I agree that it makes it easier to follow for humans.
Shouldn't this be using $amount then, otherwise it's always the full amount?
Comment #7
czigor CreditAttribution: czigor at Liip for FREITAG lab. AG commentedYes, it should, grrrr. Fixed it.
Comment #8
BerdirThanks, committed and pushed.