The original payment may not be valid because its credit card may be expired. Stripe gives this as a valid scenario returning a success and we should do too. When creating the credit payment we end up validating all sources in a chain as follows. ``` Payment being persisted -> source payment -> original credit card. ``` The source payment was valid when created (It would not be persisted otherwise) but its source card may now be expired, and that's legit. There was also an issue with the `#invalidate_old_payments` callback. It was causing the original payment to be validated again and thus the credit payment failed to be persisted due to the original credit card being expired. Switching this callback to use `#update_column` skips validations and so we don't validate the source payment. We only care about the state there, so it should be fine.
Open Food Network
The Open Food Network is an online marketplace for local food. It enables a network of independent online food stores that connects farmers and food hubs (including co-ops, online farmers markets, independent food businesses, etc) with individuals and local businesses. It gives farmers and food hubs an easier and fairer way to distribute their food.
Supported by the Open Food Foundation and a network of global affiliates, we are proudly open source and not-for-profit - we're trying to seriously disrupt the concentration of power in global agri-food systems, and we need as many smart people working together on this as possible.
We're part of global movement - get involved!
- Join the conversation on Slack. Make sure you introduce yourself in the #general channel.
- Head to https://openfoodnetwork.org for more information about the global OFN project.
- Check out the User Guide for a list of features and tutorials.
- Join our discussion forum.
Contributing
If you are interested in contributing to the OFN in any capacity, please introduce yourself on Slack, and have a look through our Contributor Guide.
Our GETTING_STARTED and CONTRIBUTING guides are the best place to start for developers looking to set up a development environment and make contributions to the codebase.
Provisioning
If you're interested in provisioning a server, see ofn-install for the project's Ansible playbooks.
We also have a Super Admin Guide to help with configuration of new servers.
Testing
We use BrowserStack as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
Licence
Copyright (c) 2012 - 2020 Open Food Foundation, released under the AGPL licence.
