diff --git a/lib/recurly/external_subscription.rb b/lib/recurly/external_subscription.rb
index 545e44c2d..58320d81f 100644
--- a/lib/recurly/external_subscription.rb
+++ b/lib/recurly/external_subscription.rb
@@ -30,6 +30,8 @@ class ExternalSubscription < Resource
trial_ends_at
canceled_at
in_grace_period
+ imported
+ test
)
# We do not expose PUT or POST in the v2 API.
@@ -47,5 +49,9 @@ def get_external_payment_phase(external_payment_phase_uuid)
rescue Recurly::API::UnprocessableEntity => e
raise Invalid, e.message
end
+
+ def self.find_by_external_id(external_id)
+ self.find("external-id-#{external_id}")
+ end
end
end
diff --git a/spec/fixtures/accounts/external_subscriptions/show-200.xml b/spec/fixtures/accounts/external_subscriptions/show-200.xml
index d94077b62..759ff1050 100644
--- a/spec/fixtures/accounts/external_subscriptions/show-200.xml
+++ b/spec/fixtures/accounts/external_subscriptions/show-200.xml
@@ -20,6 +20,8 @@ Content-Type: application/xml; charset=utf-8
false
+ false
+ false
2022-11-04T20:33:29Z
2022-11-04T20:33:29Z
diff --git a/spec/fixtures/external_subscriptions/show-200.xml b/spec/fixtures/external_subscriptions/show-200.xml
index cae232833..6ede12597 100644
--- a/spec/fixtures/external_subscriptions/show-200.xml
+++ b/spec/fixtures/external_subscriptions/show-200.xml
@@ -25,6 +25,8 @@ Content-Type: application/xml; charset=utf-8
false
+ false
+ false
2023-02-08T23:02:30Z
2023-02-08T23:02:30Z
diff --git a/spec/recurly/external_subscription_spec.rb b/spec/recurly/external_subscription_spec.rb
index 24ace4c4e..ffd9703ac 100644
--- a/spec/recurly/external_subscription_spec.rb
+++ b/spec/recurly/external_subscription_spec.rb
@@ -24,7 +24,9 @@
trial_started_at: "2022-11-07 17:08:18",
trial_ends_at: "2022-11-14 17:08:18",
canceled_at: "2022-11-15 17:08:18",
- in_grace_period: false
+ in_grace_period: false,
+ imported: false,
+ test: false
)
}
@@ -64,10 +66,12 @@
reference_code 1\
2019-08-24T14:15:22Z\
\
+false\
false\
2022-11-07 17:08:18\
1\
active\
+false\
2022-11-14 17:08:18\
2022-11-07 17:08:18\
2022-11-07 17:08:18\