My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 104 attachment: dont_use_order_status_code_id_directly.patch (1.9 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
Index: /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/order.rb
===================================================================
--- /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/order.rb (revision 78)
+++ /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/order.rb (working copy)
@@ -559,7 +562,7 @@
#
def run_transaction_paypal_ipn

- status_code = self.order_status_code_id
+ status_code = self.order_status_code.id

# Under normal conditions, the paypal ipn should be confirmed already
# but we can't count on that. Assign a status of 4 (awaiting payment)
@@ -565,7 +568,8 @@
# but we can't count on that. Assign a status of 4 (awaiting payment)
# if the status is still 1 (cart)
if status_code == 1
- self.order_status_code_id = 4
+ new_order_code = OrderStatusCode.find_by_name("ON HOLD - AWAITING PAYMENT")
+ self.order_status_code = new_order_code if new_order_code
self.new_notes = "The order was processed at PayPal but not yet confirmed."
end

@@ -571,7 +575,7 @@

self.save

- self.order_status_code_id
+ self.order_status_code.id

end

@@ -586,7 +590,8 @@
end
end

- self.order_status_code_id = 5
+ new_order_code = OrderStatusCode.find_by_name("ORDERED - PAID - TO SHIP")
+ self.order_status_code = new_order_code if new_order_code
self.new_notes="Order completed."
if Preference.find_by_name('cc_clear_after_order').is_true?
self.account.clear_personal_information
@@ -596,7 +601,8 @@

# Cleans up a failed order
def cleanup_failed(msg)
- self.order_status_code_id = 3
+ new_order_code = OrderStatusCode.find_by_name("ON HOLD - PAYMENT FAILED")
+ self.order_status_code = new_order_code if new_order_code
self.new_notes="Order failed!<br/>#{msg}"
self.save
end

Powered by Google Project Hosting