market

package module
v0.0.0-...-d505049 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2018 License: MIT Imports: 14 Imported by: 0

README

Paypal Marketplace GoDoc

Marketplace is still in development, it is not ready for production use.

Usage

All functions and types follow the REST API closely.

c := market.NewClient(ctx, clientID, secret, market.Live)
params := &partner.CreatePartnerReferralParams{
	// ...
}
_, err := c.CreatePartnerReferral(ctx, params)

Contributers

Pull requests are welcome.

  • Code must have been run through go fmt.

Instructions on how to use Github pull requests can be found here

Documentation

Index

Constants

View Source
const (
	Sandbox = "https://api.sandbox.paypal.com"
	Live    = "https://api.paypal.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BadResponse

type BadResponse struct {
	Status int
	Body   string
}

func (*BadResponse) Error

func (b *BadResponse) Error() string

type Client

type Client struct {
	BNCode string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, clientID, clientSecret, apiBase string) *Client

NewClient creates a new Paypal marketplace client. clientID and clientSecret are provided by Paypal. apiBase should be either market.Sandbox or market.Live

func (*Client) CancelOrder

func (c *Client) CancelOrder(ctx context.Context, orderID string) error

func (*Client) CreateOrder

func (c *Client) CreateOrder(ctx context.Context, params *orders.CreateOrderParams) (*orders.CreateOrderResponse, error)

func (*Client) CreatePartnerReferral

CreatePartnerReferral is used to connect a user's Paypal account with your platform. It is used in both the connected and the managed paths.

func (*Client) FinalizeDisbursement

func (c *Client) FinalizeDisbursement(ctx context.Context, responsePreference orders.ResponsePreferenceData, transactionID string) (*orders.FinalizeDisbursementResponse, error)

func (*Client) GetOrderDetails

func (c *Client) GetOrderDetails(ctx context.Context, orderID string) (*orders.CreateOrderResponse, error)

func (*Client) GetPartnerReferral

func (c *Client) GetPartnerReferral(ctx context.Context, partnerReferralID string) (*merchant.GetPartnerReferralResponse, error)

func (*Client) PayOrder

func (c *Client) PayOrder(ctx context.Context, orderID string, disbursementMode orders.DisbursementModeData) (*orders.PayOrderResponse, error)

func (*Client) RequestRefund

func (c *Client) RequestRefund(ctx context.Context, captureID, clientID, payerID string, params *orders.RequestRefundParams) (*orders.RequestRefundResponse, error)

func (*Client) SaveTransactionContext

func (c *Client) SaveTransactionContext(ctx context.Context, merchantID, trackingID string, additionalData []orders.KeyValuePair) error

func (*Client) ShowAccountTracking

func (c *Client) ShowAccountTracking(ctx context.Context, partnerID, trackingID string) (*merchant.MerchantDetailsData, error)

func (*Client) ShowMerchantStatus

func (c *Client) ShowMerchantStatus(ctx context.Context, partnerID, merchantID string, fields []string) (*merchant.MerchantDetailsData, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL