File tree 4 files changed +33
-0
lines changed
4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ def whitelist_params(params)
78
78
result_hash [ :billing_configuration ] = config unless config . empty?
79
79
end
80
80
81
+ whitelist_shipping_address ( params [ :shipping_address ] ) . tap do |address |
82
+ result_hash [ :shipping_address ] = address unless address . empty?
83
+ end
84
+
81
85
integration_customers = whitelist_integration_customers ( params [ :integration_customers ] )
82
86
result_hash [ :integration_customers ] = integration_customers unless integration_customers . empty?
83
87
@@ -100,6 +104,17 @@ def whitelist_billing_configuration(billing_params)
100
104
)
101
105
end
102
106
107
+ def whitelist_shipping_address ( address )
108
+ ( address || { } ) . slice (
109
+ :address_line1 ,
110
+ :address_line2 ,
111
+ :city ,
112
+ :zipcode ,
113
+ :state ,
114
+ :country ,
115
+ )
116
+ end
117
+
103
118
def whitelist_integration_customers ( integration_customers )
104
119
processed_integration_customers = [ ]
105
120
Original file line number Diff line number Diff line change 28
28
document_locale : 'fr' ,
29
29
}
30
30
end
31
+ shipping_address do
32
+ {
33
+ address_line1 : '5230 Penfield Ave' ,
34
+ city : 'Woodland Hills' ,
35
+ zipcode : '91364' ,
36
+ state : 'CA' ,
37
+ country : 'US' ,
38
+ }
39
+ end
31
40
integration_customers do
32
41
[
33
42
{
Original file line number Diff line number Diff line change 30
30
"document_locale" : " fr" ,
31
31
"provider_payment_methods" : [" card" ]
32
32
},
33
+ "shipping_address" : {
34
+ "address_line1" : " 5230 Penfield Ave" ,
35
+ "city" : " Woodland Hills" ,
36
+ "zipcode" : " 91364" ,
37
+ "state" : " CA" ,
38
+ "country" : " US"
39
+ },
33
40
"integration_customers" : [
34
41
{
35
42
"lago_id" : " 123asd123lkj987lkj" ,
Original file line number Diff line number Diff line change 39
39
expect ( customer . billing_configuration . invoice_grace_period ) . to eq ( 3 )
40
40
expect ( customer . billing_configuration . provider_customer_id ) . to eq ( 'cus_12345' )
41
41
expect ( customer . billing_configuration . provider_payment_methods ) . to eq ( [ 'card' ] )
42
+ expect ( customer . shipping_address . city ) . to eq ( 'Woodland Hills' )
43
+ expect ( customer . shipping_address . country ) . to eq ( 'US' )
42
44
expect ( customer . integration_customers . first . external_customer_id ) . to eq ( '123456789' )
43
45
expect ( customer . integration_customers . first . type ) . to eq ( 'netsuite' )
44
46
expect ( customer . metadata . first . key ) . to eq ( 'key' )
You can’t perform that action at this time.
0 commit comments