This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
379 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "Govuln" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ master ] | ||
schedule: | ||
- cron: '42 12 * * 2' | ||
|
||
jobs: | ||
analyze: | ||
name: Vuln check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 'stable' | ||
id: go | ||
|
||
- name: Scan for Vulnerabilities in Code | ||
uses: golang/govulncheck-action@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
vulncheck-version: latest | ||
package: ./... | ||
fail-on-vuln: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package qiwi | ||
|
||
type SplitDataType string | ||
|
||
const MerchantDetails SplitDataType = "MERCHANT_DETAILS" | ||
|
||
type Split struct { | ||
Type SplitDataType `json:"type"` // String Data type. Always MERCHANT_DETAILS (merchant details) | ||
SiteUID string `json:"siteUid"` // String Merchant ID | ||
Amount Amount `json:"splitAmount"` // Object Merchant reimbursement data | ||
OrderID string `json:"orderId,omitempty"` // String Order number (optional) | ||
Comment string `json:"comment,omitempty"` // string comment String Comment for the order (optional) | ||
} | ||
|
||
// AddSplit without optional fields, see SplitExtra. | ||
func (p *Payment) Split(a Amount, merchid string) *Payment { | ||
return p.SplitExtra(a, merchid, "", "") | ||
} | ||
|
||
// SplitExtra extends to optional fields. | ||
func (p *Payment) SplitExtra(a Amount, merchid, orderid, c string) *Payment { | ||
s := &Split{Type: MerchantDetails, SiteUID: merchid, Amount: a} | ||
|
||
if orderid != "" { | ||
s.OrderID = orderid | ||
} | ||
|
||
if c != "" { | ||
s.Comment = c | ||
} | ||
|
||
p.addSplit(s) | ||
|
||
return p | ||
} | ||
|
||
// addSplit adds split data to payment information. | ||
func (p *Payment) addSplit(s *Split) { | ||
p.Splits = append(p.Splits, s) | ||
} |
Oops, something went wrong.