I am self-hosting v4.4.4. Even though I no longer have a PayPal Express gateway set up (in the settings, I archived the one I had) an online version of a client’s invoice still shows the Pay Now button. Clicking it shows:
Paypal_express: The MAC is invalid.
Is it possible to hide that button altogether? I tried restarting my Apache web server and opening a fresh browser but the button is still there.
I’m not sure, I can’t replicate the problem.
In my test archiving the gateway also removed the ‘Pay Now’ button.
That’s odd. I tested by creating a fresh invoice, now that my gateway is archived–same result.
In case it matter, I am testing via the following path:
- Log in as myself.
- Create invoice.
- Save invoice.
- View invoice.
- Click View in Portal link under the client’s email address.
This opens a new tab with a PDF rendering of the invoice. However, I also copy that URL and use it in a new, Incognito Chrome window, and I still get the Pay Now button.
Is there a place in the settings that I am neglecting to change? The only place I know that could affect this is Advanced Settings | API Tokens, of which I list as having none (anymore).
Thanks, I think that explains it.
You need to archive the gateway on Settings > Online Payments.
Hmm, I think that’s already empty: Craig’s Settings | Online Payment
Thanks, I think the problem is related to the value for APP_KEY in the .env file.
Have you moved servers or changed the value?
You may be able to fix it by setting deleted_at to now() in the account_gateways table.
I may have re-created the key at some point. Here’s what I have in that table:
mysql> select public_id, deleted_at from account_gateways;
| public_id | deleted_at |
| 1 | 2016-04-14 03:43:09 |
| 2 | 2016-04-14 03:44:18 |
| 3 | 2017-09-26 04:08:55 |
| 4 | NULL |
4 rows in set (0.00 sec)
Should I just do the update below?
update account_gateways set delete_at = now() where public_id = 4;
Yes, that looks correct.
The key is used to encrypt sensitive data (ie, your payment gateway credentials and bank account number), if the value is changed the app will fail to decrypt the data.
If you need to change the key you can run
php artisan ninja:update-key, this sets a new key and re-encrypts the existing data.
That worked. Thanks so much for the support and for the added info!
Glad to hear it’s sorted!