refund

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

* File Created: Friday, 1st September 2023 11:29:06 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author

* File Created: Friday, 1st September 2023 11:29:23 am * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ServerKey string
	Api       common.Api
}

func (*Client) Create

func (c *Client) Create(ctx context.Context, payload durianpay.RefundPayload) (*Refund, *durianpay.Error)

Create return a response from Create Refund API.

[Doc Create Refund API]: https://durianpay.id/docs/api/refunds/create/

func (*Client) FetchRefundByID

func (c *Client) FetchRefundByID(ctx context.Context, ID string) (*Refund, *durianpay.Error)

FetchRefundByID return a response from Refund Fetch By ID API.

[Doc Refund Fetch By ID API]: https://durianpay.id/docs/api/refunds/fetch-one/

func (*Client) FetchRefunds

FetchRefunds return a response from Refund Fetch API.

[Doc Refund Fetch API]: https://durianpay.id/docs/api/refunds/fetch/

type FetchRefunds

type FetchRefunds struct {
	Refunds   []Refunds `json:"refund"`
	TotalData uint32    `json:"total_data"`
}

FetchRefunds is response for Refund Fetch API

type Refund

type Refund struct {
	ID            string    `json:"id"`
	RefID         string    `json:"ref_id"`
	Amount        string    `json:"amount"`
	RefundType    string    `json:"refund_type"`
	Status        string    `json:"status"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	ApprovedAt    time.Time `json:"approved_at"`
	Source        string    `json:"source"`
	CustomerID    string    `json:"customer_id"`
	CustomerName  string    `json:"customer_name"`
	CustomerEmail string    `json:"customer_email"`
	CustomerPhone string    `json:"customer_phone"`
	FailureReason string    `json:"failure_reason"`
}

Refund is general response from Refund API. Currently this response use for Create and Fetch By ID API.

type Refunds

type Refunds struct {
	ID                 string    `json:"id"`
	MerchantID         string    `json:"merchant_id"`
	Status             string    `json:"status"`
	DisbursementID     string    `json:"disbursement_id"`
	TotalAmount        string    `json:"total_amount"`
	CreatedAt          time.Time `json:"created_at"`
	UpdatedAt          time.Time `json:"updated_at"`
	ApprovedAt         time.Time `json:"approved_at"`
	PaymentID          string    `json:"payment_id"`
	RefundRefID        string    `json:"json:"refund_ref_id""`
	IsLive             bool      `json:"is_live"`
	Type               string    `json:"type"`
	OrderID            string    `json:"order_id"`
	CustomerID         string    `json:"customer_id"`
	RefundPartial      string    `json:"refund_partial"`
	RefundNotes        string    `json:"refund_notes"`
	PaymentPaidAmount  string    `json:"payment_paid_amount"`
	PaymentDetailsType string    `json:"payment_details_type"`
	PaymentMethodID    string    `json:"payment_method_id"`
	CustomerName       string    `json:"customer_name"`
	CustomerEmail      string    `json:"customer_email"`
	CustomerPhone      string    `json:"customer_phone"`
	Destination        string    `json:"destination"`
	EwalletName        string    `json:"ewallet_name"`
	AccountName        string    `json:"account_name"`
	AccountNumber      string    `json:"account_number"`
	CreatedBy          uint16    `json:"created_by"`
	CreatedByName      string    `json:"created_by_name"`
	UpdatedBy          uint16    `json:"updated_by"`
	UpdatedByName      string    `json:"updated_by_name"`
	History            string    `json:"history"`
	Source             string    `json:"source"`
	AllowRetrigger     bool      `json:"allow_retrigger"`
	FailureReason      string    `json:"failure_reason"`
}

Refunds is part of FetchRefunds for attribute Refunds

Jump to

Keyboard shortcuts

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