Skip to content

Commit

Permalink
Fixes response from CreateSubscription (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
rami-dabain authored Jun 1, 2020
1 parent 905bf2e commit a0d03ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type (
SubscriptionBase
SubscriptionDetails
BillingInfo BillingInfo `json:"billing_info,omitempty"` // not found in documentation
SharedResponse
}

SubscriptionCaptureResponse struct {
Expand Down Expand Up @@ -85,9 +86,10 @@ func (self *Subscription) GetUpdatePatch() []Patch {
// CreateSubscriptionPlan creates a subscriptionPlan
// Doc: https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_create
// Endpoint: POST /v1/billing/subscriptions
func (c *Client) CreateSubscription(newSubscription SubscriptionBase) (*Subscription, error) {
func (c *Client) CreateSubscription(newSubscription SubscriptionBase) (*SubscriptionDetailResp, error) {
req, err := c.NewRequest(http.MethodPost, fmt.Sprintf("%s%s", c.APIBase, "/v1/billing/subscriptions"), newSubscription)
response := &Subscription{}
req.Header.Add("Prefer", "return=representation")
response := &SubscriptionDetailResp{}
if err != nil {
return response, err
}
Expand Down

0 comments on commit a0d03ec

Please sign in to comment.