Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
RefundSplits
Browse files Browse the repository at this point in the history
  • Loading branch information
melekhine committed Aug 8, 2023
1 parent 68d85bf commit 6a43141
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
51 changes: 26 additions & 25 deletions payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,32 @@ const (

// Payment main data structure, holds requests and responses on that requests from RSP.
type Payment struct {
token string `json:"-"` // Authtorisation token
apiLink string `json:"-"` // APILink sets payment gateway domain, no trailing slash
siteid string // Same as SiteID, but used for requests, as SiteID sets in responses
payid string // Same as BillID or PaymentID, but used only for requests, BillID sets in responses
PublicKey string `json:"-"` // Merchant identification key String +
SiteID string `json:"siteId,omitempty"` // RSP site identifier
BillID string `json:"billId,omitempty"` // Unique invoice identifier in merchant's system. It must be generated on your side with any means. It could be any sequence of digits and letters. Also you might use underscore _ and dash -. If not used, for each URL opening a new invoice is created. String(200) -
PaymentID string `json:"paymentId,omitempty"` // Payment operation unique identifier in RSP's system
CamptureID string `json:"captureId,omitempty"` // Capture operation unique identifier in RSP's system
RefundID string `json:"refundId,omitempty"` // Refund operation unique identifier in RSP's system
Amount Amount `json:"amount,omitempty"` // Amount of customer order rounded down to 2 digits (always in rubles)
PaymentMethod *PaymentMethod `json:"paymentMethod,omitempty"` // Payment method
Customer *Customer `json:"customer,omitempty"` // Information about the customer
Creation *Time `json:"creationDateTime,omitempty"`
NotifyDate *Time `json:"createddatetime,omitempty"` // Time used in Notify
Expiration *Time `json:"expirationDateTime,omitempty"`
Comment string `json:"comment,omitempty"` // Comment to the invoice
CallbackURL string `json:"callbackUrl,omitempty"` // Callback URL used to receive notification
SuccessURL string `json:"successUrl,omitempty"` // URL for redirect from the QIWI form in case of successful payment. URL should be within the merchant's site.
PayURL string `json:"payUrl,omitempty"` // Payment page on QIWI site
Req *Requirements `json:"requirements,omitempty"`
CustomField *CustomField `json:"customFields,omitempty"`
Flags []string `json:"flags,omitempty"`
Status *Status `json:"status,omitempty"`
Splits []*Split `json:"splits,omitempty"` // https://developer.qiwi.com/en/payments/#payments_split
token string `json:"-"` // Authtorisation token
apiLink string `json:"-"` // APILink sets payment gateway domain, no trailing slash
siteid string // Same as SiteID, but used for requests, as SiteID sets in responses
payid string // Same as BillID or PaymentID, but used only for requests, BillID sets in responses
PublicKey string `json:"-"` // Merchant identification key String +
SiteID string `json:"siteId,omitempty"` // RSP site identifier
BillID string `json:"billId,omitempty"` // Unique invoice identifier in merchant's system. It must be generated on your side with any means. It could be any sequence of digits and letters. Also you might use underscore _ and dash -. If not used, for each URL opening a new invoice is created. String(200) -
PaymentID string `json:"paymentId,omitempty"` // Payment operation unique identifier in RSP's system
CamptureID string `json:"captureId,omitempty"` // Capture operation unique identifier in RSP's system
RefundID string `json:"refundId,omitempty"` // Refund operation unique identifier in RSP's system
Amount Amount `json:"amount,omitempty"` // Amount of customer order rounded down to 2 digits (always in rubles)
PaymentMethod *PaymentMethod `json:"paymentMethod,omitempty"` // Payment method
Customer *Customer `json:"customer,omitempty"` // Information about the customer
Creation *Time `json:"creationDateTime,omitempty"`
NotifyDate *Time `json:"createddatetime,omitempty"` // Time used in Notify
Expiration *Time `json:"expirationDateTime,omitempty"`
Comment string `json:"comment,omitempty"` // Comment to the invoice
CallbackURL string `json:"callbackUrl,omitempty"` // Callback URL used to receive notification
SuccessURL string `json:"successUrl,omitempty"` // URL for redirect from the QIWI form in case of successful payment. URL should be within the merchant's site.
PayURL string `json:"payUrl,omitempty"` // Payment page on QIWI site
Req *Requirements `json:"requirements,omitempty"`
CustomField *CustomField `json:"customFields,omitempty"`
Flags []string `json:"flags,omitempty"`
Status *Status `json:"status,omitempty"`
Splits []*Split `json:"splits,omitempty"` // https://developer.qiwi.com/en/payments/#payments_split
RefundSplits []*RefundSplits `json:"refundSplits,omitempty"`

Error
}
Expand Down
12 changes: 12 additions & 0 deletions refund.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package qiwi

type RefundSplits struct {
Split
Commission *RefundSplitCommission `json:"splitCommissions,omitempty"`
}

// RefundSplitCommission contains commission information

Check failure on line 8 in refund.go

View workflow job for this annotation

GitHub Actions / Lint

Comment should end in a period (godot)
type RefundSplitCommission struct {
Amount *Amount `json:"merchantCms,omitempty"`
UserCms string `json:"userCms,omitempty"`
}
2 changes: 1 addition & 1 deletion split.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Split struct {
Comment string `json:"comment,omitempty"` // string comment String Comment for the order (optional)
}

// AddSplit without optional fields, see SplitExtra.
// Split without optional fields, see SplitExtra.
func (p *Payment) Split(a Amount, merchid string) *Payment {
return p.SplitExtra(a, merchid, "", "")
}
Expand Down

0 comments on commit 6a43141

Please sign in to comment.