Repository: Shopify/shopify_python_api

Issue:
Missing support for ApplicationCredit
I need to create ApplicationCredit objects, but there is no such resource in this SDK

Comments:

Patch:
diff --git a/CHANGELOG b/CHANGELOG
index 795baab..246a91b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 - Added support for Fulfillment.update_tracking ([#432](https://github.com/Shopify/shopify_python_api/pull/432))
 - Add FulfillmentEvent resource ([#454](https://github.com/Shopify/shopify_python_api/pull/454))
 - Fix for being unable to get the len() of a filter ([#456](https://github.com/Shopify/shopify_python_api/pull/456))
+- Add ApplicationCredit resource ([#457](https://github.com/Shopify/shopify_python_api/pull/457))
 
 == Version 8.2.0
 - [Feature] Add support for Dynamic API Versioning. When the library is initialized, it will now make a request to 
diff --git a/shopify/resources/__init__.py b/shopify/resources/__init__.py
index 803c535..1622073 100644
--- a/shopify/resources/__init__.py
+++ b/shopify/resources/__init__.py
@@ -17,6 +17,7 @@ from .rule import Rule
 from .tax_line import TaxLine
 from .script_tag import ScriptTag
 from .application_charge import ApplicationCharge
+from .application_credit import ApplicationCredit
 from .recurring_application_charge import RecurringApplicationCharge
 from .usage_charge import UsageCharge
 from .asset import Asset
diff --git a/shopify/resources/application_credit.py b/shopify/resources/application_credit.py
new file mode 100644
index 0000000..83b8de1
--- /dev/null
+++ b/shopify/resources/application_credit.py
@@ -0,0 +1,4 @@
+from ..base import ShopifyResource
+
+class ApplicationCredit(ShopifyResource):
+    pass


Test patch:
diff --git a/test/application_credit_test.py b/test/application_credit_test.py
new file mode 100644
index 0000000..630d023
--- /dev/null
+++ b/test/application_credit_test.py
@@ -0,0 +1,38 @@
+import shopify
+import json
+from test.test_helper import TestCase
+
+class ApplicationCreditTest(TestCase):
+    def test_get_application_credit(self):
+        self.fake('application_credits/445365009', method='GET', body=self.load_fixture('application_credit'), code=200)
+        application_credit = shopify.ApplicationCredit.find(445365009)
+        self.assertEqual('5.00', application_credit.amount)
+
+    def test_get_all_application_credits(self):
+        self.fake('application_credits', method='GET', body=self.load_fixture('application_credits'), code=200)
+        application_credits = shopify.ApplicationCredit.find()
+        self.assertEqual(1, len(application_credits))
+        self.assertEqual(445365009, application_credits[0].id)
+
+    def test_create_application_credit(self):
+        self.fake(
+            'application_credits',
+            method='POST',
+            body=self.load_fixture('application_credit'),
+            headers={'Content-type': 'application/json'},
+            code=201
+        )
+
+        application_credit = shopify.ApplicationCredit.create({
+            'description': 'application credit for refund',
+            'amount': 5.0
+        })
+
+        expected_body = {
+            "application_credit": {
+                "description": "application credit for refund",
+                "amount": 5.0
+            }
+        }
+
+        self.assertEqual(expected_body, json.loads(self.http.request.data.decode("utf-8")))
diff --git a/test/fixtures/application_credit.json b/test/fixtures/application_credit.json
new file mode 100644
index 0000000..4d6c3de
--- /dev/null
+++ b/test/fixtures/application_credit.json
@@ -0,0 +1,8 @@
+{
+  "application_credit": {
+    "id": 445365009,
+    "amount": "5.00",
+    "description": "credit for application refund",
+    "test": null
+  }
+}
diff --git a/test/fixtures/application_credits.json b/test/fixtures/application_credits.json
new file mode 100644
index 0000000..b487a52
--- /dev/null
+++ b/test/fixtures/application_credits.json
@@ -0,0 +1,10 @@
+{
+  "application_credits": [
+    {
+      "id": 445365009,
+      "amount": "5.00",
+      "description": "credit for application refund",
+      "test": null
+    }
+  ]
+}
diff --git a/test/fulfillment_event_test.py b/test/fulfillment_event_test.py
index 1ba9a73..c58cc6e 100644
--- a/test/fulfillment_event_test.py
+++ b/test/fulfillment_event_test.py
@@ -1,6 +1,5 @@
 import shopify
 from test.test_helper import TestCase
-from pyactiveresource.activeresource import ActiveResource
 
 class FulFillmentEventTest(TestCase):
     def test_get_fulfillment_event(self):
@@ -21,4 +20,3 @@ class FulFillmentEventTest(TestCase):
             fulfillment_event = shopify.FulfillmentEvent.find(12584341209251, order_id='2776493818019', fulfillment_id='2608403447971')
             fulfillment_event.status = incorrect_status
             fulfillment_event.save()
-