forked from braintree-go/braintree-go
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmerchant_account_integration_test.go
69 lines (53 loc) · 1.33 KB
/
merchant_account_integration_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
// +build integration
package braintree
import (
"context"
"encoding/xml"
"testing"
"github.com/hellofresh/braintree-go/testhelpers"
)
func TestMerchantAccountCreate(t *testing.T) {
t.Parallel()
ctx := context.Background()
acct := MerchantAccount{
MasterMerchantAccountId: testMerchantAccountId,
TOSAccepted: true,
Id: testhelpers.RandomString(),
Individual: &MerchantAccountPerson{
FirstName: "Kayle",
LastName: "Gishen",
Email: "[email protected]",
Phone: "5556789012",
DateOfBirth: "1-1-1989",
Address: &Address{
StreetAddress: "1 E Main St",
ExtendedAddress: "Suite 404",
Locality: "Chicago",
Region: "IL",
PostalCode: "60622",
},
},
FundingOptions: &MerchantAccountFundingOptions{
Destination: FUNDING_DEST_MOBILE_PHONE,
MobilePhone: "5552344567",
},
}
x, _ := xml.Marshal(&acct)
t.Log(string(x))
merchantAccount, err := testGateway.MerchantAccount().Create(ctx, &acct)
t.Log(merchantAccount)
if err != nil {
t.Fatal(err)
}
if merchantAccount.Id == "" {
t.Fatal("invalid merchant account id")
}
ma2, err := testGateway.MerchantAccount().Find(ctx, merchantAccount.Id)
t.Log(ma2)
if err != nil {
t.Fatal(err)
}
if ma2.Id != merchantAccount.Id {
t.Fatal("ids do not match")
}
}