Documentation ¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int64(i int64) *int64
- func String(s string) *string
- type Cashfree
- type Eligibility
- func (s *Eligibility) GetAllOffers(ctx context.Context, xAPIVersion string, ...) (*operations.GetEligibilityOfferResponse, error)
- func (s *Eligibility) GetCardlessEMI(ctx context.Context, xAPIVersion string, ...) (*operations.GetEligibilityCardlessEMIResponse, error)
- func (s *Eligibility) GetPaylaterMethods(ctx context.Context, xAPIVersion string, ...) (*operations.GetEligibilityPaylaterResponse, error)
- type HTTPClient
- type Offers
- type Orders
- type PGReconciliation
- type PaymentLinks
- func (s *PaymentLinks) Cancel(ctx context.Context, linkID string, xAPIVersion string, ...) (*operations.CancelPaymentLinkResponse, error)
- func (s *PaymentLinks) Create(ctx context.Context, xAPIVersion string, ...) (*operations.CreatePaymentLinkResponse, error)
- func (s *PaymentLinks) Fetch(ctx context.Context, linkID string, xAPIVersion string, xRequestID *string, ...) (*operations.FetchPaymentLinkDetailsResponse, error)
- func (s *PaymentLinks) GetOrders(ctx context.Context, linkID string, xAPIVersion string, xRequestID *string, ...) (*operations.GetPaymentLinkOrdersResponse, error)
- type Payments
- func (s *Payments) GetforOrder(ctx context.Context, orderID string, xAPIVersion string, xRequestID *string, ...) (*operations.GetPaymentsforOrderResponse, error)
- func (s *Payments) PayOrder(ctx context.Context, xAPIVersion string, ...) (*operations.OrderPayResponse, error)
- func (s *Payments) Payment(ctx context.Context, cfPaymentID int64, orderID string, xAPIVersion string, ...) (*operations.GetPaymentbyIDResponse, error)
- func (s *Payments) PreauthorizeOrder(ctx context.Context, request operations.CapturePreauthorizationRequest, ...) (*operations.CapturePreauthorizationResponse, error)
- func (s *Payments) Submit(ctx context.Context, paymentID string, xAPIVersion string, ...) (*operations.SubmitOTPRequestResponse, error)
- type Refunds
- func (s *Refunds) Create(ctx context.Context, request operations.CreateRefundRequest, ...) (*operations.CreateRefundResponse, error)
- func (s *Refunds) Get(ctx context.Context, orderID string, refundID string, xAPIVersion string, ...) (*operations.GetRefundResponse, error)
- func (s *Refunds) GetAllforOrder(ctx context.Context, orderID string, xAPIVersion string, xRequestID *string, ...) (*operations.GetAllRefundsForOrderResponse, error)
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption
- func WithSecurity(security shared.Security) SDKOption
- func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption
- func WithServerIndex(serverIndex int) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- type Settlements
- func (s *Settlements) Fetch(ctx context.Context, request operations.GetSettlementReconciliationRequest, ...) (*operations.GetSettlementReconciliationResponse, error)
- func (s *Settlements) GetAll(ctx context.Context, request operations.GetSettlementsRequest, ...) (*operations.GetSettlementsResponse, error)
- func (s *Settlements) GetForOrder(ctx context.Context, orderID string, xAPIVersion string, xRequestID *string, ...) (*operations.GetSettlementsByOrderIDResponse, error)
- type SoftPOS
- type TokenVault
- func (s *TokenVault) DeleteSavedInstrument(ctx context.Context, customerID string, instrumentID string, ...) (*operations.DeleteSpecificSavedInstrumentResponse, error)
- func (s *TokenVault) FetchSavedInstrument(ctx context.Context, customerID string, instrumentID string, ...) (*operations.FetchSpecificSavedInstrumentResponse, error)
- func (s *TokenVault) FetchSavedInstrumentCryptogram(ctx context.Context, customerID string, instrumentID string, ...) (*operations.FetchCryptogramResponse, error)
- func (s *TokenVault) GetAllSavedInstruments(ctx context.Context, customerID string, ...) (*operations.FetchAllSavedInstrumentsResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ServerList = []string{
"https://sandbox.cashfree.com/pg",
"https://api.cashfree.com/pg",
}
ServerList contains the list of servers available to the SDK
Functions ¶
Types ¶
type Cashfree ¶
type Cashfree struct { // Cashfree's token Vault helps you save cards and tokenize them in a PCI complaint manner. We support creation of network tokens which can be used across acquiring banks TokenVault *TokenVault Eligibility *Eligibility // Collection of APIs handle payment links. PaymentLinks *PaymentLinks // Collection of apis to get offers applicable for an order Offers *Offers // Collection of APIs to create, accept payments and refund for an order. Orders *Orders // Collection of APIs handle payments. Payments *Payments // Collection of APIs handle refunds. Refunds *Refunds // Collection of APIs handle settlements. Settlements *Settlements // Transac1tio1n reconciliation PGReconciliation *PGReconciliation // softPOS' agent and order management system now supported by APIs SoftPOS *SoftPOS // contains filtered or unexported fields }
Cashfree Payment Gateway APIs: Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
type Eligibility ¶ added in v0.9.0
type Eligibility struct {
// contains filtered or unexported fields
}
func (*Eligibility) GetAllOffers ¶ added in v0.9.0
func (s *Eligibility) GetAllOffers(ctx context.Context, xAPIVersion string, eligibilityOffersRequest *shared.EligibilityOffersRequest, xRequestID *string, opts ...operations.Option) (*operations.GetEligibilityOfferResponse, error)
GetAllOffers - Get eligible Offers Use this API to get eligible offers for an order or amount.
func (*Eligibility) GetCardlessEMI ¶ added in v0.9.0
func (s *Eligibility) GetCardlessEMI(ctx context.Context, xAPIVersion string, eligibilityCardlessEMIRequest *shared.EligibilityCardlessEMIRequest, xRequestID *string, opts ...operations.Option) (*operations.GetEligibilityCardlessEMIResponse, error)
GetCardlessEMI - Get eligible Cardless EMI Use this API to get eligible Cardless EMI Payment Methods for a customer on an order.
func (*Eligibility) GetPaylaterMethods ¶ added in v0.9.0
func (s *Eligibility) GetPaylaterMethods(ctx context.Context, xAPIVersion string, eligibilityCardlessEMIRequest *shared.EligibilityCardlessEMIRequest, xRequestID *string, opts ...operations.Option) (*operations.GetEligibilityPaylaterResponse, error)
GetPaylaterMethods - Get eligible Paylater Use this API to get eligible Paylater Payment Methods for a customer on an order.
type HTTPClient ¶
HTTPClient provides an interface for suplying the SDK with a custom HTTP client
type Offers ¶ added in v0.9.0
type Offers struct {
// contains filtered or unexported fields
}
Offers - Collection of apis to get offers applicable for an order
func (*Offers) Create ¶ added in v0.9.0
func (s *Offers) Create(ctx context.Context, xAPIVersion string, createOfferBackendRequest *shared.CreateOfferBackendRequest, xRequestID *string, opts ...operations.Option) (*operations.CreateOfferResponse, error)
Create Offer Use this API to create offers with Cashfree from your backend
func (*Offers) Get ¶ added in v0.9.0
func (s *Offers) Get(ctx context.Context, offerID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetOfferResponse, error)
Get Offer by ID Use this API to get offer by offer_id
type Orders ¶ added in v0.9.0
type Orders struct {
// contains filtered or unexported fields
}
Orders - Collection of APIs to create, accept payments and refund for an order.
func (*Orders) Create ¶ added in v0.9.0
func (s *Orders) Create(ctx context.Context, xAPIVersion string, createOrderBackendRequest *shared.CreateOrderBackendRequest, xIdempotencyKey *string, xRequestID *string, opts ...operations.Option) (*operations.CreateOrderResponse, error)
Create Order ### Order An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for. Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. You can use the `payment_sessions_id` to create a transaction for the order.
func (*Orders) Get ¶ added in v0.9.0
func (s *Orders) Get(ctx context.Context, orderID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetOrderResponse, error)
Get Order Use this API to fetch the order that was created at Cashfree's using the `order_id`. ## When to use this API - To check the status of your order - Once the order is PAID - Once your customer returns to `return_url`
type PGReconciliation ¶ added in v0.9.0
type PGReconciliation struct {
// contains filtered or unexported fields
}
PGReconciliation - Transac1tio1n reconciliation
func (*PGReconciliation) Get ¶ added in v0.9.0
func (s *PGReconciliation) Get(ctx context.Context, request operations.GetPGReconciliationRequest, opts ...operations.Option) (*operations.GetPGReconciliationResponse, error)
Get - PG Reconciliation Use this API to get the payment gateway reconciliation details with date range.
type PaymentLinks ¶ added in v0.9.0
type PaymentLinks struct {
// contains filtered or unexported fields
}
PaymentLinks - Collection of APIs handle payment links.
func (*PaymentLinks) Cancel ¶ added in v0.9.0
func (s *PaymentLinks) Cancel(ctx context.Context, linkID string, xAPIVersion string, xIdempotencyKey *string, xRequestID *string, opts ...operations.Option) (*operations.CancelPaymentLinkResponse, error)
Cancel Payment Link Use this API to cancel a payment link. No further payments can be done against a cancelled link. Only a link in ACTIVE status can be cancelled.
func (*PaymentLinks) Create ¶ added in v0.9.0
func (s *PaymentLinks) Create(ctx context.Context, xAPIVersion string, createLinkRequest *shared.CreateLinkRequest, xIdempotencyKey *string, xRequestID *string, opts ...operations.Option) (*operations.CreatePaymentLinkResponse, error)
Create Payment Link Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url.
func (*PaymentLinks) Fetch ¶ added in v0.9.0
func (s *PaymentLinks) Fetch(ctx context.Context, linkID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.FetchPaymentLinkDetailsResponse, error)
Fetch Payment Link Details Use this API to view all details and status of a payment link.
func (*PaymentLinks) GetOrders ¶ added in v0.9.0
func (s *PaymentLinks) GetOrders(ctx context.Context, linkID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetPaymentLinkOrdersResponse, error)
GetOrders - Get Orders for a Payment Link Use this API to view all order details for a payment link.
type Payments ¶ added in v0.9.0
type Payments struct {
// contains filtered or unexported fields
}
Payments - Collection of APIs handle payments.
func (*Payments) GetforOrder ¶ added in v0.9.0
func (s *Payments) GetforOrder(ctx context.Context, orderID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetPaymentsforOrderResponse, error)
GetforOrder - Get Payments for an Order Use this API to view all payment details for an order.
func (*Payments) PayOrder ¶ added in v0.9.0
func (s *Payments) PayOrder(ctx context.Context, xAPIVersion string, orderPayRequest *shared.OrderPayRequest, xRequestID *string, opts ...operations.Option) (*operations.OrderPayResponse, error)
PayOrder - Order Pay Use this API when you have already created the orders and want # Raj nadna Cashfree to process the payment. To use this API S2S flag needs to be enabled from the backend. In case you want to use the cards payment option the PCI DSS flag is required, for more information send an email to "care@cashfree.com".
func (*Payments) Payment ¶ added in v0.9.0
func (s *Payments) Payment(ctx context.Context, cfPaymentID int64, orderID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetPaymentbyIDResponse, error)
Get Payment by ID Use this API to view payment details of an order for a payment ID.
func (*Payments) PreauthorizeOrder ¶ added in v0.9.0
func (s *Payments) PreauthorizeOrder(ctx context.Context, request operations.CapturePreauthorizationRequest, opts ...operations.Option) (*operations.CapturePreauthorizationResponse, error)
PreauthorizeOrder - Preauthorization Use this API to capture or void a preauthorized payment
func (*Payments) Submit ¶ added in v0.9.0
func (s *Payments) Submit(ctx context.Context, paymentID string, xAPIVersion string, otpRequest *shared.OTPRequest, xRequestID *string, opts ...operations.Option) (*operations.SubmitOTPRequestResponse, error)
Submit or Resend OTP If you accept OTP on your own page, you can use the below API to send OTP to Cashfree.
type Refunds ¶ added in v0.9.0
type Refunds struct {
// contains filtered or unexported fields
}
Refunds - Collection of APIs handle refunds.
func (*Refunds) Create ¶ added in v0.9.0
func (s *Refunds) Create(ctx context.Context, request operations.CreateRefundRequest, opts ...operations.Option) (*operations.CreateRefundResponse, error)
Create Refund Use this API to initiate refunds.
func (*Refunds) Get ¶ added in v0.9.0
func (s *Refunds) Get(ctx context.Context, orderID string, refundID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetRefundResponse, error)
Get Refund Use this API to fetch a specific refund processed on your Cashfree Account.
func (*Refunds) GetAllforOrder ¶ added in v0.9.0
func (s *Refunds) GetAllforOrder(ctx context.Context, orderID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetAllRefundsForOrderResponse, error)
GetAllforOrder - Get All Refunds for an Order Use this API to fetch all refunds processed against an order.
type SDKOption ¶
type SDKOption func(*Cashfree)
func WithClient ¶
func WithClient(client HTTPClient) SDKOption
WithClient allows the overriding of the default HTTP client used by the SDK
func WithRetryConfig ¶ added in v0.5.0
func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption
func WithSecurity ¶
WithSecurity configures the SDK to use the provided security details
func WithSecuritySource ¶ added in v0.7.0
WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication
func WithServerIndex ¶
WithServerIndex allows the overriding of the default server by index
func WithServerURL ¶
WithServerURL allows the overriding of the default server URL
type Settlements ¶ added in v0.9.0
type Settlements struct {
// contains filtered or unexported fields
}
Settlements - Collection of APIs handle settlements.
func (*Settlements) Fetch ¶ added in v0.9.0
func (s *Settlements) Fetch(ctx context.Context, request operations.GetSettlementReconciliationRequest, opts ...operations.Option) (*operations.GetSettlementReconciliationResponse, error)
Fetch - Settlement Reconciliation Use this API to get settlement reconciliation details using Settlement ID, settlement UTR or date range.
func (*Settlements) GetAll ¶ added in v0.9.0
func (s *Settlements) GetAll(ctx context.Context, request operations.GetSettlementsRequest, opts ...operations.Option) (*operations.GetSettlementsResponse, error)
GetAll - Get All Settlements Use this API to get all settlement details by specifying the settlement ID, settlement UTR or date range.
func (*Settlements) GetForOrder ¶ added in v0.9.0
func (s *Settlements) GetForOrder(ctx context.Context, orderID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetSettlementsByOrderIDResponse, error)
GetForOrder - Get Settlements by Order ID Use this API to view all the settlements of a particular order.
type SoftPOS ¶ added in v0.9.0
type SoftPOS struct {
// contains filtered or unexported fields
}
SoftPOS - softPOS' agent and order management system now supported by APIs
func (*SoftPOS) CreateTerminals ¶ added in v0.9.0
func (s *SoftPOS) CreateTerminals(ctx context.Context, xAPIVersion string, createTerminalRequest *shared.CreateTerminalRequest, xIdempotencyKey *string, xRequestID *string, opts ...operations.Option) (*operations.CreateTerminalsResponse, error)
CreateTerminals - Create Terminal Use this API to create new terminals to use softPOS.
func (*SoftPOS) TerminalStatus ¶ added in v0.9.0
func (s *SoftPOS) TerminalStatus(ctx context.Context, terminalPhoneNo string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.GetTerminalByMobileNumberResponse, error)
TerminalStatus - Get terminal status using phone number Use this API to view all details of a terminal.
type TokenVault ¶ added in v0.9.0
type TokenVault struct {
// contains filtered or unexported fields
}
TokenVault - Cashfree's token Vault helps you save cards and tokenize them in a PCI complaint manner. We support creation of network tokens which can be used across acquiring banks
func (*TokenVault) DeleteSavedInstrument ¶ added in v0.9.0
func (s *TokenVault) DeleteSavedInstrument(ctx context.Context, customerID string, instrumentID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.DeleteSpecificSavedInstrumentResponse, error)
DeleteSavedInstrument - Delete Saved Instrument To delete a saved instrument for a customer id and instrument id
func (*TokenVault) FetchSavedInstrument ¶ added in v0.9.0
func (s *TokenVault) FetchSavedInstrument(ctx context.Context, customerID string, instrumentID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.FetchSpecificSavedInstrumentResponse, error)
FetchSavedInstrument - Fetch Single Saved Instrument To get specific saved instrument for a customer id and instrument id
func (*TokenVault) FetchSavedInstrumentCryptogram ¶ added in v0.9.0
func (s *TokenVault) FetchSavedInstrumentCryptogram(ctx context.Context, customerID string, instrumentID string, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.FetchCryptogramResponse, error)
FetchSavedInstrumentCryptogram - Fetch cryptogram for saved instrument To get the card network token, token expiry and cryptogram for a saved instrument using instrument id
func (*TokenVault) GetAllSavedInstruments ¶ added in v0.9.0
func (s *TokenVault) GetAllSavedInstruments(ctx context.Context, customerID string, instrumentType operations.InstrumentType, xAPIVersion string, xRequestID *string, opts ...operations.Option) (*operations.FetchAllSavedInstrumentsResponse, error)
GetAllSavedInstruments - Fetch All Saved Instruments To get all saved instruments for a customer id