Repository: QuickPay/quickpay-python-client

Issue:
QuickPay-Callback-Url
It is not possible to change the header QuickPay-Callback-Url using this client.

This would be useful when it is not accepted in the body, e.g. 
[POST /subscriptions/{id}/recurring](https://learn.quickpay.net/tech-talk/api/services/#POST-subscriptions--id-recurring---format-)

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..3ae5eb0
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Change Log
+All notable changes to this project will be documented in this file.
+This project adheres to [Semantic Versioning](http://semver.org/).
+
+## [UNRELEASED] - 0000-00-00
+### Added
+- Support callback_url in API requests (#10)
\ No newline at end of file
diff --git a/quickpay_api_client/api.py b/quickpay_api_client/api.py
index 72ef0f1..0295f02 100644
--- a/quickpay_api_client/api.py
+++ b/quickpay_api_client/api.py
@@ -50,6 +50,10 @@ class QPApi(object):
             "User-Agent": "quickpay-python-client, v%s" % quickpay_api_client.__version__
         }
 
+        callback_url = kwargs.pop("callback_url", None)
+        if callback_url:
+            headers["Quickpay-Callback-Url"] = callback_url
+
         if self.secret:
             headers["Authorization"
                     ] = "Basic {0}".format(_base64_encode(self.secret))


Test patch:
diff --git a/quickpay_api_client/tests/api_tests.py b/quickpay_api_client/tests/api_tests.py
index 8133e8f..066235b 100644
--- a/quickpay_api_client/tests/api_tests.py
+++ b/quickpay_api_client/tests/api_tests.py
@@ -43,6 +43,15 @@ class TestApi(object):
         assert_equal(req_headers['Accept-Version'], 'v10')
         assert req_headers['User-Agent']
 
+    @responses.activate
+    def test_callback_url_headers(self):
+        self.setup_request()
+        callback_url = "https://foo.bar"
+        res = self.api.perform("get", "/test", callback_url=callback_url)
+
+        req_headers = responses.calls[0].request.headers
+        assert_equal(req_headers['Quickpay-Callback-Url'], callback_url)
+
     @responses.activate
     def test_perform_when_raw(self):
         self.setup_request()