Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 5.5% on proxy.golang.org
Top 2.1% forks on proxy.golang.org

proxy.golang.org : github.com/blacklightcms/recurly

Package recurly provides a client for using the Recurly API. Construct a new Recurly client, then use the various services on the client to access different parts of the Recurly API. For example: See the examples section for more usage examples. Null types provide a way to differentiate between zero values and real values. For example, 0 is the zero value for ints; false for bools. Because those are valid values, null types allow us to differentiate between bool false as a valid value (we want to send to Recurly) and bool false as the zero value (we do not want to send to recurly) There are three null types: recurly.NullInt, recurly.NullBool, and recurly.NullTime If you have a pointer value, you can use New*Ptr() to return a new null type, where the value is valid only if the pointer is non-nil: Generally, checking that err != nil is sufficient to catch errors. However there are some circumstances where you may need to know more about the specific error. ClientError is returned for all 400-level responses with the exception of rate limit errors and failed transactions. Here is an example of working with client errors: TransactionFailedError is returned for any endpoint where a transaction was attempted and failed. It is highly recommended that you check for this error when using any endpoint that creates a transaction. ServerError operates the same way as ClientError, except it's returned for 500-level responses. It only contains the *http.Response. This allows you to differentiate retriable errors (e.g. 503 Service Unavailable) from bad requests (e.g. 400 Bad Request). RateLimitError is returned when the rate limit is exceeded. The Rate field contains information on the amount of requests and when the rate limit will reset. For more on errors, see the examples section below. When retrieving an individual item (e.g. account, invoice, subscription): if the item is not found, Recurly will return a 404 Not Found. Typically this will return a *recurly.ClientError. The only exception is for any function named 'Get': a nil item and nil error will be returned if the item is not found. All requests for resource collections support pagination. Pagination options are described in the recurly.PagerOptions struct and passed to the list methods directly. You can also let the library paginate for you and return all of the results at once: In some cases, you may want to paginate non-consecutively. For example, if you have paginated results being sent to a frontend, and the frontend is providing your app the next cursor. In that case you can obtain the next cursor like this (although it may be empty): If you have a cursor, you can provide *PagerOptions with it to start paginating the next result set:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/blacklightcms/recurly
Keywords: api-client, billing, golang, payment, recurly, recurring-payments, saas, subscription
License: MIT
Latest release: about 4 years ago
First release: almost 5 years ago
Namespace: github.com/blacklightcms
Stars: 40 on GitHub
Forks: 45 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 days ago

    Loading...
    Readme
    Loading...