| |
827 |
827 |
response_code |
| |
828 |
828 |
response_reason_code |
| |
829 |
829 |
response_reason_text |
| |
830 |
830 |
auth_code |
| |
831 |
831 |
avs_code |
| |
832 |
832 |
amount |
| |
833 |
833 |
} { |
| |
834 |
834 |
Write the results of the current operation to the database. If it fails, |
| |
835 |
835 |
log it but don't let the user know about it. |
| |
836 |
836 |
|
| |
837 |
837 |
@author Bart Teeuwisse <bart.teeuwisse@thecodemill.biz> |
| |
838 |
838 |
} { |
| |
839 |
839 |
set authorize_url [ad_parameter authorize_url \ |
| |
840 |
840 |
-default [ad_parameter \ |
| |
841 |
841 |
-package_id [apm_package_id_from_key authorize-gateway] \ |
| |
842 |
842 |
authorize_url]] |
| |
843 |
843 |
if {[string length $response] > 400} { |
| |
844 |
844 |
ns_log Notice "Response from $authorize_url exceeds database field length. Trimming response '$response' to 400 characters." |
| |
845 |
845 |
set response [string range $response 0 399] |
| |
846 |
846 |
} |
| |
847 |
|
if {[string length $response] > 100} { |
| |
|
847 |
if {[string length $response_reason_text] > 100} { |
| |
848 |
848 |
ns_log Notice "Response reason text from $authorize_url exceeds database field length. Trimming response reason text '$response_reason_text' to 100 characters." |
| |
849 |
849 |
set response_reason_text [string range $response_reason_text 0 99] |
| |
850 |
850 |
} |
| |
851 |
851 |
if [catch {db_dml do-insert {}} errmsg] { |
| |
852 |
852 |
ns_log Error "Wasn't able to do insert into authorize_gateway_result_log for transaction_id $transaction_id; error was $errmsg" |
| |
853 |
853 |
} |
| |
854 |
854 |
} |