-
Notifications
You must be signed in to change notification settings - Fork 10
/
x4.go
45 lines (37 loc) · 1.17 KB
/
x4.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2016 The Constantin Karataev. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd.
//
// Receiving the history of issued invoices. Verifying whether invoices were paid.
// https://wiki.wmtransfer.com/projects/webmoney/wiki/Interface_X4
package webmoney
import (
"encoding/xml"
)
type OutInvoices struct {
XMLName xml.Name `xml:"getoutinvoices"`
Purse string `xml:"purse"`
WmInvid string `xml:"wminvid"`
OrderId string `xml:"orderid"`
DateStart string `xml:"datestart"`
DateFinish string `xml:"datefinish"`
}
func (i OutInvoices) GetSignSource(reqn string) (string, error) {
return i.Purse + reqn, nil
}
type OutInvoicesResp struct {
XMLName xml.Name `xml:"outinvoices"`
InvoiceList []InvoiceResponse `xml:"outinvoice"`
}
func (w *WmClient) GetOutInvoices(i OutInvoices) (OutInvoicesResp, error) {
X := W3s{
Request: i,
Interface: XInterface{Name: "OutInvoices", Type: "w3s"},
Client: w,
}
result := OutInvoicesResp{}
err := X.getResult(&result)
return result, err
}