Home Forums Support Importing Payments

This topic contains 3 replies, has 2 voices, and was last updated by  [email protected] 5 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20992

    [email protected]
    Participant

    Good Afternoon, new-be here, but loving the system so far. I’m using version 4.5.13 and haven’t but do plan to buy a white label for self-hosted. Working on importing all of our activity from our previous system that was built internally.

    I have all of the invoice imported but don’t see a way to import payments. I tried directly adding them to the database, but when I try to open one of the payments I inserted into the database on the UI I get a “Whoops, s like something went wrong.” error. (I’ll paste in the last two entries to the error log below). I’ve doubled and tripled checked that the data is the same I entered on the UI, so I’m guessing there is some sort of relationship or history data I don’t correct.

    I’ve tried looking at the API documentation, but I am not able to figure out how to apply payments to invoices already in the system.

    Any help would be greatly appreciated. Thanks!

    Error Log:
    [2019-06-16 20:34:20] production.ERROR: ***ErrorException*** [0] : /var/www/tools/ninja/app/Models/Payment.php [Line 389] => Trying to get property ‘json_backup’ of non-object {“context”:”PHP”,”user_id”:1,”account_id”:1,”user_name”:”Curtis Fuller”,”method”:”GET”,”user_agent”:”Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36″,”locale”:”en”,”ip”:”142.197.205.26″,”count”:4,”is_console”:”no”,”is_api”:”no”,”db_server”:”mysql”,”url”:”payments/2624/edit”} []
    [2019-06-16 20:39:14] production.ERROR: ***ErrorException*** [0] : /var/www/tools/ninja/app/Models/Payment.php [Line 389] => Trying to get property ‘json_backup’ of non-object {“context”:”PHP”,”user_id”:1,”account_id”:1,”user_name”:”Curtis Fuller”,”method”:”GET”,”user_agent”:”Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36″,”locale”:”en”,”ip”:”142.197.205.26″,”count”:5,”is_console”:”no”,”is_api”:”no”,”db_server”:”mysql”,”url”:”payments/2535/edit”} []

    #20993

    Titanfail
    Participant

    If you’re entering the values as you would in the UI, that would be the most likely cause of the problem. The database uses numerical identifiers for things like id, invoice_id, client_id, payment_type_id, etc., all of which are mapped out in their own tables. So entering “Paypal” into the database for payment type would throw it off, as it’s expecting to see “14”, which it will then look in the payments_type table to see that it’s “Paypal”, with a gateway_type_id of “Paypal”

    #20994

    [email protected]
    Participant

    Thank you.

    I was careful about checking all of that. I looked up the Client ID by name to find the ID, found the invoice number based on the id in the invoice table, etc. etc. Your example of payment type, I the ID for check for the payment type in the payment_type_id (16).

    To demonstrate I’m going to paste two JSON versions of database records below. The first is one that I inserted, and the second is one that I created in the web UI.

    If you have any other ideas, please let know. Thank you!

    Database Insert Record:

    [
    {"id":"6","invoice_id":"8","account_id":"1","client_id":"63","contact_id":"null","invitation_id":"null","user_id":"1","account_gateway_id":"null","payment_type_id":"16","created_at":"05/27/2014 00:00:00","updated_at":"05/27/2014 00:00:00","deleted_at":"null","is_deleted":"0","amount":"2351.60","payment_date":"05/27/2014 00:00:00","transaction_reference":"1261","payer_id":"null","public_id":"6","refunded":"0.00","payment_status_id":"4","routing_number":"null","last4":"null","expiration":"null","gateway_error":"null","email":"null","payment_method_id":"null","bank_name":"null","ip":"null","credit_ids":"null","private_notes":"","exchange_rate":"1.0000","exchange_currency_id":"0"}]

    Record From using the Web UI:

    
    [{"id":"1","invoice_id":"2","account_id":"1","client_id":"1","contact_id":"null","invitation_id":"null","user_id":"1","account_gateway_id":"null","payment_type_id":"16","created_at":"06/15/2019 03:41:19","updated_at":"06/15/2019 03:41:19","deleted_at":"null","is_deleted":"0","amount":"2933.33","payment_date":"06/14/2019 00:00:00","transaction_reference":"1234","payer_id":"null","public_id":"1","refunded":"0.00","payment_status_id":"4","routing_number":"null","last4":"null","expiration":"null","gateway_error":"null","email":"null","payment_method_id":"null","bank_name":"null","ip":"null","credit_ids":"null","private_notes":"","exchange_rate":"1.0000","exchange_currency_id":"0"}]
    #21005

    [email protected]
    Participant

    Alternatively, is there a way of recording a payment through an API call? I could run a script to do multiple API calls to record the 2,800 payments I want to import. 🙂 However, I could not decipher the instructions from the API documentation. I tend to need samples to work from.

    Thanks.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Posted in: