@@ -59,9 +59,9 @@ def build_seller
59
59
60
60
def order_attributes
61
61
{
62
- id : self . transaction . id . to_s ,
62
+ id : self . transaction . id . to_s [ 0 .. 99 ] ,
63
63
total_amount : self . attributes [ :amount ] / 100.0 ,
64
- visitor : self . attributes . dig ( :metadata , :contribution_id ) . to_s ,
64
+ visitor : self . attributes . dig ( :metadata , :contribution_id ) . to_s [ 0 .. 40 ] ,
65
65
currency : 'BRL' ,
66
66
installments : self . attributes [ :installments ] ,
67
67
purchased_at : self . transaction . date_created ,
@@ -74,10 +74,10 @@ def customer_attributes
74
74
tax_id = customer [ :document_number ] . present? ? { tax_id : customer [ :document_number ] } : { }
75
75
76
76
{
77
- id : customer [ :id ] . to_s ,
78
- name : customer [ :name ] ,
79
- email : customer [ :email ] ,
80
- phone1 : customer [ :phone ] . to_h . values . join ,
77
+ id : customer [ :id ] . to_s [ 0 .. 99 ] ,
78
+ name : customer [ :name ] . to_s [ 0 .. 99 ] ,
79
+ email : customer [ :email ] . to_s [ 0 .. 99 ] ,
80
+ phone1 : customer [ :phone ] . to_h . values . join . to_s [ 0 .. 99 ] ,
81
81
created_at : self . attributes . dig ( :antifraud_metadata , :register , :registered_at )
82
82
} . merge ( tax_id )
83
83
end
@@ -95,33 +95,33 @@ def payment_attributes
95
95
def billing_address_attributes
96
96
billing_data = self . attributes . dig ( :antifraud_metadata , :billing )
97
97
{
98
- name : self . transaction . card . holder_name ,
99
- address1 : billing_data . dig ( :address , :street ) ,
100
- city : billing_data . dig ( :address , :city ) ,
101
- state : billing_data . dig ( :address , :state ) ,
102
- zip : billing_data . dig ( :address , :zipcode ) ,
103
- country : billing_data . dig ( :address , :country_code ) ,
98
+ name : self . transaction . card . holder_name . to_s [ 0 .. 99 ] ,
99
+ address1 : billing_data . dig ( :address , :street ) . to_s [ 0 .. 254 ] ,
100
+ city : billing_data . dig ( :address , :city ) . to_s [ 0 .. 99 ] ,
101
+ state : billing_data . dig ( :address , :state ) . to_s [ 0 .. 99 ] ,
102
+ zip : billing_data . dig ( :address , :zipcode ) . to_s [ 0 .. 99 ] ,
103
+ country : billing_data . dig ( :address , :country_code ) . to_s [ 0 .. 1 ] ,
104
104
}
105
105
end
106
106
107
107
def shipping_address_attributes
108
108
shipping_data = self . attributes . dig ( :antifraud_metadata , :shipping )
109
109
{
110
- name : shipping_data . dig ( :customer , :name ) ,
111
- address1 : shipping_data . dig ( :address , :street ) ,
112
- city : shipping_data . dig ( :address , :city ) ,
113
- state : shipping_data . dig ( :address , :state ) ,
114
- zip : shipping_data . dig ( :address , :zipcode )
110
+ name : shipping_data . dig ( :customer , :name ) . to_s [ 0 .. 99 ] ,
111
+ address1 : shipping_data . dig ( :address , :street ) . to_s [ 0 .. 254 ] ,
112
+ city : shipping_data . dig ( :address , :city ) . to_s [ 0 .. 99 ] ,
113
+ state : shipping_data . dig ( :address , :state ) . to_s [ 0 .. 99 ] ,
114
+ zip : shipping_data . dig ( :address , :zipcode ) . to_s [ 0 .. 99 ]
115
115
}
116
116
end
117
117
118
118
def item_attributes
119
119
shopping_cart_data = self . attributes . dig ( :antifraud_metadata , :shopping_cart ) . first
120
120
{
121
- sku : self . attributes . dig ( :metadata , :contribution_id ) . to_s ,
122
- product_code : self . attributes . dig ( :metadata , :contribution_id ) . to_s ,
121
+ sku : self . attributes . dig ( :metadata , :contribution_id ) . to_s [ 0 .. 99 ] ,
122
+ product_code : self . attributes . dig ( :metadata , :contribution_id ) . to_s [ 0 .. 99 ] ,
123
123
category : 9999 ,
124
- name : shopping_cart_data [ :name ] ,
124
+ name : shopping_cart_data [ :name ] . to_s [ 0 .. 99 ] ,
125
125
unit_cost : self . attributes [ :amount ] / 100.0 ,
126
126
quantity : 1 ,
127
127
created_at : self . attributes . dig ( :metadata , :project_online ) . to_s [ 0 ..9 ]
@@ -131,8 +131,8 @@ def item_attributes
131
131
def seller_attributes
132
132
event_data = self . attributes . dig ( :antifraud_metadata , :events ) . first
133
133
{
134
- id : event_data [ :id ] ,
135
- name : event_data [ :venue_name ] ,
134
+ id : event_data [ :id ] . to_s [ 0 .. 99 ] ,
135
+ name : event_data [ :venue_name ] . to_s [ 0 .. 99 ] ,
136
136
created_at : event_data [ :date ]
137
137
}
138
138
end
0 commit comments