payment_system

package
v1.10.11 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CardPayDateFormat = "2006-01-02T15:04:05Z"
)

Variables

View Source
var (
	PaymentSystemErrorHandlerNotFound = errors.NewBillingServerErrorMsg("ph000001", "handler for specified payment system not found")

	PaymentSystemErrorEWalletIdentifierIsInvalid = errors.NewBillingServerErrorMsg("ph000005", "wallet identifier is invalid")

	PaymentSystemErrorRequestAmountOrCurrencyIsInvalid       = errors.NewBillingServerErrorMsg("ph000011", "amount or currency from request not match with value in order")
	PaymentSystemErrorRefundRequestAmountOrCurrencyIsInvalid = errors.NewBillingServerErrorMsg("ph000012", "amount or currency from request not match with value in refund")
	PaymentSystemErrorRequestTemporarySkipped                = errors.NewBillingServerErrorMsg("ph000013", "notification skipped with temporary status")
)

Functions

func NewCardPayHttpClientStatusOk

func NewCardPayHttpClientStatusOk() *http.Client

func NewClientStatusOk

func NewClientStatusOk() *http.Client

Types

type CardPayAddress

type CardPayAddress struct {
	Country string `json:"country"`
	City    string `json:"city,omitempty"`
	Phone   string `json:"phone,omitempty"`
	State   string `json:"state,omitempty"`
	Street  string `json:",omitempty"`
	Zip     string `json:"zip,omitempty"`
}

type CardPayBankCardAccount

type CardPayBankCardAccount struct {
	Pan        string `json:"pan"`
	HolderName string `json:"holder"`
	Cvv        string `json:"security_code"`
	Expire     string `json:"expiration"`
}

type CardPayCardAccount

type CardPayCardAccount struct {
	BillingAddress *CardPayAddress         `json:"billing_address,omitempty"`
	Card           *CardPayBankCardAccount `json:"card"`
	Token          string                  `json:"token,omitempty"`
}

type CardPayCryptoCurrencyAccount

type CardPayCryptoCurrencyAccount struct {
	RollbackAddress string `json:"rollback_address"`
}

type CardPayCustomer

type CardPayCustomer struct {
	Email   string `json:"email"`
	Ip      string `json:"ip"`
	Account string `json:"id"`
}

type CardPayEWalletAccount

type CardPayEWalletAccount struct {
	Id string `json:"id"`
}

type CardPayItem

type CardPayItem struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Count       int     `json:"count"`
	Price       float64 `json:"price"`
}

type CardPayMerchantOrder

type CardPayMerchantOrder struct {
	Id              string          `json:"id" validate:"required,hexadecimal"`
	Description     string          `json:"description,omitempty"`
	Items           []*CardPayItem  `json:"items,omitempty"`
	ShippingAddress *CardPayAddress `json:"shipping_address,omitempty"`
}

type CardPayOrder

type CardPayOrder struct {
	Request               *CardPayRequest               `json:"request"`
	MerchantOrder         *CardPayMerchantOrder         `json:"merchant_order"`
	Description           string                        `json:"description"`
	PaymentMethod         string                        `json:"payment_method"`
	PaymentData           *CardPayPaymentData           `json:"payment_data,omitempty"`
	RecurringData         *CardPayRecurringData         `json:"recurring_data,omitempty"`
	CardAccount           *CardPayCardAccount           `json:"card_account,omitempty"`
	Customer              *CardPayCustomer              `json:"customer"`
	EWalletAccount        *CardPayEWalletAccount        `json:"ewallet_account,omitempty"`
	CryptoCurrencyAccount *CardPayCryptoCurrencyAccount `json:"cryptocurrency_account,omitempty"`
	ReturnUrls            *CardPayReturnUrls            `json:"return_urls,omitempty"`
}

type CardPayOrderRecurringResponse

type CardPayOrderRecurringResponse struct {
	RecurringData *CardPayOrderRecurringResponseRecurringData `json:"recurring_data"`
}

func (*CardPayOrderRecurringResponse) IsSuccessStatus

func (h *CardPayOrderRecurringResponse) IsSuccessStatus() bool

type CardPayOrderRecurringResponseRecurringData

