-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subscriptions, Subscription plans and Products API (#151)
- Loading branch information
1 parent
b3eb2c6
commit d355a65
Showing
12 changed files
with
883 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package paypal | ||
|
||
type SubscriptionPlanStatus string | ||
|
||
const ( | ||
SubscriptionPlanStatusCreated SubscriptionPlanStatus = "CREATED" | ||
SubscriptionPlanStatusInactive SubscriptionPlanStatus = "INACTIVE" | ||
SubscriptionPlanStatusActive SubscriptionPlanStatus = "ACTIVE" | ||
) | ||
|
||
type BillingPlanStatus string | ||
|
||
const ( | ||
BillingPlanStatusActive BillingPlanStatus = "ACTIVE" | ||
) | ||
|
||
type IntervalUnit string | ||
|
||
const ( | ||
IntervalUnitDay IntervalUnit = "DAY" | ||
IntervalUnitWeek IntervalUnit = "WEEK" | ||
IntervalUnitMonth IntervalUnit = "MONTH" | ||
IntervalUnitYear IntervalUnit = "YEAR" | ||
) | ||
|
||
type TenureType string | ||
|
||
const ( | ||
TenureTypeRegular TenureType = "REGULAR" | ||
TenureTypeTrial TenureType = "TRIAL" | ||
) | ||
|
||
type SetupFeeFailureAction string | ||
|
||
const ( | ||
SetupFeeFailureActionContinue SetupFeeFailureAction = "CONTINUE" | ||
SetupFeeFailureActionCancel SetupFeeFailureAction = "CANCEL" | ||
) | ||
|
||
type ShippingPreference string | ||
|
||
const ( | ||
ShippingPreferenceGetFromFile ShippingPreference = "GET_FROM_FILE" | ||
ShippingPreferenceNoShipping ShippingPreference = "NO_SHIPPING" | ||
ShippingPreferenceSetProvidedAddress ShippingPreference = "SET_PROVIDED_ADDRESS" | ||
) | ||
|
||
type UserAction string | ||
|
||
const ( | ||
UserActionContinue UserAction = "CONTINUE" | ||
UserActionSubscribeNow UserAction = "SUBSCRIBE_NOW" | ||
) | ||
|
||
type SubscriptionStatus string | ||
|
||
const ( | ||
SubscriptionStatusApprovalPending SubscriptionStatus = "APPROVAL_PENDING" | ||
SubscriptionStatusApproved SubscriptionStatus = "APPROVED" | ||
SubscriptionStatusActive SubscriptionStatus = "ACTIVE" | ||
SubscriptionStatusSuspended SubscriptionStatus = "SUSPENDED" | ||
SubscriptionStatusCancelled SubscriptionStatus = "CANCELLED" | ||
SubscriptionStatusExpired SubscriptionStatus = "EXPIRED" | ||
) | ||
|
||
//Doc: https://developer.paypal.com/docs/api/subscriptions/v1/#definition-transaction | ||
type SubscriptionTransactionStatus string | ||
const ( | ||
SubscriptionCaptureStatusCompleted SubscriptionTransactionStatus = "COMPLETED" | ||
SubscriptionCaptureStatusDeclined SubscriptionTransactionStatus = "DECLINED" | ||
SubscriptionCaptureStatusPartiallyRefunded SubscriptionTransactionStatus = "PARTIALLY_REFUNDED" | ||
SubscriptionCaptureStatusPending SubscriptionTransactionStatus = "PENDING" | ||
SubscriptionCaptureStatusRefunded SubscriptionTransactionStatus = "REFUNDED" | ||
) | ||
|
||
type CaptureType string | ||
const ( | ||
CaptureTypeOutstandingBalance CaptureType = "OUTSTANDING_BALANCE" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module github.com/plutov/paypal/v3 | ||
|
||
go 1.12 | ||
|
||
require github.com/stretchr/testify v1.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= | ||
github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
Oops, something went wrong.