README.md in docdata-0.1.7 vs README.md in docdata-0.1.8
- old
+ new
@@ -80,11 +80,11 @@
If you use `GIROPAY`, `SEPA` and `AFTERPAY` this is the case. (Maybe also in other payment methods, please let me know!)
## Configuration in Rails application
-Example usage. Use appropriate settings in `development.rb`, `production.rb` etc.
+Example usage. Use appropriate settings in `development.rb`, `production.rb` etc.
```ruby
config.docdata.username = "my_app_com"
config.docdata.password = "HeJ35N"
config.docdata.return_url = "http://localhost:3000/docdata" # gets appended by '/success', '/error', '/pending' depending on response
config.docdata.test_mode = true
@@ -241,19 +241,34 @@
`Docdata::Payment.find("PAYMENTORDERKEYHERE")` returns either a `Docdata::Payment` object or a 'not found' error.
#### Check the status of a payment
`payment = Docdata::Payment.find("KEY"); payment.status => <Payment::Status>`
-
#### Cancel a payment
To cancel an existing Payment, you can do one of the following:
`payment = Docdata::Payment.find("KEY"); payment.cancel` or `Docdata::Payment.cancel("KEY")`
+#### Make refunds
+You can make a refund for a payment. In fact: each payment can have multiple refunds. Each refund has an amount (`Integer` type - cents) and as long as the refund amount doesn't exceed the total Payment amount, you can make as many partial refunds as you whish. Keep in mind that Docdata will charge you for each refund.
+```ruby
+payment = Docdata::Payment.find("KEY") # find the payment
+payment.refund(500) # => true or false
+```
+
+
+## Test credentials
+In order tot test this gem, you'll need to set the following environment variables to make it work. With other words: you can't test this gem without valid test credentials and you can't use my test credentials. Tip: set the environment variables in your .bash_profile file.
+```
+ENV["DOCDATA_PASSWORD"] = "your_password"
+ENV["DOCDATA_USERNAME"] = "your_docdata_username"
+ENV["DOCDATA_RETURN_URL"] = "http://return-url-here"
+```
+
+
## Contributing
Want to contribute? Great!
-
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Make changes, document them and add tests (rspec)
4. Run the entire test suite and make sure all tests pass (`rake`)