-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorders_test.go
99 lines (93 loc) · 2.69 KB
/
orders_test.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package goafterbuy_test
import (
"fmt"
"github.com/jjideenschmiede/goafterbuy"
"testing"
)
// TestAddOrder is to test the oder function
func TestAddOrder(t *testing.T) {
// Define variables for request
partnerId := ""
partnerPass := ""
userId := ""
// Define order body
body := goafterbuy.AddOrderBody{
Action: "new",
PartnerId: partnerId,
PartnerPass: partnerPass,
UserId: userId,
ItemNo: "1",
KUsername: "Testing",
KSalutation: "Herr",
KCompany: "Test",
KFirstName: "Jonas",
KLastName: "Kwiedor",
KStreet: "Mercatorstraße 32a",
KStreet2: "",
KZip: "21502",
KLocation: "Geesthacht",
KState: "SH",
KCountry: "Deutschland",
KPhone: "",
KFax: "",
KEmail: "[email protected]",
DeliveryAddress: "0",
KLSalutation: "",
KLCompany: "",
KLFirstName: "",
KLLastName: "",
KLStreet: "",
KLStreet2: "",
KLZip: "",
KLLocation: "",
KLState: "",
KLCountry: "",
KLPhone: "",
Comment: "Das ist ein Kommentar.",
ShippingGroup: "",
ShippingMethod: "Versandkostenfrei DHL",
PaymentMethodsSurcharge: "",
ShippingCosts: "",
NoShippingCalc: "1",
PaymentMethod: "Kreditkarte",
SoldCurrency: "EUR",
VMemo: "",
OrderInfo1: "",
OrderInfo2: "",
OrderInfo3: "",
NoFeedback: "0",
SetPay: "1",
CustomerIdentification: "1",
ArticleIdentification: "0",
StockType: "shop",
SetPayDate: "",
BuyDate: "",
B1: "Abschicken",
VId: "",
CheckVId: "0",
Items: []goafterbuy.AddOrderBodyItem{
{
ArticleNo: "80286342",
AlternArticleNo1: "80286342",
AlternArticleNo2: "#25457",
ArticleName: "Artikel 1",
ArticleEPrice: "26,95",
ArticleVat: "19",
ArticleQuantity: "1",
ArticleLink: "",
Attribute: "",
ArticleMasterId: "80286342",
ArticleTag1: "",
ArticleTag2: "",
ArticleTag3: "",
ArticleTag4: "",
ArticleTag5: "",
},
},
}
// Add order
_, err := goafterbuy.AddOrder(body)
if err != nil {
fmt.Println(err)
}
}