show product and plan nickname in admin
This commit is contained in:
parent
7340bf5bc5
commit
3e4fd76891
|
@ -9,7 +9,7 @@ module DiscoursePatrons
|
|||
|
||||
def index
|
||||
begin
|
||||
subscriptions = ::Stripe::Subscription.list
|
||||
subscriptions = ::Stripe::Subscription.list(expand: ['data.plan.product'])
|
||||
|
||||
render_json_dump subscriptions
|
||||
rescue ::Stripe::InvalidRequestError => e
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<tr>
|
||||
<th>{{i18n 'discourse_patrons.admin.subscriptions.subscription.user'}}</th>
|
||||
<th>{{i18n 'discourse_patrons.admin.subscriptions.subscription.customer'}}</th>
|
||||
<th>{{i18n 'discourse_patrons.admin.subscriptions.subscription.product'}}</th>
|
||||
<th>{{i18n 'discourse_patrons.admin.subscriptions.subscription.plan'}}</th>
|
||||
<th>{{i18n 'discourse_patrons.admin.subscriptions.subscription.status'}}</th>
|
||||
<th class="td-right">{{i18n 'discourse_patrons.admin.subscriptions.subscription.created_at'}}</th>
|
||||
|
@ -20,7 +21,8 @@
|
|||
{{/if}}
|
||||
</td>
|
||||
<td>{{subscription.customer}}</td>
|
||||
<td>{{subscription.plan.id}}</td>
|
||||
<td>{{subscription.plan.product.name}}</td>
|
||||
<td>{{subscription.plan.nickname}}</td>
|
||||
<td>{{subscription.status}}</td>
|
||||
<td class="td-right">{{format-unix-date subscription.created}}</td>
|
||||
<td class="td-right">
|
||||
|
|
|
@ -126,6 +126,7 @@ en:
|
|||
user: User
|
||||
subscription_id: Subscription ID
|
||||
customer: Customer
|
||||
product: Product
|
||||
plan: Plan
|
||||
status: Status
|
||||
created_at: Created
|
||||
|
|
|
@ -27,8 +27,8 @@ module DiscoursePatrons
|
|||
before { sign_in(admin) }
|
||||
|
||||
describe "index" do
|
||||
it "gets the subscriptions" do
|
||||
::Stripe::Subscription.expects(:list)
|
||||
it "gets the subscriptions and products" do
|
||||
::Stripe::Subscription.expects(:list).with(expand: ['data.plan.product'])
|
||||
get "/patrons/admin/subscriptions.json"
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue