-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactory.java
More file actions
103 lines (95 loc) · 4 KB
/
Factory.java
File metadata and controls
103 lines (95 loc) · 4 KB
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
100
101
102
103
package com.payload.test;
import com.payload.pl;
import com.payload.Session;
import com.payload.arm.ARMRequest;
import com.payload.Exceptions;
import java.util.List;
import java.lang.reflect.Field;
import java.io.FileNotFoundException;
import org.json.*;
import org.junit.Test;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import com.github.javafaker.Faker;
public class Factory {
Session session;
public static Faker faker = new Faker();
public Factory() {
this.session = pl.default_session;
}
public Factory(Session session) {
this.session = session;
}
public pl.Customer createCustomer() throws Exception {
return this.session.create(new pl.Customer() {
{
set("email", faker.internet().emailAddress());
set("name", "Test Account");
}
});
}
public pl.ProcessingAccount createProcessingAccount() throws Exception {
return this.session.create(new pl.ProcessingAccount() {
{
set("name", "Processing Account");
set("legal_entity", new JSONObject() {
{
put("legal_name", "Test");
put("type", "INDIVIDUAL_SOLE_PROPRIETORSHIP");
put("ein", "23 423 4234");
put("street_address", "123 Example St");
put("unit_number", "Suite 1");
put("city", "New York");
put("state_province", "NY");
put("state_incorporated", "NY");
put("postal_code", "11238");
put("phone_number", "(111) 222-3333");
put("website", "https://payload.com");
put("start_date", "05/01/2015");
put("contact_name", "Test Person");
put("contact_email", "test.person@example.com");
put("contact_title", "VP");
put("owners", new JSONArray() {
{
put(new JSONObject() {
{
put("full_name", "Test Person");
put("email", "test.person@example.com");
put("ssn", "234 23 4234");
put("birth_date", "06/20/1985");
put("title", "CEO");
put("ownership", "100");
put("street_address", "4455 Carver Woods Drive, Suite 200");
put("unit_number", "2408");
put("city", "Cincinnati");
put("state_province", "OH");
put("postal_code", "45242");
put("phone_number", "(111) 222-3333");
put("type", "owner");
}
});
}
});
}
});
set("payment_methods", new JSONArray() {
{
put(new pl.BankAccount() {
{
set("account_number", "1234567890");
set("routing_number", "021000121");
set("account_type", "checking");
set("default_deposit_method", true);
}
}.obj);
}
});
}
});
}
}