util

package module
v0.0.0-...-5cf47ec Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

README

Razorpay_Intergration_Golang

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ENVIRONMENT string
View Source
var PGDATA map[string]interface{}
View Source
var RAZ_API_KEY string
type RazorPay struct {
	Amount          int    `json:"amount"`
	Currency        string `json:"currency"`
	Receipt         string `json:"receipt"`
	Payment_capture bool   `json:"payment_capture"`
}
View Source
var RAZ_SECRET_KEY string

Functions

func ComputeHmac

func ComputeHmac(payload string, secret string) string

func ComputeHmac256

func ComputeHmac256(payload string, secret string) string

func RazorPayAuth

func RazorPayAuth(token string) (error_code string, error_msg string, err error)

func RazorVerifyChecksum

func RazorVerifyChecksum(dataMap map[string]string, appID int64) (res string, err error)

func RazorVerifySubsChecksum

func RazorVerifySubsChecksum(dataMap map[string]string, token string) (res string)

func RazorpayFetchPayment

func RazorpayFetchPayment(paymentId string) (data string, err error)

func StripePayCreate

func StripePayCreate(amount int, currency string, receipt string, payment_capture int, appID int64, stripeToken string) (string, error)

func StripePayCreateOrder

func StripePayCreateOrder(Title, currency string, amount int, ptype, packagetype string, tp string) (string, error)

func StripePaymentIntent

func StripePaymentIntent(amount int, currency string, appID int64) string

Types

type Add

type Add struct {
	Item Items `json:"item"`
}

type Item

type Item struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Amount      int    `json:"amount"`
	Currency    string `json:"currency"`
}

type Items

type Items struct {
	Name     string `json:"name"`
	Amount   int    `json:"amount"`
	Currenty string `json:"currency"`
}

type PaymentRef

type PaymentRef struct {
	PymntRef string `json:"trans_id"`
}

type PaymentVal

type PaymentVal struct {
	ApiKey    string `json:"api_key"`
	SecretKey string `json:"secret_key"`
}

type PaymentsStr

type PaymentsStr struct {
	Default  string     `json:"default"`
	RazorPay PaymentVal `json:"razorpay"`
	Stripe   PaymentVal `json:"stripe"`
}

func GetPaymentsOpions

func GetPaymentsOpions(AppID int64) (PaymentsStr, error)

type RazorAddon

type RazorAddon struct {
	Quantity       int    `json:"quantity"`
	SubscriptionId string `json:"-"`
	Item           Item   `json:"item"`
}

type RazorAddonResponse

type RazorAddonResponse struct {
	Id             string `json:"id"`
	Entity         string `json:"entity"`
	SubscriptionId string `json:"subscription_id"`
	Quantity       int    `json:"quantity"`
}

func RazorCreateAddon

func RazorCreateAddon(subscription_id string, name string, description string, amount int, currency string, token string) (res *RazorAddonResponse, error_code string, error_msg string, err error)

type RazorCancel

type RazorCancel struct {
	CancelAtCycleEnd int `json:"cancel_at_cycle_end"`
}

type RazorCancelResponse

type RazorCancelResponse struct {
	Id             string `json:"id"`
	Entity         string `json:"entity"`
	SubscriptionId string `json:"subscription_id"`
	Quantity       int    `json:"quantity"`
}

func RazorCancelSubs

func RazorCancelSubs(subscription_id string, token int64) (res *RazorCancelResponse, error_code string, error_msg string, err error)

func RazorHoldSubs

func RazorHoldSubs(subscription_id string, token int64) (res *RazorCancelResponse, error_code string, error_msg string, err error)

func RazorResumeSubs

func RazorResumeSubs(subscription_id string, token int64) (res *RazorCancelResponse, error_code string, error_msg string, err error)

type RazorPause

type RazorPause struct {
	PauseAt string `json:"pause_at"`
}

type RazorPay

type RazorPay struct {
	PlanId         string `json:"plan_id"`
	CustomerId     string `json:"customer_id"`
	CustomerNotify int    `json:"customer_notify"`
	TotalCount     int    `json:"total_count"`
	Quantity       int    `json:"quantity"`
}

type RazorPayOrder

type RazorPayOrder struct {
	Amount          int        `json:"amount"`
	Currency        string     `json:"currency"`
	Receipt         string     `json:"receipt"`
	Payment_capture int        `json:"payment_capture"`
	Notes           PaymentRef `json:"notes"`
}

type RazorPlan

type RazorPlan struct {
	Period         string `json:"period"`
	PeriodInterval int    `json:"interval"`
	Item           Item   `json:"item"`
}

type RazorPlanResponse

type RazorPlanResponse struct {
	Id       string `json:"id"`
	Entity   string `json:"entity"`
	Period   string `json:"period"`
	Interval int    `json:"interval"`
}

func RazorCreatePlan

func RazorCreatePlan(period string, period_interval int, name string, description string, amount int, currency string, token string) (res *RazorPlanResponse, error_code string, error_msg string, err error)

type RazorResponse

type RazorResponse struct {
	Id          string `json:"id"`
	Entity      string `json:"entity"`
	Amount      int    `json:"amount"`
	Amount_paid int    `json:"amount_paid"`
	Amount_due  int    `json:"amount_due"`
	Currency    string `json:"currency"`
	Receipt     string `json:"receipt"`
	Offer_id    string `json:"offer_id"`
	Status      string `json:"status"`
	Attempts    int    `json:"attempts"`
	Notes       []string
	Created_at  int `json:"created_at"`
}

func RazorCreateOrder

func RazorCreateOrder(amount int, currency string, receipt string, payment_capture int, appID int64) (res *RazorResponse, error_code string, error_msg string, err error)

func RazorCreateOrder1

func RazorCreateOrder1(amount int, currency string, receipt string, payment_capture int, appID int64, orderid int) (res *RazorResponse, error_code string, error_msg string, err error)

func RazorCreateSubscription

func RazorCreateSubscription(plan_id string, start_at int, subscription_length int, payment_capture int, token int64) (res *RazorResponse, error_code string, error_msg string, err error)

type RazorResume

type RazorResume struct {
	ResumeAt string `json:"resume_at"`
}

Jump to

Keyboard shortcuts

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