type CardPayOrderRecurringResponseRecurringData struct {
	Id       string                      `json:"id"`
	Filing   *CardPayRecurringDataFiling `json:"filing"`
	Status   string                      `json:"status"`
	Amount   float64                     `json:"amount"`
	Currency string                      `json:"currency"`
	Created  string                      `json:"created"`
	Note     string                      `json:"note"`
	Rrn      string                      `json:"rrn"`
	Is3D     bool                        `json:"is_3d"`
}

type CardPayOrderResponse

type CardPayOrderResponse struct {
	RedirectUrl string `json:"redirect_url"`
}

type CardPayPaymentData

type CardPayPaymentData struct {
	Currency   string  `json:"currency"`
	Amount     float64 `json:"amount"`
	Descriptor string  `json:"dynamic_descriptor"`
	Note       string  `json:"note"`
}

type CardPayRecurringData

type CardPayRecurringData struct {
	Currency   string                      `json:"currency"`
	Amount     float64                     `json:"amount"`
	Filing     *CardPayRecurringDataFiling `json:"filing,omitempty"`
	Descriptor string                      `json:"dynamic_descriptor"`
	Note       string                      `json:"note"`
	Initiator  string                      `json:"initiator"`
	Plan       *CardPayRecurringPlan       `json:"plan"`
}

type CardPayRecurringDataFiling

type CardPayRecurringDataFiling struct {
	Id string `json:"id"`
}

type CardPayRecurringDataResponse

type CardPayRecurringDataResponse struct {
	Id string `json:"id"`
}

type CardPayRecurringPlan

type CardPayRecurringPlan struct {
	Id string `json:"id"`
}

type CardPayRecurringPlanData

type CardPayRecurringPlanData struct {
	Id       string  `json:"id"`
	Status   string  `json:"status"`
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
	Interval int32   `json:"interval"`
	Name     string  `json:"name"`
	Period   string  `json:"period"`
	Retries  int32   `json:"retries"`
}

type CardPayRecurringPlanRequest

type CardPayRecurringPlanRequest struct {
	Request  *CardPayRequest           `json:"request"`
	PlanData *CardPayRecurringPlanData `json:"plan_data"`
}

type CardPayRecurringPlanResponse

type CardPayRecurringPlanResponse struct {
	PlanData *CardPayRecurringPlanData `json:"plan_data"`
}

type CardPayRecurringSubscription

type CardPayRecurringSubscription struct {
	Id string `json:"id"`
}

type CardPayRecurringSubscriptionRequest

type CardPayRecurringSubscriptionRequest struct {
	Request       *CardPayRequest       `json:"request"`
	CardAccount   *CardPayCardAccount   `json:"card_account"`
	Customer      *CardPayCustomer      `json:"customer"`
	MerchantOrder *CardPayMerchantOrder `json:"merchant_order"`
	PaymentMethod string                `json:"payment_method"`
	RecurringData *CardPayRecurringData `json:"recurring_data"`
	ReturnUrls    *CardPayReturnUrls    `json:"return_urls"`
}

type CardPayRecurringSubscriptionResponse

type CardPayRecurringSubscriptionResponse struct {
	RedirectUrl           string                        `json:"redirect_url"`
	RecurringDataResponse *CardPayRecurringDataResponse `json:"recurring_data"`
	RecurringSubscription *CardPayRecurringSubscription `json:"subscription"`
}

type CardPayRecurringSubscriptionUpdateRequest

type CardPayRecurringSubscriptionUpdateRequest struct {
	Request          *CardPayRequest                 `json:"request"`
	Operation        string                          `json:"operation"`
	SubscriptionData *CardPaySubscriptionDataRequest `json:"subscription_data"`
}

type CardPayRefundData

