diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index f2eea12..eeefdbb 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -111,6 +111,8 @@ en:
plan_help: Create a pricing plan to subscribe customers to this product.
description: Description
description_help: This describes your subscription product.
+ repurchaseable: Repurchaseable?
+ repurchase_help: Allow product and associated plans to be purchased multiple times
active: Active
active_help: Toggle this off until your product is ready for consumers.
created_at: Created
diff --git a/spec/requests/admin/products_controller_spec.rb b/spec/requests/admin/products_controller_spec.rb
index 45e2cd5..ec7aec6 100644
--- a/spec/requests/admin/products_controller_spec.rb
+++ b/spec/requests/admin/products_controller_spec.rb
@@ -81,9 +81,15 @@ module DiscourseSubscriptions
post "/s/admin/products.json", params: { statement_descriptor: '' }
end
- it 'has a description' do
- ::Stripe::Product.expects(:create).with(has_entry(metadata: { description: 'Oi, I think he just said bless be all the bignoses!' }))
- post "/s/admin/products.json", params: { metadata: { description: 'Oi, I think he just said bless be all the bignoses!' } }
+ it 'has metadata' do
+ ::Stripe::Product.expects(:create).with(has_entry(metadata: { description: 'Oi, I think he just said bless be all the bignoses!', repurchaseable: 'false' }))
+
+ post "/s/admin/products.json", params: {
+ metadata: {
+ description: 'Oi, I think he just said bless be all the bignoses!',
+ repurchaseable: 'false'
+ }
+ }
end
end
diff --git a/spec/requests/subscribe_controller_spec.rb b/spec/requests/subscribe_controller_spec.rb
index 0ad4287..f90cfe8 100644
--- a/spec/requests/subscribe_controller_spec.rb
+++ b/spec/requests/subscribe_controller_spec.rb
@@ -12,7 +12,8 @@ module DiscourseSubscriptions
id: "prodct_23456",
name: "Very Special Product",
metadata: {
- description: "Many people listened to my phone call with the Ukrainian President while it was being made"
+ description: "Many people listened to my phone call with the Ukrainian President while it was being made",
+ repurchaseable: false
},
otherstuff: true,
}
@@ -48,7 +49,8 @@ module DiscourseSubscriptions
"id" => "prodct_23456",
"name" => "Very Special Product",
"description" => PrettyText.cook("Many people listened to my phone call with the Ukrainian President while it was being made"),
- "subscribed" => false
+ "subscribed" => false,
+ "repurchaseable" => false,
}])
end
@@ -82,7 +84,8 @@ module DiscourseSubscriptions
"id" => "prodct_23456",
"name" => "Very Special Product",
"description" => PrettyText.cook("Many people listened to my phone call with the Ukrainian President while it was being made"),
- "subscribed" => false
+ "subscribed" => false,
+ "repurchaseable" => false
},
"plans" => [
{ "currency" => "aud", "id" => "plan_id123", "recurring" => { "interval" => "year" }, "unit_amount" => 1220 },