1
1
def sample_credentials
2
- saved_credentials . merge ( { "test_mode" => "1" } ) . with_indifferent_access
3
- end
4
-
5
- def saved_credentials
6
- begin
7
- # Add your testing credentials to credentials.yml
8
- YAML . load_file ( "credentials.yml" )
9
- rescue Errno ::ENOENT
10
- {
11
- "client_code" => "client_code" ,
12
- "client_signature" => "client_signature"
13
- }
14
- end
2
+ {
3
+ "test_mode" => '1' ,
4
+ "client_code" => ENV [ 'CLIENT_CODE' ] ,
5
+ "client_signature" => ENV [ 'CLIENT_SIGNATURE' ]
6
+ } . with_indifferent_access
15
7
end
16
8
17
9
def sample_shipment ( number = "R#{ rand ( 999999 ) } " )
@@ -23,40 +15,40 @@ def sample_shipment(number = "R#{rand(999999)}")
23
15
"currency" => "USD" ,
24
16
"placed_on" => "2014-02-03T17:29:15.219Z" ,
25
17
"totals" =>
26
- { "item" => 200 ,
27
- "adjustment" => 20 ,
28
- "tax" => 10 ,
29
- "shipping" => 10 ,
30
- "payment" => 220 ,
31
- "order" => 220 } ,
32
- "items" =>
33
- [ { "product_id" => "QTRZIM03" ,
34
- "name" => "QTRZIM03" ,
35
- "quantity" => 2 ,
36
- "price" => 100 } ] ,
37
- "adjustments" =>
38
- [ { "name" => "Tax" , "value" => 10 } ,
39
- { "name" => "Shipping" , "value" => 5 } ,
40
- { "name" => "Shipping" , "value" => 5 } ] ,
18
+ { "item" => 200 ,
19
+ "adjustment" => 20 ,
20
+ "tax" => 10 ,
21
+ "shipping" => 10 ,
22
+ "payment" => 220 ,
23
+ "order" => 220 } ,
24
+ "items" =>
25
+ [ { "product_id" => "QTRZIM03" ,
26
+ "name" => "QTRZIM03" ,
27
+ "quantity" => 2 ,
28
+ "price" => 100 } ] ,
29
+ "adjustments" =>
30
+ [ { "name" => "Tax" , "value" => 10 } ,
31
+ { "name" => "Shipping" , "value" => 5 } ,
32
+ { "name" => "Shipping" , "value" => 5 } ] ,
41
33
"shipping_address" =>
42
- { "firstname" => "Joe" ,
43
- "lastname" => "Smith" ,
44
- "address1" => "1234 Awesome Street" ,
45
- "address2" => "" ,
46
- "zipcode" => "90210" ,
47
- "city" => "Hollywood" ,
48
- "state" => "California" ,
49
- "country" => "US" ,
50
- "phone" => "0000000000" } ,
51
- "billing_address" =>
52
- { "firstname" => "Joe" ,
53
- "lastname" => "Smith" ,
54
- "address1" => "1234 Awesome Street" ,
55
- "address2" => "" ,
56
- "zipcode" => "90210" ,
57
- "state" => "California" ,
58
- "country" => "US" ,
59
- "phone" => "0000000000" }
34
+ { "firstname" => "Joe" ,
35
+ "lastname" => "Smith" ,
36
+ "address1" => "1234 Awesome Street" ,
37
+ "address2" => "" ,
38
+ "zipcode" => "90210" ,
39
+ "city" => "Hollywood" ,
40
+ "state" => "California" ,
41
+ "country" => "US" ,
42
+ "phone" => "0000000000" } ,
43
+ "billing_address" =>
44
+ { "firstname" => "Joe" ,
45
+ "lastname" => "Smith" ,
46
+ "address1" => "1234 Awesome Street" ,
47
+ "address2" => "" ,
48
+ "zipcode" => "90210" ,
49
+ "state" => "California" ,
50
+ "country" => "US" ,
51
+ "phone" => "0000000000" }
60
52
} . merge ( order_extra_fields ) . with_indifferent_access
61
53
end
62
54
0 commit comments