func (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opt *ListOptions) ([]*MarketplacePurchase, *Response, error) {
	uri := "user/marketplace_purchases"
	if s.Stubbed {
		uri = "user/marketplace_purchases/stubbed"
	}
	u, err := addOptions(uri, opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	var purchases []*MarketplacePurchase
	resp, err := s.client.Do(ctx, req, &purchases)
	if err != nil {
		return nil, resp, err
	}
	return purchases, resp, nil
}
ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user.

GitHub API docs: https://developer.github.com/v3/apps/marketplace/#get-a-users-marketplace-purchases
package github
import (
	"context"
	"fmt"
)
type MarketplaceService struct {
	client *Client
	Stubbed bool
}
type MarketplacePlan struct {
	URL                 *string   `json:"url,omitempty"`
	AccountsURL         *string   `json:"accounts_url,omitempty"`
	ID                  *int64    `json:"id,omitempty"`
	Name                *string   `json:"name,omitempty"`
	Description         *string   `json:"description,omitempty"`
	MonthlyPriceInCents *int      `json:"monthly_price_in_cents,omitempty"`
	YearlyPriceInCents  *int      `json:"yearly_price_in_cents,omitempty"`
	PriceModel          *string   `json:"price_model,omitempty"`
	UnitName            *string   `json:"unit_name,omitempty"`
	Bullets             *[]string `json:"bullets,omitempty"`
}
type MarketplacePurchase struct {
	BillingCycle    *string                 `json:"billing_cycle,omitempty"`
	NextBillingDate *string                 `json:"next_billing_date,omitempty"`
	UnitCount       *int                    `json:"unit_count,omitempty"`
	Plan            *MarketplacePlan        `json:"plan,omitempty"`
	Account         *MarketplacePlanAccount `json:"account,omitempty"`
}
type MarketplacePlanAccount struct {
	URL                      *string              `json:"url,omitempty"`
	Type                     *string              `json:"type,omitempty"`
	ID                       *int64               `json:"id,omitempty"`
	Login                    *string              `json:"login,omitempty"`
	Email                    *string              `json:"email,omitempty"`
	OrganizationBillingEmail *string              `json:"organization_billing_email,omitempty"`
	MarketplacePurchase      *MarketplacePurchase `json:"marketplace_purchase,omitempty"`
}
func (s *MarketplaceService) ListPlans(ctx context.Context, opt *ListOptions) ([]*MarketplacePlan, *Response, error) {
	uri := s.marketplaceURI("plans")
	u, err := addOptions(uri, opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	var plans []*MarketplacePlan
	resp, err := s.client.Do(ctx, req, &plans)
	if err != nil {
		return nil, resp, err
	}
	return plans, resp, nil
}
func (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opt *ListOptions) ([]*MarketplacePlanAccount, *Response, error) {
	uri := s.marketplaceURI(fmt.Sprintf("plans/%v/accounts", planID))
	u, err := addOptions(uri, opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	var accounts []*MarketplacePlanAccount
	resp, err := s.client.Do(ctx, req, &accounts)
	if err != nil {
		return nil, resp, err
	}
	return accounts, resp, nil
}
func (s *MarketplaceService) ListPlanAccountsForAccount(ctx context.Context, accountID int64, opt *ListOptions) ([]*MarketplacePlanAccount, *Response, error) {
	uri := s.marketplaceURI(fmt.Sprintf("accounts/%v", accountID))
	u, err := addOptions(uri, opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	var accounts []*MarketplacePlanAccount
	resp, err := s.client.Do(ctx, req, &accounts)
	if err != nil {
		return nil, resp, err
	}
	return accounts, resp, nil
}