Documentation
¶
Index ¶
- Constants
- type Client
- func (client *Client) AddHeaders(headers map[string]string)
- func (client *Client) SetBaseURL(baseURL string)
- func (client *Client) SetCallbackURL(callbackURL string)
- func (client *Client) SetEnvironment(env constants.Environment)
- func (client *Client) SetTimeout(timeout int16)
- func (client *Client) SetUserAgent(userAgent string)
Constants ¶
const ( STAGING_ENVIRONMENT = constants.STAGING_ENVIRONMENT PRODUCTION_ENVIRONMENT = constants.PRODUCTION_ENVIRONMENT CHANNEL_WEB = constants.CHANNEL_WEB CHANNEL_WAP = constants.CHANNEL_WAP CURRENCY_INR = constants.CURRENCY_INR REQUEST_TYPE_PAYMENT = constants.REQUEST_TYPE_PAYMENT DEFAULT_WEBSITE = constants.DEFAULT_WEBSITE )
Common constants re-exported for callers.
const SDKName = "paytm-go"
SDKName is the name of this SDK.
const SDKVersion = "1.0.0"
SDKVersion is the current package version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client provides helper methods to call Paytm Payment Gateway APIs.
- merchant/ detail models and builders (PaymentDetail, RefundDetail, …)
- pg/ process APIs, request signing, checksum, errors
- constants/ URLs, headers, field names
func NewClient ¶
func NewClient(env constants.Environment, mid, merchantKey, clientID, website string) *Client
NewClient creates a Paytm PG client (instance-based MerchantProperties).
env should be Staging or Production. mid, merchantKey, clientID, and website are required merchant credentials from the Paytm dashboard.
func (*Client) AddHeaders ¶
AddHeaders adds additional headers to all subsequent requests.
func (*Client) SetBaseURL ¶
SetBaseURL overrides the API host (useful in tests).
func (*Client) SetCallbackURL ¶
SetCallbackURL sets the default callback URL for CreateTxnToken.
func (*Client) SetEnvironment ¶
func (client *Client) SetEnvironment(env constants.Environment)
SetEnvironment switches between staging and production hosts.
func (*Client) SetTimeout ¶
SetTimeout sets the HTTP timeout in seconds.
func (*Client) SetUserAgent ¶
SetUserAgent sets a custom User-Agent prefix.