type CardPayRefundData struct {
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

type CardPayRefundRequest

type CardPayRefundRequest struct {
	Request       *CardPayRequest             `json:"request"`
	MerchantOrder *CardPayMerchantOrder       `json:"merchant_order"`
	PaymentData   *CardPayRecurringDataFiling `json:"payment_data"`
	RefundData    *CardPayRefundData          `json:"refund_data"`
}

type CardPayRefundResponse

type CardPayRefundResponse struct {
	PaymentMethod  string                            `json:"payment_method"`
	MerchantOrder  *CardPayMerchantOrder             `json:"merchant_order"`
	RefundData     *CardPayRefundResponseRefundData  `json:"refund_data"`
	PaymentData    *CardPayRefundResponsePaymentData `json:"payment_data"`
	Customer       *CardPayRefundResponseCustomer    `json:"customer"`
	CardAccount    interface{}                       `json:"card_account,omitempty"`
	EwalletAccount interface{}                       `json:"ewallet_account,omitempty"`
}

func (*CardPayRefundResponse) IsSuccessStatus

func (m *CardPayRefundResponse) IsSuccessStatus() bool

type CardPayRefundResponseCustomer

type CardPayRefundResponseCustomer struct {
	Id    string `json:"id"`
	Email string `json:"email"`
}

type CardPayRefundResponsePaymentData

type CardPayRefundResponsePaymentData struct {
	Id              string  `json:"id"`
	RemainingAmount float64 `json:"remaining_amount"`
}

type CardPayRefundResponseRefundData

type CardPayRefundResponseRefundData struct {
	Id       string  `json:"id"`
	Created  string  `json:"created"`
	Status   string  `json:"status"`
	AuthCode string  `json:"auth_code"`
	Is3d     bool    `json:"is_3d"`
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

type CardPayRequest

type CardPayRequest struct {
	Id   string `json:"id"`
	Time string `json:"time"`
}

type CardPayReturnUrls

type CardPayReturnUrls struct {
	CancelUrl  string `json:"cancel_url,omitempty"`
	DeclineUrl string `json:"decline_url,omitempty"`
	SuccessUrl string `json:"success_url,omitempty"`
}

type CardPaySubscriptionDataRequest

type CardPaySubscriptionDataRequest struct {
	StatusTo string `json:"status_to"`
}

type PaymentSystemInterface

type PaymentSystemInterface interface {
	CreatePayment(order *billingpb.Order, successUrl, failUrl string, requisites map[string]string) (string, error)
	ProcessPayment(order *billingpb.Order, message proto.Message, raw, signature string) error
	IsRecurringCallback(request proto.Message) bool
	CanSaveCard(request proto.Message) bool
	GetRecurringId(request proto.Message) string
	CreateRefund(order *billingpb.Order, refund *billingpb.Refund) error
	ProcessRefund(order *billingpb.Order, refund *billingpb.Refund, message proto.Message, raw, signature string) error
	CreateRecurringSubscription(order *billingpb.Order, subscription *recurringpb.Subscription, successUrl, failUrl string, requisites map[string]string) (string, error)
	IsSubscriptionCallback(request proto.Message) bool
	DeleteRecurringSubscription(order *billingpb.Order, subscription *recurringpb.Subscription) error
}

func NewCardPayHandler

func NewCardPayHandler() PaymentSystemInterface

type PaymentSystemManagerInterface

type PaymentSystemManagerInterface interface {
	GetGateway(name string) (PaymentSystemInterface, error)
}

type TransportCardPayOk

type TransportCardPayOk struct {
	Transport http.RoundTripper
}

func (*TransportCardPayOk) RoundTrip

func (h *TransportCardPayOk) RoundTrip(req *http.Request) (*http.Response, error)

type TransportCardPayRecurringPlanInactive

type TransportCardPayRecurringPlanInactive struct {
	Transport http.RoundTripper
}

func (*TransportCardPayRecurringPlanInactive) RoundTrip

type TransportCardPayRecurringPlanOk

type TransportCardPayRecurringPlanOk struct {
	Transport http.RoundTripper
}

func (*TransportCardPayRecurringPlanOk) RoundTrip

type TransportStatusError

type TransportStatusError struct {
	Transport http.RoundTripper
}

func (*TransportStatusError) RoundTrip

func (h *TransportStatusError) RoundTrip(_ *http.Request) (*http.Response, error)

type TransportStatusOk

type TransportStatusOk struct {
	Transport http.RoundTripper
	Err       error
}

func (*TransportStatusOk) RoundTrip

func (h *TransportStatusOk) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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