Clexchange_Funding - Version 1.0

Version Notes

Stable Module

Download this release

Release Info

Developer Dhananjay Goel
Extension Clexchange_Funding
Version 1.0
Comparing to
See all releases


Code changes from version 2.0 to 1.0

Files changed (31) hide show
  1. app/code/community/CLExchange/Clexchangefunding/ApprovalRequired.php +4 -3
  2. app/code/community/CLExchange/Clexchangefunding/Block/Adminhtml/Sales/Order/View/Info/Block.php +26 -0
  3. app/code/community/CLExchange/Clexchangefunding/Block/Form/Clxfunding.php +3 -1
  4. app/code/community/CLExchange/Clexchangefunding/CronExpressionList.php +4 -1
  5. app/code/community/CLExchange/Clexchangefunding/Helper/Data.php +90 -93
  6. app/code/community/CLExchange/Clexchangefunding/IsBestOffer.php +4 -3
  7. app/code/community/CLExchange/Clexchangefunding/Model/CronOrderStatusUpdate.php +91 -10
  8. app/code/community/CLExchange/Clexchangefunding/Model/Observer.php +71 -4
  9. app/code/community/CLExchange/Clexchangefunding/Model/PaymentMethodTitle.php +3 -3
  10. app/code/community/CLExchange/Clexchangefunding/TimeFrames.php +4 -3
  11. app/code/community/CLExchange/Clexchangefunding/controllers/ClxAPIController.php +167 -344
  12. app/code/community/CLExchange/Clexchangefunding/controllers/PaymentController.php +0 -38
  13. app/code/community/CLExchange/Clexchangefunding/etc/config.xml +38 -15
  14. app/code/community/CLExchange/Clexchangefunding/etc/config.xml~ +43 -38
  15. app/code/community/CLExchange/Clexchangefunding/etc/system.xml +1 -1
  16. app/code/community/CLExchange/Clexchangefunding/sql/clxfunding_setup/mysql4-install-1.0.0.0.php +1 -1
  17. app/design/adminhtml/default/default/layout/clxfunding.xml +12 -0
  18. app/design/adminhtml/default/default/template/clxfunding/custom.phtml +27 -0
  19. app/design/frontend/base/default/layout/clxblock.xml +0 -18
  20. app/design/frontend/base/default/template/clxfunding/form/clxfunding.phtml +180 -67
  21. app/design/frontend/base/default/template/clxfunding/form/confirm_user_acceptance.phtml +1 -0
  22. app/design/frontend/base/default/template/clxfunding/form/loan_offer_response.phtml +3 -4
  23. app/design/frontend/base/default/template/clxfunding/form/modal_clxfunding.phtml +60 -108
  24. app/design/frontend/base/default/template/clxfunding/form/user_loan_offer_accept.phtml +1 -1
  25. app/design/frontend/base/default/template/clxfunding/form/user_loan_offer_status.phtml +1 -1
  26. app/locale/en_US/template/email/CLX/email-template/clx_loan_funded_U.html +38 -0
  27. package.xml +5 -5
  28. skin/frontend/base/default/css/Clx/clx_custom.css +14 -0
  29. skin/frontend/base/default/css/Clx/clxloanofferdata.php~ +4 -4
  30. skin/frontend/base/default/css/Clx/clxloantabledata.php~ +2 -2
  31. skin/frontend/base/default/css/Clx/loading11.gif +0 -0
app/code/community/CLExchange/Clexchangefunding/ApprovalRequired.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
2
-
 
 
3
  class CLExchange_Clexchangefunding_ApprovalRequired {
4
- /* here we can update select field values of Approval Required in admin panel under our CLExchange Payment Module tab */
5
-
6
  public function toOptionArray() {
7
  return array(
8
  array('value' => '1', 'label' => Mage::helper('adminhtml')->__('true')),
1
  <?php
2
+ /*
3
+ * Used following to add custom options (key=>value pair) to our configuration parameters like ApprovalRequired,Cron Expressions,Is Best Offer & time frame in admin panel
4
+ */
5
  class CLExchange_Clexchangefunding_ApprovalRequired {
6
+ /* custom values of Approval Required(selectInputField) in admin panel */
 
7
  public function toOptionArray() {
8
  return array(
9
  array('value' => '1', 'label' => Mage::helper('adminhtml')->__('true')),
app/code/community/CLExchange/Clexchangefunding/Block/Adminhtml/Sales/Order/View/Info/Block.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This will return order selected for view by admin in admin panel.(i.e sales/orders & click of view link)
4
+ * & We did this, as we are adding a block for showing current loan application status & block will visible only if customer placed this order using Online loan payment method
5
+ * Check here : app/design/adminhtml/default/default/template/clxfunding/custom.phtml will clarify the code
6
+ */
7
+ class CLExchange_Clexchangefunding_Block_Adminhtml_Sales_Order_View_Info_Block extends Mage_Core_Block_Template {
8
+
9
+ protected $order;
10
+
11
+ public function getOrder() {
12
+ if (is_null($this->order)) {
13
+ if (Mage::registry('current_order')) {
14
+ $order = Mage::registry('current_order');
15
+ }
16
+ elseif (Mage::registry('order')) {
17
+ $order = Mage::registry('order');
18
+ }
19
+ else {
20
+ $order = new Varien_Object();
21
+ }
22
+ $this->order = $order;
23
+ }
24
+ return $this->order;
25
+ }
26
+ }
app/code/community/CLExchange/Clexchangefunding/Block/Form/Clxfunding.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  class CLExchange_Clexchangefunding_Block_Form_Clxfunding extends Mage_Payment_Block_Form {
4
 
5
  protected function _construct() {
1
  <?php
2
+ /*
3
+ * This block contain our js scripts & it will appended on customer checkout.
4
+ */
5
  class CLExchange_Clexchangefunding_Block_Form_Clxfunding extends Mage_Payment_Block_Form {
6
 
7
  protected function _construct() {
app/code/community/CLExchange/Clexchangefunding/CronExpressionList.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
 
 
 
2
  class CLExchange_Clexchangefunding_CronExpressionList
3
  {
4
- /* here we can update select field values of Cron Expression in admin panel under CLExchange Payment Module tab*/
5
  public function toOptionArray()
6
  {
7
  return array(
1
  <?php
2
+ /*
3
+ * Used following to add custom options (key=>value pair) to our configuration parameters like ApprovalRequired,Cron Expressions,Is Best Offer & time frame in admin panel
4
+ */
5
  class CLExchange_Clexchangefunding_CronExpressionList
6
  {
7
+ /* custom values for Cron expression(selectInputField) in admin panel */
8
  public function toOptionArray()
9
  {
10
  return array(
app/code/community/CLExchange/Clexchangefunding/Helper/Data.php CHANGED
@@ -1,99 +1,97 @@
1
  <?php
2
-
 
 
3
  class CLExchange_Clexchangefunding_Helper_Data extends Mage_Core_Helper_Abstract {
4
 
5
- function getPaymentGatewayUrl() {
6
- return Mage::getUrl('clxfunding/payment/gateway', array('_secure' => false));
7
- }
8
- /* Real time loan offer API */
9
- function mastercurlRequestToClxLoanOfferApi($url, $page, $data, $authorizationField) {
10
-
11
- $headers = array(
12
- "POST " . $page . " HTTP/1.1",
13
- "Host:portal.clexchange.io",
14
- "Content-type: application/json",
15
- "Cache-Control: no-cache",
16
- "Authorization: " . $authorizationField,
17
- "Content-length: " . strlen(json_encode($data)),
18
- );
19
-
20
- $ch = curl_init();
21
- curl_setopt($ch, CURLOPT_URL, $url); //setup curl url
22
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //setup auth to basic
23
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
24
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
25
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //setup request header
26
- curl_setopt($ch, CURLOPT_POST, 1); //setup type post
27
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); //post parameters in json format
28
-
29
- $info = curl_exec($ch);
30
-
31
- if (curl_errno($ch)) {
32
- return array('valid' => FALSE, 'Error' => curl_error($ch));
33
- } else {
34
- curl_close($ch);
35
- return array('valid' => TRUE, 'result' => $info);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
- }
38
- /* Create loan Application API */
39
- function mastercurlRequestToClxLoanApplicationApi($url, $page, $data, $authorizationField) {
40
-
41
- $headers = array(
42
- "POST " . $page . " HTTP/1.1",
43
- "Host:portal.clexchange.io",
44
- "Content-type: application/json",
45
- "Cache-Control: no-cache",
46
- "Authorization: " . $authorizationField,
47
- "Content-length: " . strlen(json_encode($data)),
48
- );
49
-
50
- $ch = curl_init();
51
- curl_setopt($ch, CURLOPT_URL, $url);
52
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
53
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
54
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
55
- curl_setopt($ch, CURLOPT_POST, 1);
56
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
57
-
58
- $info = curl_exec($ch);
59
- if (curl_errno($ch)) {
60
- return array('valid' => FALSE, 'Error' => curl_error($ch));
61
- } else {
62
- curl_close($ch);
63
- return array('valid' => TRUE, 'result' => $info);
64
- }
65
- }
66
-
67
- function mastercurlRequestToClxOfferAcceptenceApi($url, $page, $data, $authorizationField) {
68
- $headers = array(
69
- "POST " . $page . " HTTP/1.1",
70
- "Host:portal.clexchange.io",
71
- "Content-type: application/json",
72
- "Cache-Control: no-cache",
73
- "Authorization: " . $authorizationField,
74
- "Content-length: " . strlen(json_encode($data)),
75
- );
76
-
77
- $ch = curl_init();
78
- curl_setopt($ch, CURLOPT_URL, $url);
79
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
80
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
81
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
82
- curl_setopt($ch, CURLOPT_POST, 1);
83
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
84
-
85
- $info = curl_exec($ch);
86
-
87
- if (curl_errno($ch)) {
88
- return array('valid' => FALSE, 'Error' => curl_error($ch));
89
- } else {
90
- curl_close($ch);
91
- return array('valid' => TRUE, 'result' => $info);
92
  }
 
93
  }
94
 
95
  function clxQueueingSystem() {
96
-
97
  $Queue_Authentication_Key = Mage::getStoreConfig('payment/clxfunding/queue_authentication_key');
98
  $Queue_Endpoint = Mage::getStoreConfig('payment/clxfunding/queue_endpoint');
99
  if (isset($Queue_Authentication_Key) && !empty($Queue_Authentication_Key) && isset($Queue_Endpoint) && !empty($Queue_Endpoint)) {
@@ -101,15 +99,15 @@ class CLExchange_Clexchangefunding_Helper_Data extends Mage_Core_Helper_Abstract
101
  "Content-type: application/json",
102
  "Authorization: OAuth " . $Queue_Authentication_Key
103
  );
104
-
105
  $ch = curl_init();
106
  curl_setopt($ch, CURLOPT_URL, $Queue_Endpoint);
107
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
108
  curl_setopt($ch, CURLOPT_TIMEOUT, 60);
109
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
110
-
111
  $info = curl_exec($ch);
112
-
113
  if (curl_errno($ch)) {
114
  return FALSE;
115
  } else {
@@ -125,7 +123,7 @@ class CLExchange_Clexchangefunding_Helper_Data extends Mage_Core_Helper_Abstract
125
  Mage::log('Clx Error : Missing queue authentication key or queue endpoint ');
126
  }
127
  }
128
-
129
  function getAge($date1, $date2) {
130
  $date1 = strtotime($date1);
131
  $date2 = strtotime($date2);
@@ -135,5 +133,4 @@ class CLExchange_Clexchangefunding_Helper_Data extends Mage_Core_Helper_Abstract
135
  }
136
  return $age;
137
  }
138
-
139
  }
1
  <?php
2
+ /*
3
+ * This is a custom helper class, In this we making API request for 1.Getting Loan Offers 2.Creating loan application 3.Getting Loan application Status 4.Getting response from Queue 5.Loan Offer Accept/Reject API request
4
+ */
5
  class CLExchange_Clexchangefunding_Helper_Data extends Mage_Core_Helper_Abstract {
6
 
7
+ /* Following functions are make API request for realtime loan offers,creating loan application etc.
8
+ * Which accepts $url i.e API endpoint ,
9
+ * $data is the customers loan application details &
10
+ * $authorizationField is a authorization key (This is to be set during extension configuration in admin panel)
11
+ */
12
+
13
+ function masterCurlRequestToClxAPIs($api,$data=FALSE,$loanOfferId=FALSE,$applicationId=FALSE){
14
+ $authorizationField = Mage::getStoreConfig('payment/clxfunding/authorization_field');
15
+ $accountId = Mage::getStoreConfig('payment/clxfunding/account_id');
16
+ if(isset($api) && !empty($api)){
17
+ if($api=='create_application'){
18
+ $url = "https://portal.clexchange.io/api/loan-applications";// (Portal) Production environment
19
+ $page = "/api/loan-applications";
20
+ $data['accountId'] = $accountId;
21
+ }else if($api=='get_loan_offer'){
22
+ $url = "https://portal.clexchange.io/api/loan-offers";// (Portal) Production environment
23
+ $page = "/api/loan-offers";
24
+ $data['accountId'] = $accountId;
25
+ }
26
+ else if($api=='loan_offer_accept_or_reject'){
27
+ $url = "https://portal.clexchange.io/api/loan-offers/".$loanOfferId."/loan-applications" ;// (Portal) Production environment
28
+ $page = "/api/loan-offers/" . $loanOfferId . "/loan-applications";
29
+ $data['accountId'] = $accountId;
30
+ if(isset($data['isOfferAccepted'])){
31
+ $data['isOfferAccepted'] = $data['isOfferAccepted']=="1" ? true: false;
32
+ }
33
+ }
34
+ else if($api=='get_current_loan_app_status'){
35
+ $url = "https://portal.clexchange.io/api/partner-customers/loan-applications/$applicationId";// (Portal) Production environment
36
+ $page = "/api/partner-customers/loan-applications/$applicationId";
37
+ $data['accountId'] = $accountId;
38
+ }
39
+ else{
40
+ return array('valid' => FALSE, 'Error' => 'API Error');
41
+ }
42
+
43
+ if(!(isset($data['ssn']) && !empty($data['ssn']))){
44
+ $data['ssn']='';
45
+ }
46
+
47
+ $headers = array(
48
+ "POST " . $page . " HTTP/1.1",
49
+ "Host:portal.clexchange.io",
50
+ "Content-type: application/json",
51
+ "Cache-Control: no-cache",
52
+ "Authorization: " . $authorizationField,
53
+ "Content-length: " . strlen(json_encode($data)),
54
+ );
55
+
56
+ $ch = curl_init();
57
+ curl_setopt($ch, CURLOPT_URL, $url); //setup curl url
58
+ curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //setup auth to basic
59
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
60
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //setup request header
61
+ curl_setopt($ch, CURLOPT_POST, 1); //setup type post
62
+ curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); //post parameters in json format
63
+
64
+ $info = curl_exec($ch);
65
+
66
+ if($api=='get_current_loan_app_status'){
67
+ if (curl_errno($ch)) {
68
+ return FALSE;
69
+ } else {
70
+ curl_close($ch);
71
+ $reponse_data = json_decode($info);
72
+ if (isset($reponse_data) && !empty($reponse_data)) {
73
+ return $reponse_data;
74
+ } else {
75
+ return FALSE;
76
+ }
77
+ }
78
+ }
79
+ else{
80
+ if (curl_errno($ch)) {
81
+ return array('valid' => FALSE, 'Error' => curl_error($ch));
82
+ } else {
83
+ curl_close($ch);
84
+ return array('valid' => TRUE, 'result' => $info);
85
+ }
86
+ }
87
  }
88
+ else{
89
+ return array('valid' => FALSE, 'Error' => 'API Error');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
+
92
  }
93
 
94
  function clxQueueingSystem() {
 
95
  $Queue_Authentication_Key = Mage::getStoreConfig('payment/clxfunding/queue_authentication_key');
96
  $Queue_Endpoint = Mage::getStoreConfig('payment/clxfunding/queue_endpoint');
97
  if (isset($Queue_Authentication_Key) && !empty($Queue_Authentication_Key) && isset($Queue_Endpoint) && !empty($Queue_Endpoint)) {
99
  "Content-type: application/json",
100
  "Authorization: OAuth " . $Queue_Authentication_Key
101
  );
102
+
103
  $ch = curl_init();
104
  curl_setopt($ch, CURLOPT_URL, $Queue_Endpoint);
105
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
106
  curl_setopt($ch, CURLOPT_TIMEOUT, 60);
107
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
108
+
109
  $info = curl_exec($ch);
110
+
111
  if (curl_errno($ch)) {
112
  return FALSE;
113
  } else {
123
  Mage::log('Clx Error : Missing queue authentication key or queue endpoint ');
124
  }
125
  }
126
+ /* This function is for calculating age */
127
  function getAge($date1, $date2) {
128
  $date1 = strtotime($date1);
129
  $date2 = strtotime($date2);
133
  }
134
  return $age;
135
  }
 
136
  }
app/code/community/CLExchange/Clexchangefunding/IsBestOffer.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
2
-
 
 
3
  class CLExchange_Clexchangefunding_IsBestOffer {
4
- /* here we can update select field values of is Best Offer in admin panel under CLExchange Payment Module tab */
5
-
6
  public function toOptionArray() {
7
  return array(
8
  array('value' => '1', 'label' => Mage::helper('adminhtml')->__('true')),
1
  <?php
2
+ /*
3
+ * Used following to add custom options (key=>value pair) to our configuration parameters like ApprovalRequired,Cron Expressions,Is Best Offer & time frame in admin panel
4
+ */
5
  class CLExchange_Clexchangefunding_IsBestOffer {
6
+ /* custom values for IsBestOffer(selectInputField) in admin panel */
 
7
  public function toOptionArray() {
8
  return array(
9
  array('value' => '1', 'label' => Mage::helper('adminhtml')->__('true')),
app/code/community/CLExchange/Clexchangefunding/Model/CronOrderStatusUpdate.php CHANGED
@@ -10,7 +10,7 @@ class CLExchange_Clexchangefunding_Model_CronOrderStatusUpdate {
10
  foreach($QueueResponse->messages as $res)
11
  {
12
  $body = json_decode('{'.$res->body.'}');
13
- if (isset($body->application_status) && isset($body->source_application_Id) && !is_null($body->source_application_Id)) {
14
  $this->commonFunctionToUpdateStatus($body);
15
  }
16
  }
@@ -20,9 +20,7 @@ class CLExchange_Clexchangefunding_Model_CronOrderStatusUpdate {
20
  public function commonFunctionToUpdateStatus($QueueResponse) {
21
  $table_prefix = Mage::getConfig()->getTablePrefix();
22
  $clx_table = $table_prefix . 'clx_loan_application_detail';
23
- $applicationId = $QueueResponse->source_application_Id;
24
- $tmpvar = explode('-',$applicationId);
25
- $applicationId = $tmpvar[0].'-'.ltrim($tmpvar[1], '0');
26
  $clxOrderStatus = $QueueResponse->application_status;
27
  if (isset($applicationId) && !empty($applicationId) && isset($clxOrderStatus) && !empty($clxOrderStatus)) {
28
  $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');
@@ -129,7 +127,11 @@ class CLExchange_Clexchangefunding_Model_CronOrderStatusUpdate {
129
  }
130
  }
131
  }
132
- } else /* response without loan offer */ {
 
 
 
 
133
  if (isset($row['order_id']) && $row['order_id']) {
134
  $order = Mage::getModel('sales/order')->loadByIncrementId($row['order_id']);
135
  if (isset($order) && !empty($order)) {
@@ -143,13 +145,12 @@ class CLExchange_Clexchangefunding_Model_CronOrderStatusUpdate {
143
  );
144
  }
145
  if (($clxOrderStatus == "REJECTED") || ($clxOrderStatus == "LENDER_REJECTED")) {
146
- /* Mail notification to Merchant about loan offer rejection */
147
  $parameters = array('applicationId' => $applicationId, 'orderNumber' => $row['order_id'], 'customerName' => ucfirst(strtolower($row['firstName'])) . ' ' . ucfirst(strtolower($row['lastName'])));
148
  Mage::getModel('clxfunding/ClxEmail')->sendEmail(
149
  'clx_loan_offerreject_email_template', Mage::getStoreConfig('trans_email/ident_sales/email'), Mage::getStoreConfig('trans_email/ident_sales/name'), 'Loan Application Rejected', $parameters
150
  );
151
-
152
- /* Order Cancel */
153
  if (isset($row['order_id']) && !empty($row['order_id'])) {
154
  $orderModel = Mage::getModel('sales/order');
155
  $orderModel->loadByIncrementId($row['order_id']);
@@ -159,9 +160,9 @@ class CLExchange_Clexchangefunding_Model_CronOrderStatusUpdate {
159
  $orderModel->save();
160
  }
161
  }
162
- /* Order Cancel */
163
  }
164
- /* update custom table with current application status */
165
  $connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
166
  $connectionWrite->beginTransaction();
167
  $data = array();
@@ -172,6 +173,7 @@ class CLExchange_Clexchangefunding_Model_CronOrderStatusUpdate {
172
  $connectionWrite->commit();
173
  }
174
  }
 
175
  }
176
  }
177
  } else {
@@ -330,5 +332,84 @@ class CLExchange_Clexchangefunding_Model_CronOrderStatusUpdate {
330
  }
331
  }
332
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  }
10
  foreach($QueueResponse->messages as $res)
11
  {
12
  $body = json_decode('{'.$res->body.'}');
13
+ if (isset($body->application_status) && isset($body->source_application_Id) && !is_null($body->source_application_id)) {
14
  $this->commonFunctionToUpdateStatus($body);
15
  }
16
  }
20
  public function commonFunctionToUpdateStatus($QueueResponse) {
21
  $table_prefix = Mage::getConfig()->getTablePrefix();
22
  $clx_table = $table_prefix . 'clx_loan_application_detail';
23
+ $applicationId = $QueueResponse->source_application_id;
 
 
24
  $clxOrderStatus = $QueueResponse->application_status;
25
  if (isset($applicationId) && !empty($applicationId) && isset($clxOrderStatus) && !empty($clxOrderStatus)) {
26
  $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');
127
  }
128
  }
129
  }
130
+ }
131
+ else
132
+ {
133
+ /*
134
+ // response without loan offer
135
  if (isset($row['order_id']) && $row['order_id']) {
136
  $order = Mage::getModel('sales/order')->loadByIncrementId($row['order_id']);
137
  if (isset($order) && !empty($order)) {
145
  );
146
  }
147
  if (($clxOrderStatus == "REJECTED") || ($clxOrderStatus == "LENDER_REJECTED")) {
148
+ // Mail notification to Merchant about loan offer rejection
149
  $parameters = array('applicationId' => $applicationId, 'orderNumber' => $row['order_id'], 'customerName' => ucfirst(strtolower($row['firstName'])) . ' ' . ucfirst(strtolower($row['lastName'])));
150
  Mage::getModel('clxfunding/ClxEmail')->sendEmail(
151
  'clx_loan_offerreject_email_template', Mage::getStoreConfig('trans_email/ident_sales/email'), Mage::getStoreConfig('trans_email/ident_sales/name'), 'Loan Application Rejected', $parameters
152
  );
153
+ // Order Cancel
 
154
  if (isset($row['order_id']) && !empty($row['order_id'])) {
155
  $orderModel = Mage::getModel('sales/order');
156
  $orderModel->loadByIncrementId($row['order_id']);
160
  $orderModel->save();
161
  }
162
  }
163
+ // Order Cancel
164
  }
165
+ // update custom table with current application status
166
  $connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
167
  $connectionWrite->beginTransaction();
168
  $data = array();
173
  $connectionWrite->commit();
174
  }
175
  }
176
+ */
177
  }
178
  }
179
  } else {
332
  }
333
  }
334
  }
335
+
336
+ public function aPILoanApplcationStatus()
337
+ {
338
+ $table_prefix = Mage::getConfig()->getTablePrefix();
339
+ $clx_table = $table_prefix . 'clx_loan_application_detail';
340
+ $accountId = Mage::getStoreConfig('payment/clxfunding/account_id');
341
+ $authorizationField = Mage::getStoreConfig('payment/clxfunding/authorization_field');
342
+ $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');
343
+ $select = $connectionRead->select()
344
+ ->from($clx_table, array('*'))
345
+ ->where('status!="FUNDED" and status!="LENDER_REJECTED" and status!="REJECTED" and status!="CUSTOMER_REJECTED" and status!="MERCHANT_REJECTED"');
346
+ $allLoanOrders = $connectionRead->fetchAll($select); //return rows
347
+ foreach ($allLoanOrders as $row) {
348
+ if (isset($row) && !empty($row) && isset($row['clx_loan_application_detail_id'])) {
349
+ $applicationId = $row['application_id'];
350
+ if(isset($applicationId) && !empty($applicationId))
351
+ {
352
+ $API_Response_Arr = Mage::helper('clxfunding')->mastercurlRequestToClxLoanStatusApi($applicationId,$authorizationField);
353
+ if(isset($API_Response_Arr) && !empty($API_Response_Arr) && isset($API_Response_Arr->application_status) && !empty($API_Response_Arr->application_status) && isset($API_Response_Arr->source_application_id) && !empty($API_Response_Arr->source_application_id))
354
+ {
355
+ $clxOrderStatus = $API_Response_Arr->application_status;
356
+ $sourceApplicationId = $API_Response_Arr->source_application_id;
357
+ /*$tmpvar = explode('-',$source_application_id);
358
+ $sourceApplicationId = $tmpvar[0].'-'.ltrim($tmpvar[1], '0');*/
359
+ if($applicationId == $sourceApplicationId)
360
+ {
361
+ if (isset($row['order_id']) && !empty($row['order_id'])) {
362
+ $order = Mage::getModel('sales/order')->loadByIncrementId($row['order_id']);
363
+ if (isset($order) && !empty($order)) {
364
+ if ($clxOrderStatus == "FUNDED") {
365
+ $parameters1 = array(
366
+ 'applicationID' => $applicationId,
367
+ 'orderNumber' => $row['order_id'], //$row['order_id'] is order number
368
+ );
369
+ /* send mail to merchant */
370
+ Mage::getModel('clxfunding/ClxEmail')->sendEmail(
371
+ 'clx_loan_funded_email_template', Mage::getStoreConfig('trans_email/ident_sales/email'), Mage::getStoreConfig('trans_email/ident_sales/name'), 'Loan Offer Funded', $parameters1
372
+ );
373
+ /* send mail to user */
374
+ Mage::getModel('clxfunding/ClxEmail')->sendEmail(
375
+ 'clx_loan_funded_user_email_template', Mage::getStoreConfig('trans_email/ident_sales/email'), $row['emailId'], 'Loan Offer Funded', $parameters1
376
+ );
377
+ }
378
+ if (($clxOrderStatus == "REJECTED") || ($clxOrderStatus == "LENDER_REJECTED")) {
379
+ /* Mail notification to Merchant about loan offer rejection */
380
+ $parameters = array('applicationId' => $applicationId, 'orderNumber' => $row['order_id'], 'customerName' => ucfirst(strtolower($row['firstName'])) . ' ' . ucfirst(strtolower($row['lastName'])));
381
+ Mage::getModel('clxfunding/ClxEmail')->sendEmail(
382
+ 'clx_loan_offerreject_email_template', Mage::getStoreConfig('trans_email/ident_sales/email'), Mage::getStoreConfig('trans_email/ident_sales/name'), 'Loan Application Rejected', $parameters
383
+ );
384
 
385
+ /* Order Cancel */
386
+ if (isset($row['order_id']) && !empty($row['order_id'])) {
387
+ $orderModel = Mage::getModel('sales/order');
388
+ $orderModel->loadByIncrementId($row['order_id']);
389
+ if ($orderModel->canCancel()) {
390
+ $orderModel->cancel();
391
+ $orderModel->setStatus('Reason for cancellation : Lender rejected the loan offer');
392
+ $orderModel->save();
393
+ }
394
+ }
395
+ /* Order Cancel */
396
+ }
397
+ /* update custom table with current application status */
398
+ $connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
399
+ $connectionWrite->beginTransaction();
400
+ $data = array();
401
+ $data['status'] = $clxOrderStatus;
402
+ $data['update_time'] = date('Y-m-d H:i:s');
403
+ $where = $connectionWrite->quoteInto('clx_loan_application_detail_id =?', $row['clx_loan_application_detail_id']);
404
+ $connectionWrite->update($clx_table, $data, $where);
405
+ $connectionWrite->commit();
406
+ }
407
+ }
408
+ }
409
+ }
410
+ }
411
+ }
412
+ }
413
+
414
+ }
415
  }
app/code/community/CLExchange/Clexchangefunding/Model/Observer.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class CLExchange_Clexchangefunding_Model_Observer {
4
  /* This function to check extension configured with all required information, if not Hide CLXFunding else Show */
5
 
6
  public function paymentMethodIsActive(Varien_Event_Observer $observer) {
@@ -33,10 +33,77 @@ class CLExchange_Clexchangefunding_Model_Observer {
33
  Mage::getModel('clxfunding/CronOrderStatusUpdate')->updateClxOrderStatus();
34
  }
35
 
36
- /* Order cancel if customer not responding to loan offer mail notification */
37
-
 
38
  public function timeframeCancelOrder() {
39
- Mage::getModel('clxfunding/CronOrderStatusUpdate')->cancelOrderAfterTimeExpire();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
  }
1
  <?php
2
 
3
+ class CLExchange_Clexchangefunding_Model_Observer{
4
  /* This function to check extension configured with all required information, if not Hide CLXFunding else Show */
5
 
6
  public function paymentMethodIsActive(Varien_Event_Observer $observer) {
33
  Mage::getModel('clxfunding/CronOrderStatusUpdate')->updateClxOrderStatus();
34
  }
35
 
36
+ /* Following function is used for two purposes*/
37
+ /* 1.Order cancel if customer not responding to loan offer mail notification */
38
+ /* 2.Get loan application status*/
39
  public function timeframeCancelOrder() {
40
+ Mage::getModel('clxfunding/CronOrderStatusUpdate')->cancelOrderAfterTimeExpire(); // loan offer mail link expire
41
+ Mage::getModel('clxfunding/CronOrderStatusUpdate')->aPILoanApplcationStatus(); // update loan application status & notify user & merchant accordingly
42
+ }
43
+
44
+ public function getSalesOrderViewInfo(Varien_Event_Observer $observer) {
45
+ $block = $observer->getBlock();
46
+ if (($block->getNameInLayout() == 'order_info') && ($child = $block->getChild('mymodule.order.info.custom.block'))) {
47
+ $transport = $observer->getTransport();
48
+ if ($transport) {
49
+ $html = $transport->getHtml();
50
+ $html .= $child->toHtml();
51
+ $transport->setHtml($html);
52
+ }
53
+ }
54
+ }
55
+ public function addCustomMessage(Varien_Event_Observer $observer)
56
+ {
57
+ $block = $observer->getBlock();
58
+ if ($block->getNameInLayout() == 'sales.order.info.child0') {
59
+ if (Mage::registry('current_order')) {
60
+ $order = Mage::registry('current_order');
61
+ }
62
+ elseif (Mage::registry('order')) {
63
+ $order = Mage::registry('order');
64
+ }
65
+ else {
66
+ $order = new Varien_Object();
67
+ }
68
+
69
+ $clx_status = $this->fetchStatus($order);
70
+ $transport = $observer->getTransport();
71
+ if ($transport) {
72
+ $html = $transport->getHtml();
73
+ if(isset($clx_status) && !empty($clx_status) && $clx_status)
74
+ {
75
+ $clx_status_html = '<br/><b>(Current loan application status for this order is '.$clx_status.')</b>';
76
+ $html.=$clx_status_html;
77
+ }
78
+ $transport->setHtml($html);
79
+ }
80
+ }
81
+
82
+ }
83
+ public function fetchStatus($order){
84
+ $clx_order_id = $order->getRealOrderId();
85
+ if(isset($clx_order_id) && !empty($clx_order_id) && $clx_order_id)
86
+ {
87
+ $table_prefix = Mage::getConfig()->getTablePrefix();
88
+ $clx_table = $table_prefix . 'clx_loan_application_detail';
89
+ $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');
90
+ $select = $connectionRead->select()
91
+ ->from($clx_table, array('*'))
92
+ ->where('order_id=?',$clx_order_id);
93
+ $row = $connectionRead->fetchRow($select); //return rows
94
+ if (isset($row) && !empty($row) && is_array($row) && isset($row['clx_loan_application_detail_id']))
95
+ {
96
+ return $row['status'];
97
+ }
98
+ else
99
+ {
100
+ return FALSE;
101
+ }
102
+ }
103
+ else
104
+ {
105
+ return FALSE;
106
+ }
107
  }
108
 
109
  }
app/code/community/CLExchange/Clexchangefunding/Model/PaymentMethodTitle.php CHANGED
@@ -3,10 +3,10 @@
3
  class CLExchange_Clexchangefunding_Model_PaymentMethodTitle extends Mage_Core_Model_Config_Data {
4
  /* save config in admin panel */
5
  public function save() {
6
- $title = $this->getValue(); //get the value from our config
7
  if (isset($title) && !empty($title) && $title != 'Online Loan') {
8
  Mage::throwException("CLX Message - Please contact CLExchange to change title");
9
- }
10
- return parent::save(); //call original save method so whatever happened
11
  }
12
  }
3
  class CLExchange_Clexchangefunding_Model_PaymentMethodTitle extends Mage_Core_Model_Config_Data {
4
  /* save config in admin panel */
5
  public function save() {
6
+ /*$title = $this->getValue();
7
  if (isset($title) && !empty($title) && $title != 'Online Loan') {
8
  Mage::throwException("CLX Message - Please contact CLExchange to change title");
9
+ }*/
10
+ return parent::save();
11
  }
12
  }
app/code/community/CLExchange/Clexchangefunding/TimeFrames.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
2
-
 
 
3
  class CLExchange_Clexchangefunding_TimeFrames {
4
- /* here we can update select field values of Cron Expression in admin panel under CLExchange Payment Module tab */
5
-
6
  public function toOptionArray() {
7
  return array(
8
  array('value' => '1', 'label' => Mage::helper('adminhtml')->__('24 Hours (1 day)')),
1
  <?php
2
+ /*
3
+ * Used following to add custom options (key=>value pair) to our configuration parameters like ApprovalRequired,Cron Expressions,Is Best Offer & time frame in admin panel
4
+ */
5
  class CLExchange_Clexchangefunding_TimeFrames {
6
+ /* custom values for TimeFrames(selectInputField) in admin panel */
 
7
  public function toOptionArray() {
8
  return array(
9
  array('value' => '1', 'label' => Mage::helper('adminhtml')->__('24 Hours (1 day)')),
app/code/community/CLExchange/Clexchangefunding/controllers/ClxAPIController.php CHANGED
@@ -2,7 +2,6 @@
2
 
3
  class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller_Front_Action {
4
  /* function will receive loan application form data on click of next,previous,check eligibility,submit button */
5
-
6
  public function loanAppProcessingAction() {
7
  if ($this->getRequest()->isXmlHttpRequest()) {
8
  $accountId = Mage::getStoreConfig('payment/clxfunding/account_id'); //get configured accountID from core_config_data
@@ -31,10 +30,6 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
31
  "selfReportedCreditScore" => trim($this->getRequest()->getParam('selfReportedCreditScore')),
32
  "mobilePhoneAreaCode" => trim($this->getRequest()->getParam('mobilePhoneAreaCode')),
33
  "mobileNumber" => trim($this->getRequest()->getParam('mobileNumber')),
34
- "ssn" => trim($this->getRequest()->getParam('ssn')),
35
- "employerName" => trim($this->getRequest()->getParam('employerName')),
36
- "occupation" => trim($this->getRequest()->getParam('occupation')),
37
- "employmentStartDate" => trim($this->getRequest()->getParam('employmentStartDate')),
38
  "bankName" => trim($this->getRequest()->getParam('bankName')),
39
  "firstAccountHolderName" => trim($this->getRequest()->getParam('firstAccountHolderName')),
40
  "bankAccountType" => trim($this->getRequest()->getParam('bankAccountType')),
@@ -43,11 +38,32 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
43
  "accountId" => $accountId,
44
  "currency" => Mage::app()->getStore()->getCurrentCurrencyCode()
45
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  $clx_button_flag = trim($this->getRequest()->getParam('clx_btn_flag'));
47
  $validation_error = array();
48
  /* validators */
49
 
50
- $name_validator = new Zend_Validate_Alpha(array('allowWhiteSpace' => true)); // only alphabets and space
51
  $is_digit = new Zend_Validate_Digits();
52
  $date_validator = new Zend_Validate_Date(); // date yyyy-mm-dd
53
  $is_decimal = new Zend_Validate_Float(); //
@@ -58,39 +74,19 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
58
  $string_length_max_255 = new Zend_Validate_StringLength(array('max' => 255)); //bankName(255max)
59
  $string_length_max_30 = new Zend_Validate_StringLength(array('max' => 30)); //bankAccountNumber(30max)
60
  $string_length_min_max_9 = new Zend_Validate_StringLength(array('min' => 9, 'max' => 9));
61
-
62
- //$states_a = array("Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District Of Columbia", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "American Samoa", "Guam", "Northern Mariana Islands", "Puerto Rico", "United States Minor Outlying", "Islands", "Virgin Islands");
63
- //$employee_status_a = array(1 => "Self Employed", 2 => "Not Employed", 3 => "Other", 4 => "Employed");
64
- //$occupation_a = array(1 => "Accountant/CPA", 2 => "Analyst", 3 => "Architect", 4 => "Attorney", 5 => "Biologist", 6 => "Bus Driver", 7 => "Car Dealer", 8 => "Chemist", 9 => "Civil Service", 10 => "Clergy", 11 => "Clerical", 12 => "Computer Programmer", 13 => "Construction", 14 => "Dentist", 16 => "Doctor", 17 => "Engineer - Chemical
", 18 => "Engineer - Electrical
", 19 => "Engineer - Mechanical
", 20 => "Executive
", 21 => "Fireman
", 22 => "Flight Attendant
", 23 => "Food Service
", 24 => "Food Service Management", 25 => "Homemaker
", 26 => "Judge
", 27 => "Laborer
", 28 => "Landscaping
", 29 => "Medical Technician", 30 => "Military Enlisted", 31 => "Military Officer", 32 => "Nurse (LPN)
", 33 => "Nurse (RN)", 34 => "Nurse's Aide
", 35 => "Pharmacist
", 36 => "Pilot - Private/Commercial
", 37 => "Police Officer/Correction Officer", 38 => "Postal Service
", 39 => "Principal
", 40 => "Professional
", 41 => "Professor
", 42 => "Psychologist
", 43 => "Realtor
", 44 => "Religious
", 45 => "Retail Management
", 47 => "Sales - Commission
", 48 => "Sales - Retail
", 49 => "Scientist
", 50 => "Administrative Assistant
", 52 => "Skilled Labor
", 53 => "Social Worker", 54 => "Student
", 61 => "Teacher
", 62 => "Teacher's Aide
", 63 => "Tradesman - Carpenter", 64 => "Tradesman - Electrician", 65 => "Tradesman - Mechanic", 66 => "Tradesman - Plumber", 67 => "Truck Driver", 69 => "Waiter/Waitress", 70 => "Other
", 71 => "Investor");
65
- //$bankaccounttype_a = array("Savings", "Checking", "Credit");
66
- //$loanpurpose_a = array(1 => "Debt consolidation", 2 => "Home improvement", 3 => "Business", 6 => "Auto", 7 => "Other", 8 => "Baby & adoption loans", 9 => "Boat", 10 => "Cosmetic procedures", 12 => "Green loans", 13 => "Household Expenses", 14 => "Large purchases", 15 => "Medical/Dental", 16 => "Motorcycle", 17 => "RV", 18 => "Taxes", 19 => "Vacation", 21 => "Special Occasion");
67
- //$credit_score_a = array(1 => "Excellent Credit (760+)", 2 => "Good Credit (700+)", 3 => "Fair Credit (640+)", 4 => "Poor Credit");
68
-
69
-
70
  $tab1_fields_key_arr = array("firstName", "lastName", "emailId", "birthDate", "mobilePhoneAreaCode", "mobileNumber", "street", "state", "city", "country", "zipcode", "yearlyIncome", "employmentStatus", "employmentStatus", "employerName", "employmentStartDate", "occupation");
71
  $tab2_fields_key_arr = array("selfReportedCreditScore", "bankName", "firstAccountHolderName", "bankAccountType", "bankAccountNumber", "routingNumber", "ssn");
72
  $tab3_fields_key_arr = array("loanAmount", "loanPurpose", "loanTerms");
73
 
74
-
75
-
76
  /* Personal Information */
77
-
78
  /* firstName */
79
  if (!Zend_Validate::is($formData['firstName'], 'NotEmpty')) {
80
  $validation_error['firstName'] = "This field is required";
81
- } else {
82
- if (!$name_validator->isValid($formData['firstName'])) {
83
- $validation_error['firstName'] = "First name should be string";
84
- }
85
  }
86
 
87
  /* lastName */
88
  if (!Zend_Validate::is($formData['lastName'], 'NotEmpty')) {
89
  $validation_error['lastName'] = "This field is required";
90
- } else {
91
- if (!$name_validator->isValid($formData['lastName'])) {
92
- $validation_error['lastName'] = "Last name should be string";
93
- }
94
  }
95
 
96
  /* emailId */
@@ -189,33 +185,32 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
189
  $validation_error['employmentStatus'] = "This field is required";
190
  }
191
  /* employerName */
192
- if (!Zend_Validate::is($formData['employerName'], 'NotEmpty')) {
193
- $validation_error['employerName'] = "This field is required";
194
- } else {
195
- if (!$string_length_max_100->isValid($formData['employerName'])) {// string length <=100
196
- $validation_error['employerName'] = "String length should be less than 100";
 
 
197
  }
198
  }
199
 
200
  /* employmentStartDate */
201
- if (!Zend_Validate::is($formData['employmentStartDate'], 'NotEmpty')) {
202
- $validation_error['employmentStartDate'] = "This field is required";
203
- } else {
204
- if (!$date_validator->isValid($formData['employmentStartDate'])) {
205
- $validation_error['employmentStartDate'] = "Invalid date format";
206
- }
207
- /*
208
- if (isset($formData['birthDate']) && (strtotime($formData['employmentStartDate']) > strtotime($formData['birthDate']))) {
209
- $cl_age = Mage::helper('clxfunding')->getAge($formData['birthDate'], $formData['employmentStartDate']); // child labour 14
210
- if ($cl_age < 14) {
211
- $validation_error['employmentStartDate'] = "";
212
  }
213
- }*/
214
  }
215
 
216
  /* occupation */
217
- if (!Zend_Validate::is($formData['occupation'], 'NotEmpty')) {
218
- $validation_error['occupation'] = "This field is required";
 
 
219
  }
220
 
221
  /* End- Personal Information */
@@ -230,7 +225,7 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
230
  if (!Zend_Validate::is($formData['bankName'], 'NotEmpty')) {
231
  $validation_error['bankName'] = "This field is required";
232
  } else {
233
- if (!$string_length_max_255->isValid($formData['employerName'])) {// string length <=255
234
  $validation_error['bankName'] = "String length should be less than 255";
235
  }
236
  }
@@ -266,15 +261,14 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
266
 
267
 
268
  /* ssn */
269
- if (!Zend_Validate::is($formData['ssn'], 'NotEmpty')) {
270
- $validation_error['ssn'] = "This field is required";
271
- } else {
272
- if (!$string_length_min_max_9->isValid($formData['ssn'])) {
273
- $validation_error['ssn'] = "Please enter a valid 9 digit SSN (for example xxxxxxxxx)";
274
- }
275
- if(!$is_digit->isValid($formData['ssn']))
276
- {
277
- $validation_error['ssn'] = "Please enter a valid 9 digit SSN (for example xxxxxxxxx)";
278
  }
279
  }
280
 
@@ -352,14 +346,10 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
352
  $grandTotal = $quoteData['grand_total'];
353
 
354
  $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
355
- $applicationId = "APP-" . $quoteId;
356
- if (isset($quoteId) && !empty($quoteId) && isset($applicationId) && $applicationId != 'APP-') {
357
- Mage::getSingleton('checkout/session')->setClxQuoteParam($quoteId);
358
- Mage::getSingleton('checkout/session')->setClxApplicationIdParam($applicationId);
359
- }
360
-
361
  $clx_button_flag = trim($this->getRequest()->getParam('clx_btn_flag'));
362
- if (isset($accountId) && isset($authorizationField) && isset($applicationId)) {
 
363
  /* loan application form data */
364
  $data = array(
365
  "firstName" => trim($this->getRequest()->getParam('firstName')),
@@ -379,10 +369,6 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
379
  "selfReportedCreditScore" => intval(trim($this->getRequest()->getParam('selfReportedCreditScore'))),
380
  "mobilePhoneAreaCode" => trim($this->getRequest()->getParam('mobilePhoneAreaCode')),
381
  "mobileNumber" => trim($this->getRequest()->getParam('mobileNumber')),
382
- "ssn" => trim($this->getRequest()->getParam('ssn')),
383
- "employerName" => trim($this->getRequest()->getParam('employerName')),
384
- "occupation" => trim($this->getRequest()->getParam('occupation')),
385
- "employmentStartDate" => trim($this->getRequest()->getParam('employmentStartDate')),
386
  "bankName" => trim($this->getRequest()->getParam('bankName')),
387
  "firstAccountHolderName" => trim($this->getRequest()->getParam('firstAccountHolderName')),
388
  "bankAccountType" => trim($this->getRequest()->getParam('bankAccountType')),
@@ -390,22 +376,44 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
390
  "routingNumber" => trim($this->getRequest()->getParam('routingNumber')),
391
  "currency" => Mage::app()->getStore()->getCurrentCurrencyCode()
392
  );
393
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  /* to save loan application form data to custom clx table */
395
  $clx_loan_application_data = $data;
396
  $clx_loan_application_data['application_id'] = $applicationId;
 
397
  $clx_loan_application_data['quote_id'] = $quoteId;
398
  Mage::getSingleton('checkout/session')->setLoanApplicationDataToSave($clx_loan_application_data);
 
399
  /* to save loan application form data to custom clx table */
400
-
401
- $data['accountId'] = $accountId;
402
  if (isset($clx_button_flag) && !empty($clx_button_flag)) {
403
  if ($clx_button_flag == 'check_eligibility') {
404
  $data['isBestOffer'] = (isset($isBestOffer) && $isBestOffer=="1")?TRUE:FALSE;
405
- //$data['applicationId'] = $applicationId;
406
- $url = "http://portal.clexchange.io/api/loan-offers";
407
- $page = "/api/loan-offers";
408
- $result = Mage::helper('clxfunding')->mastercurlRequestToClxLoanOfferApi($url, $page, $data, $authorizationField);
409
  if (isset($result['valid']) && $result['valid']) {
410
  if (isset($result['result'])) {
411
  $api_response = json_decode($result['result']);
@@ -426,6 +434,7 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
426
  }
427
  }
428
  }
 
429
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/loan_offer_response.phtml'));
430
  $block->setLoanOffers(json_decode($result['result']));
431
  $myHtml = $block->toHtml();
@@ -436,12 +445,9 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
436
  Mage_Core_Controller_Varien_Action::_redirectUrl(Mage::getBaseUrl());
437
  }
438
  } else {
439
-
440
- $url = "http://portal.clexchange.io/api/loan-applications";
441
- $page = "/api/loan-applications";
442
- $data['applicationId'] = $applicationId;
443
- $result = Mage::helper('clxfunding')->mastercurlRequestToClxLoanApplicationApi($url, $page, $data, $authorizationField);
444
  if (isset($result['valid']) && $result['valid']) {
 
445
  if (isset($result['result'])) {
446
  $api_response = json_decode($result['result']);
447
  if (isset($api_response->application_status) && $api_response->application_status == "REJECTED") {
@@ -526,92 +532,63 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
526
  Mage::getSingleton('checkout/session')->unsLoanOfferFlag();
527
  Mage::getSingleton('checkout/session')->unsLoanApplicationFlag();
528
 
529
- if (isset($LoanOfferFlag) && $LoanOfferFlag) {
530
- $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
531
-
532
- Mage::getSingleton('checkout/session')->setClxOfferQuoteId($quoteId);
533
- Mage::getSingleton('checkout/session')->setClxOfferApplicationId("APP-" . $quoteId);
534
-
535
- Mage::getSingleton('checkout/session')->setLoanOfferConfirmAcceptance(true);
536
-
537
  $formData = unserialize(Mage::getSingleton('checkout/session')->getLoanApplicationData());
538
- $temp_var = Mage::getSingleton('checkout/session')->getLoanOfferConfirmAcceptance();
539
- $accountId = Mage::getStoreConfig('payment/clxfunding/account_id');
540
- $authorizationField = Mage::getStoreConfig('payment/clxfunding/authorization_field');
541
- $isBestOffer = Mage::getStoreConfig('payment/clxfunding/is_Best_Offer');
542
-
543
- $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
544
- $applicationId = "APP-" . $quoteId;
545
-
546
- if (isset($quoteId) && !empty($quoteId) && isset($applicationId) && $applicationId != 'APP-') {
547
- Mage::getSingleton('checkout/session')->setClxQuoteParam($quoteId);
548
- Mage::getSingleton('checkout/session')->setClxApplicationIdParam($applicationId);
549
- $quote = Mage::getModel('checkout/session')->getQuote();
550
- $quoteData = $quote->getData();
551
- if (isset($quoteData['grand_total'])) {
552
- $grandTotal = $quoteData['grand_total'];
553
- }
554
- } else {
555
- $quoteId = Mage::getSingleton('checkout/session')->getClxOfferQuoteId();
556
- $applicationId = Mage::getSingleton('checkout/session')->getClxOfferApplicationId();
557
- Mage::getSingleton('checkout/session')->unsClxOfferQuoteId();
558
- Mage::getSingleton('checkout/session')->unsClxOfferApplicationId();
559
- Mage::getSingleton('checkout/session')->setClxOfferQuoteId_New($quoteId);
560
- Mage::getSingleton('checkout/session')->setClxOfferApplicationId_New($applicationId);
561
- $quote = Mage::getModel('sales/quote')->load($quoteId);
562
  $quoteData = $quote->getData();
563
  if (isset($quoteData['grand_total'])) {
564
  $grandTotal = $quoteData['grand_total'];
565
  }
566
- }
567
-
568
- Mage::getSingleton('checkout/session')->unsLoanOfferConfirmAcceptance();
569
- Mage::getSingleton('checkout/session')->unsLoanApplicationData();
570
-
571
- if (isset($temp_var) && $temp_var && isset($formData) && !empty($formData)) {
572
  $data = array(
573
- "firstName" => trim($formData['firstName']),
574
- "lastName" => trim($formData['lastName']),
575
- "emailId" => trim($formData['emailId']),
576
- "birthDate" => trim($formData['birthDate']),
577
- "street" => trim($formData['street']),
578
- "city" => trim($formData['city']),
579
- "country" => trim($formData['country']),
580
- "state" => trim($formData['state']),
581
- "zipcode" => trim($formData['zipcode']),
582
- "loanAmount" => floatval($grandTotal),
583
- "loanPurpose" => trim($formData['loanPurpose']),
584
  "loanTerms" => floatval(trim($formData['loanTerms'])),
585
  "yearlyIncome" => floatval(trim($formData['yearlyIncome'])),
586
- "employmentStatus" => trim($formData['employmentStatus']),
587
  "selfReportedCreditScore" => intval(trim($formData['selfReportedCreditScore'])),
588
- "mobilePhoneAreaCode" => trim($formData['mobilePhoneAreaCode']),
589
- "mobileNumber" => trim($formData['mobileNumber']),
590
- "ssn" => trim($formData['ssn']),
591
- "employerName" => trim($formData['employerName']),
592
- "occupation" => trim($formData['occupation']),
593
- "employmentStartDate" => trim($formData['employmentStartDate']),
594
- "bankName" => trim($formData['bankName']),
595
- "firstAccountHolderName" => trim($formData['firstAccountHolderName']),
596
- "bankAccountType" => trim($formData['bankAccountType']),
597
- "bankAccountNumber" => trim($formData['bankAccountNumber']),
598
- "routingNumber" => trim($formData['routingNumber']),
599
- "accountId" => $accountId,
600
- "loanOfferId" => trim($formData['loanOfferId']),
601
- "currency" => Mage::app()->getStore()->getCurrentCurrencyCode()
602
  );
 
 
 
 
 
 
 
 
603
 
604
-
605
- $url = "http://portal.clexchange.io/api/loan-offers/" . $data['loanOfferId'] . "/loan-applications";
606
  $page = "/api/loan-offers/" . $data['loanOfferId'] . "/loan-applications";
607
- $data['applicationId'] = $applicationId;
608
- $data['isOfferAccepted'] = true;
609
 
 
 
610
  $formData['application_id'] = $applicationId;
 
611
  $formData['quote_id'] = $quoteId;
612
  Mage::getSingleton('checkout/session')->setLoanApplicationDataToSave($formData);
613
-
614
- $result = Mage::helper('clxfunding')->mastercurlRequestToClxOfferAcceptenceApi($url, $page, $data, $authorizationField);
615
  if ($result['valid']) {
616
  if (isset($result['result'])) {
617
  $this->loadLayout();
@@ -624,41 +601,23 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
624
  } else {
625
  Mage_Core_Controller_Varien_Action::_redirectUrl(Mage::getBaseUrl());
626
  }
627
-
628
- /*
629
- $this->loadLayout();
630
- $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/confirm_user_acceptance.phtml'));
631
- $this->getLayout()->getBlock('content')->append($block);
632
- $this->renderLayout();
633
- */
634
-
635
  } else if (isset($loanApplicationFlag) && $loanApplicationFlag) {
 
636
  $approve_required = Mage::getStoreConfig('payment/clxfunding/approve_Required'); // user approve required
637
  $clx_status_track_model = Mage::getModel('clxfunding/CronOrderStatusUpdate'); // load clx status update model
638
 
639
  $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
640
- $applicationId = "APP-" . $quoteId;
641
-
642
- $clx_quoteid = Mage::getSingleton('checkout/session')->getClxQuoteParam();
643
- Mage::getSingleton('checkout/session')->unsClxQuoteParam();
644
- $clx_applicationid = Mage::getSingleton('checkout/session')->getClxApplicationIdParam();
645
- Mage::getSingleton('checkout/session')->unsClxApplicationIdParam();
646
-
647
- if (isset($quoteId) && isset($applicationId) && $applicationId != 'APP-' && isset($clx_quoteid) && isset($clx_applicationid) && $quoteId == $clx_quoteid && $applicationId == $clx_applicationid) {
648
  $order = new Mage_Sales_Model_Order();
649
  $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
650
  $order->loadByIncrementId($orderId);
651
  $order->setState(Mage_Sales_Model_Order::STATE_NEW, true, 'Loan Application Approved.');
652
 
653
- $customer_email = $order['customer_email'];
654
- $customer_firstname = $order['customer_firstname'];
655
- $customer_lastname = $order['customer_lastname'];
656
-
657
  $loanAppFlag = 0;
658
  if (isset($approve_required) && $approve_required) {
659
  $loanAppFlag = 1;
660
- } else {
661
-
662
  }
663
 
664
  try {
@@ -667,15 +626,12 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
667
  Mage::logException($ex);
668
  }
669
  $order->save();
670
-
671
- $clx_loan_application_data = Mage::getSingleton('checkout/session')->getLoanApplicationDataToSave();
672
  $clx_loan_application_data['order_id'] = $orderId;
673
  $clx_loan_application_data['status'] = 'PENDING';
674
  $clx_loan_application_data['approvalRequired_flag'] = $loanAppFlag;
675
  $clx_status_track_model->saveLoanApplicationDetails($clx_loan_application_data);
676
  Mage::getSingleton('checkout/session')->unsLoanApplicationDataToSave();
677
-
678
- Mage::getSingleton('checkout/session')->unsQuoteId();
679
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => false));
680
  } else {
681
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure' => false));
@@ -686,28 +642,12 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
686
  }
687
 
688
  function saveOrderCustomAction() {
689
- $sess_quoteId = Mage::getSingleton('checkout/session')->getClxOfferQuoteId_New();
690
- Mage::getSingleton('checkout/session')->unsClxOfferQuoteId_New();
691
- $sess_applicationId = Mage::getSingleton('checkout/session')->getClxOfferApplicationId_New();
692
- Mage::getSingleton('checkout/session')->unsClxOfferApplicationId_New();
693
-
694
  $clx_status_track_model = Mage::getModel('clxfunding/CronOrderStatusUpdate'); // load clx status update model
695
-
696
  $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
697
- $applicationId = "APP-" . $quoteId;
698
-
699
- $clx_quoteid = Mage::getSingleton('checkout/session')->getClxQuoteParam();
700
- Mage::getSingleton('checkout/session')->unsClxQuoteParam();
701
- $clx_applicationid = Mage::getSingleton('checkout/session')->getClxApplicationIdParam();
702
- Mage::getSingleton('checkout/session')->unsClxApplicationIdParam();
703
-
704
  $order = new Mage_Sales_Model_Order();
705
  $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
706
  $order->loadByIncrementId($orderId);
707
  $order->setState(Mage_Sales_Model_Order::STATE_NEW, true, 'Loan Application Approved.');
708
- $customer_email = $order['customer_email'];
709
- $customer_firstname = $order['customer_firstname'];
710
- $customer_lastname = $order['customer_lastname'];
711
  try {
712
  $order->sendNewOrderEmail();
713
  } catch (Exception $ex) {
@@ -717,131 +657,18 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
717
 
718
  $clx_loan_application_data = Mage::getSingleton('checkout/session')->getLoanApplicationDataToSave();
719
  $clx_loan_application_data['order_id'] = $orderId;
 
720
  $clx_loan_application_data['status'] = 'PENDING';
721
  $clx_loan_application_data['approvalRequired_flag'] = 0;
722
  $clx_loan_application_data['offer_acceptance_flag'] = true;
723
  $clx_status_track_model->saveLoanApplicationDetails($clx_loan_application_data);
724
  Mage::getSingleton('checkout/session')->unsLoanApplicationDataToSave();
725
-
726
- if (isset($quoteId) && !empty($quoteId) && isset($applicationId) && $applicationId != 'APP-') {
727
- Mage::getSingleton('checkout/session')->unsQuoteId();
728
- Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => false));
729
- } else if (isset($sess_quoteId) && !empty($sess_quoteId) && isset($sess_applicationId) && $sess_applicationId != 'APP-') {
730
- Mage::getSingleton('checkout/session')->unsQuoteId();
731
- Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => false));
732
- }else if (isset($clx_quoteid) && !empty($clx_quoteid) && isset($clx_applicationid) && $clx_applicationid != 'APP-') {
733
- Mage::getSingleton('checkout/session')->unsQuoteId();
734
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => false));
735
  }else {
736
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure' => false));
737
  }
738
  }
739
-
740
- function checkLoanOfferAcceptanceStatusAction() {
741
- $formData = unserialize(Mage::getSingleton('checkout/session')->getLoanApplicationData());
742
- $temp_var = Mage::getSingleton('checkout/session')->getLoanOfferConfirmAcceptance();
743
- $accountId = Mage::getStoreConfig('payment/clxfunding/account_id');
744
- $authorizationField = Mage::getStoreConfig('payment/clxfunding/authorization_field');
745
- $isBestOffer = Mage::getStoreConfig('payment/clxfunding/is_Best_Offer');
746
-
747
- $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
748
- $applicationId = "APP-" . $quoteId;
749
-
750
- if (isset($quoteId) && !empty($quoteId) && isset($applicationId) && $applicationId != 'APP-') {
751
- Mage::getSingleton('checkout/session')->setClxQuoteParam($quoteId);
752
- Mage::getSingleton('checkout/session')->setClxApplicationIdParam($applicationId);
753
- $quote = Mage::getModel('checkout/session')->getQuote();
754
- $quoteData = $quote->getData();
755
- if (isset($quoteData['grand_total'])) {
756
- $grandTotal = $quoteData['grand_total'];
757
- }
758
- } else {
759
- $quoteId = Mage::getSingleton('checkout/session')->getClxOfferQuoteId();
760
- $applicationId = Mage::getSingleton('checkout/session')->getClxOfferApplicationId();
761
- Mage::getSingleton('checkout/session')->unsClxOfferQuoteId();
762
- Mage::getSingleton('checkout/session')->unsClxOfferApplicationId();
763
- Mage::getSingleton('checkout/session')->setClxOfferQuoteId_New($quoteId);
764
- Mage::getSingleton('checkout/session')->setClxOfferApplicationId_New($applicationId);
765
- $quote = Mage::getModel('sales/quote')->load($quoteId);
766
- $quoteData = $quote->getData();
767
- if (isset($quoteData['grand_total'])) {
768
- $grandTotal = $quoteData['grand_total'];
769
- }
770
- }
771
-
772
- Mage::getSingleton('checkout/session')->unsLoanOfferConfirmAcceptance();
773
- Mage::getSingleton('checkout/session')->unsLoanApplicationData();
774
-
775
- if (isset($temp_var) && $temp_var && isset($formData) && !empty($formData)) {
776
- $data = array(
777
- "firstName" => trim($formData['firstName']),
778
- "lastName" => trim($formData['lastName']),
779
- "emailId" => trim($formData['emailId']),
780
- "birthDate" => trim($formData['birthDate']),
781
- "street" => trim($formData['street']),
782
- "city" => trim($formData['city']),
783
- "country" => trim($formData['country']),
784
- "state" => trim($formData['state']),
785
- "zipcode" => trim($formData['zipcode']),
786
- "loanAmount" => floatval($grandTotal),
787
- "loanPurpose" => trim($formData['loanPurpose']),
788
- "loanTerms" => floatval(trim($formData['loanTerms'])),
789
- "yearlyIncome" => floatval(trim($formData['yearlyIncome'])),
790
- "employmentStatus" => trim($formData['employmentStatus']),
791
- "selfReportedCreditScore" => intval(trim($formData['selfReportedCreditScore'])),
792
- "mobilePhoneAreaCode" => trim($formData['mobilePhoneAreaCode']),
793
- "mobileNumber" => trim($formData['mobileNumber']),
794
- "ssn" => trim($formData['ssn']),
795
- "employerName" => trim($formData['employerName']),
796
- "occupation" => trim($formData['occupation']),
797
- "employmentStartDate" => trim($formData['employmentStartDate']),
798
- "bankName" => trim($formData['bankName']),
799
- "firstAccountHolderName" => trim($formData['firstAccountHolderName']),
800
- "bankAccountType" => trim($formData['bankAccountType']),
801
- "bankAccountNumber" => trim($formData['bankAccountNumber']),
802
- "routingNumber" => trim($formData['routingNumber']),
803
- "accountId" => $accountId,
804
- "loanOfferId" => trim($formData['loanOfferId']),
805
- "currency" => Mage::app()->getStore()->getCurrentCurrencyCode()
806
- );
807
-
808
-
809
- $url = "http://portal.clexchange.io/api/loan-offers/" . $data['loanOfferId'] . "/loan-applications";
810
- $page = "/api/loan-offers/" . $data['loanOfferId'] . "/loan-applications";
811
- $data['applicationId'] = $applicationId;
812
- $data['isOfferAccepted'] = true;
813
-
814
- $formData['application_id'] = $applicationId;
815
- $formData['quote_id'] = $quoteId;
816
- Mage::getSingleton('checkout/session')->setLoanApplicationDataToSave($formData);
817
-
818
- $result = Mage::helper('clxfunding')->mastercurlRequestToClxOfferAcceptenceApi($url, $page, $data, $authorizationField);
819
- if ($result['valid']) {
820
- if (isset($result['result'])) {
821
- /*
822
- $clxOfferAcceptRes = json_decode($result['result']);
823
- if ($clxOfferAcceptRes->application_status == "REJECTED")
824
- {
825
- $orderModel = Mage::getModel('sales/order');
826
- $orderModel->loadByIncrementId($row['order_id']);
827
- if ($orderModel->canCancel()) {
828
- $orderModel->cancel();
829
- $orderModel->setStatus('Reason for cancellation : Lender rejected the loan offer');
830
- $orderModel->save();
831
- }
832
- }*/
833
- $this->loadLayout();
834
- $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/user_loan_offer_accept.phtml'));
835
- $block->setLoanOfferStatus(json_decode($result['result']));
836
- $this->getLayout()->getBlock('content')->append($block);
837
- $this->renderLayout();
838
- }
839
- }
840
- } else {
841
- Mage_Core_Controller_Varien_Action::_redirectUrl(Mage::getBaseUrl());
842
- }
843
- }
844
-
845
  function getLoanApplicationFormAction() {
846
  $quote = Mage::getModel('checkout/session')->getQuote();
847
  $quoteData = $quote->getData();
@@ -857,6 +684,31 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
857
  $myHtml = $block->toHtml();
858
  echo json_encode(array('valid' => TRUE, 'loan_app_view' => $myHtml));
859
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
860
 
861
  function loanOfferRejectAction() {
862
  $applicationId = $this->getRequest()->getParam('applicationId');
@@ -879,16 +731,20 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
879
  unset($new_data['clx_loan_application_detail_id'], $new_data['order_id'], $new_data['application_id'], $new_data['quote_id'], $new_data['approvalRequired_flag'], $new_data['status'], $new_data['created_time'], $new_data['update_time']);
880
  $accountId = Mage::getStoreConfig('payment/clxfunding/account_id');
881
  $authorizationField = Mage::getStoreConfig('payment/clxfunding/authorization_field');
 
 
 
 
 
 
 
882
  $new_data['accountId'] = $accountId;
883
  $new_data['loanOfferId'] = $loanOfferId;
884
  $new_data['applicationId'] = $applicationId;
885
  $new_data['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
886
  $new_data['isOfferAccepted'] = FALSE;
887
-
888
- $url = "http://portal.clexchange.io/api/loan-offers/" . $new_data['loanOfferId'] . "/loan-applications";
889
- $page = "/api/loan-offers/" . $new_data['loanOfferId'] . "/loan-applications";
890
-
891
- $result = Mage::helper('clxfunding')->mastercurlRequestToClxOfferAcceptenceApi($url, $page, $new_data, $authorizationField);
892
  if (isset($result['result']) && $result['result']) {
893
  /* Mail notification to Merchant about loan offer rejected by customer */
894
  $parameters = array('applicationId' => $applicationId, 'orderNumber' => $row['order_id'], 'customerName' => ucfirst(strtolower($row['firstName'])) . ' ' . ucfirst(strtolower($row['lastName'])));
@@ -925,8 +781,6 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
925
  }
926
  /* Order Cancel */
927
 
928
-
929
-
930
  /* Notification on FrontEnd */
931
  $this->loadLayout();
932
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/user_loan_offer_reject.phtml'));
@@ -941,7 +795,6 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
941
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/link_Expire.phtml'));
942
  $this->getLayout()->getBlock('content')->append($block);
943
  $this->renderLayout();
944
- //Mage_Core_Controller_Varien_Action::_redirectUrl(Mage::getBaseUrl());
945
  }
946
  } else {
947
  $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');
@@ -977,11 +830,7 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
977
  $new_data['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
978
 
979
  $new_data['isOfferAccepted'] = TRUE;
980
-
981
- $url = "http://portal.clexchange.io/api/loan-offers/" . $new_data['loanOfferId'] . "/loan-applications";
982
- $page = "/api/loan-offers/" . $new_data['loanOfferId'] . "/loan-applications";
983
-
984
- $result = Mage::helper('clxfunding')->mastercurlRequestToClxOfferAcceptenceApi($url, $page, $new_data, $authorizationField);
985
  if (isset($result['result']) && $result['result']) {
986
  $clxOfferAcceptRes = json_decode($result['result']);
987
  if ($clxOfferAcceptRes->application_status == "ACCEPTED") {
@@ -1012,10 +861,6 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
1012
  $connectionWrite->update($clx_table, $data, $where);
1013
  $connectionWrite->commit();
1014
 
1015
- /* loan offer reject on accept by lender */
1016
-
1017
-
1018
- /* loan offer reject on accept by lender */
1019
  } else {
1020
 
1021
  }
@@ -1033,7 +878,6 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
1033
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/link_Expire.phtml'));
1034
  $this->getLayout()->getBlock('content')->append($block);
1035
  $this->renderLayout();
1036
- //Mage_Core_Controller_Varien_Action::_redirectUrl(Mage::getBaseUrl());
1037
  }
1038
  } else {
1039
  $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');
@@ -1046,25 +890,4 @@ class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller
1046
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/aboutCLXFunding.phtml'));
1047
  echo $block->toHtml();
1048
  }
1049
-
1050
- public function QueueResAction() {
1051
- $Queue_Authentication_Key = Mage::getStoreConfig('payment/clxfunding/queue_authentication_key');
1052
- $Queue_Endpoint = Mage::getStoreConfig('payment/clxfunding/queue_endpoint');
1053
- if (isset($Queue_Authentication_Key) && !empty($Queue_Authentication_Key) && isset($Queue_Endpoint) && !empty($Queue_Endpoint)) {
1054
-
1055
- $headers = array(
1056
- "Content-type: application/json",
1057
- "Authorization: OAuth " . $Queue_Authentication_Key
1058
- );
1059
-
1060
- $ch = curl_init();
1061
- curl_setopt($ch, CURLOPT_URL, $Queue_Endpoint);
1062
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1063
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
1064
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
1065
-
1066
- echo $info = curl_exec($ch);
1067
- }
1068
- }
1069
-
1070
  }
2
 
3
  class CLExchange_Clexchangefunding_ClxAPIController extends Mage_Core_Controller_Front_Action {
4
  /* function will receive loan application form data on click of next,previous,check eligibility,submit button */
 
5
  public function loanAppProcessingAction() {
6
  if ($this->getRequest()->isXmlHttpRequest()) {
7
  $accountId = Mage::getStoreConfig('payment/clxfunding/account_id'); //get configured accountID from core_config_data
30
  "selfReportedCreditScore" => trim($this->getRequest()->getParam('selfReportedCreditScore')),
31
  "mobilePhoneAreaCode" => trim($this->getRequest()->getParam('mobilePhoneAreaCode')),
32
  "mobileNumber" => trim($this->getRequest()->getParam('mobileNumber')),
 
 
 
 
33
  "bankName" => trim($this->getRequest()->getParam('bankName')),
34
  "firstAccountHolderName" => trim($this->getRequest()->getParam('firstAccountHolderName')),
35
  "bankAccountType" => trim($this->getRequest()->getParam('bankAccountType')),
38
  "accountId" => $accountId,
39
  "currency" => Mage::app()->getStore()->getCurrentCurrencyCode()
40
  );
41
+ $ssn = $this->getRequest()->getParam('ssn');
42
+ if(isset($ssn)){
43
+ $formData['ssn'] = trim($ssn);
44
+ }
45
+
46
+ if(isset($formData['employmentStatus']) && $formData['employmentStatus']!='Not Employed'){
47
+ $employerName = $this->getRequest()->getParam('employerName');
48
+ if(isset($employerName))
49
+ {
50
+ $formData['employerName'] = trim($employerName);
51
+ }
52
+ $employmentStartDate = $this->getRequest()->getParam('employmentStartDate');
53
+ if(isset($employmentStartDate)){
54
+ $formData['employmentStartDate'] = trim($employmentStartDate);
55
+ }
56
+ $occupation = $this->getRequest()->getParam('occupation');
57
+ if(isset($occupation)){
58
+ $formData['occupation'] = trim($occupation);
59
+ }
60
+ }
61
+
62
+
63
  $clx_button_flag = trim($this->getRequest()->getParam('clx_btn_flag'));
64
  $validation_error = array();
65
  /* validators */
66
 
 
67
  $is_digit = new Zend_Validate_Digits();
68
  $date_validator = new Zend_Validate_Date(); // date yyyy-mm-dd
69
  $is_decimal = new Zend_Validate_Float(); //
74
  $string_length_max_255 = new Zend_Validate_StringLength(array('max' => 255)); //bankName(255max)
75
  $string_length_max_30 = new Zend_Validate_StringLength(array('max' => 30)); //bankAccountNumber(30max)
76
  $string_length_min_max_9 = new Zend_Validate_StringLength(array('min' => 9, 'max' => 9));
 
 
 
 
 
 
 
 
 
77
  $tab1_fields_key_arr = array("firstName", "lastName", "emailId", "birthDate", "mobilePhoneAreaCode", "mobileNumber", "street", "state", "city", "country", "zipcode", "yearlyIncome", "employmentStatus", "employmentStatus", "employerName", "employmentStartDate", "occupation");
78
  $tab2_fields_key_arr = array("selfReportedCreditScore", "bankName", "firstAccountHolderName", "bankAccountType", "bankAccountNumber", "routingNumber", "ssn");
79
  $tab3_fields_key_arr = array("loanAmount", "loanPurpose", "loanTerms");
80
 
 
 
81
  /* Personal Information */
 
82
  /* firstName */
83
  if (!Zend_Validate::is($formData['firstName'], 'NotEmpty')) {
84
  $validation_error['firstName'] = "This field is required";
 
 
 
 
85
  }
86
 
87
  /* lastName */
88
  if (!Zend_Validate::is($formData['lastName'], 'NotEmpty')) {
89
  $validation_error['lastName'] = "This field is required";
 
 
 
 
90
  }
91
 
92
  /* emailId */
185
  $validation_error['employmentStatus'] = "This field is required";
186
  }
187
  /* employerName */
188
+ if(isset($formData['employerName'])){
189
+ if (!Zend_Validate::is($formData['employerName'], 'NotEmpty')) {
190
+ $validation_error['employerName'] = "This field is required";
191
+ } else {
192
+ if (!$string_length_max_100->isValid($formData['employerName'])) {// string length <=100
193
+ $validation_error['employerName'] = "String length should be less than 100";
194
+ }
195
  }
196
  }
197
 
198
  /* employmentStartDate */
199
+ if(isset($formData['employmentStartDate'])){
200
+ if (!Zend_Validate::is($formData['employmentStartDate'], 'NotEmpty')) {
201
+ $validation_error['employmentStartDate'] = "This field is required";
202
+ } else {
203
+ if (!$date_validator->isValid($formData['employmentStartDate'])) {
204
+ $validation_error['employmentStartDate'] = "Invalid date format";
 
 
 
 
 
205
  }
206
+ }
207
  }
208
 
209
  /* occupation */
210
+ if(isset($formData['occupation'])){
211
+ if (!Zend_Validate::is($formData['occupation'], 'NotEmpty')) {
212
+ $validation_error['occupation'] = "This field is required";
213
+ }
214
  }
215
 
216
  /* End- Personal Information */
225
  if (!Zend_Validate::is($formData['bankName'], 'NotEmpty')) {
226
  $validation_error['bankName'] = "This field is required";
227
  } else {
228
+ if (!$string_length_max_255->isValid($formData['bankName'])) {// string length <=255
229
  $validation_error['bankName'] = "String length should be less than 255";
230
  }
231
  }
261
 
262
 
263
  /* ssn */
264
+ if(isset($formData['ssn'])){
265
+ if (!Zend_Validate::is($formData['ssn'], 'NotEmpty')) {
266
+ $validation_error['ssn'] = "This field is required";
267
+ } else {
268
+ if(!(preg_match("/^\d{9}$/",$formData['ssn'])))
269
+ {
270
+ $validation_error['ssn'] = "Please enter a valid 9 digit SSN (for example xxxxxxxxx)";
271
+ }
 
272
  }
273
  }
274
 
346
  $grandTotal = $quoteData['grand_total'];
347
 
348
  $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
349
+
 
 
 
 
 
350
  $clx_button_flag = trim($this->getRequest()->getParam('clx_btn_flag'));
351
+
352
+ if (isset($accountId) && isset($authorizationField)) {
353
  /* loan application form data */
354
  $data = array(
355
  "firstName" => trim($this->getRequest()->getParam('firstName')),
369
  "selfReportedCreditScore" => intval(trim($this->getRequest()->getParam('selfReportedCreditScore'))),
370
  "mobilePhoneAreaCode" => trim($this->getRequest()->getParam('mobilePhoneAreaCode')),
371
  "mobileNumber" => trim($this->getRequest()->getParam('mobileNumber')),
 
 
 
 
372
  "bankName" => trim($this->getRequest()->getParam('bankName')),
373
  "firstAccountHolderName" => trim($this->getRequest()->getParam('firstAccountHolderName')),
374
  "bankAccountType" => trim($this->getRequest()->getParam('bankAccountType')),
376
  "routingNumber" => trim($this->getRequest()->getParam('routingNumber')),
377
  "currency" => Mage::app()->getStore()->getCurrentCurrencyCode()
378
  );
379
+ $ssn = $this->getRequest()->getParam('ssn');
380
+ if(isset($ssn)){
381
+ $data['ssn'] = trim($ssn);
382
+ }
383
+
384
+ if(isset($data['employmentStatus']) && $data['employmentStatus']!='Not Employed'){
385
+ $employerName = $this->getRequest()->getParam('employerName');
386
+ if(isset($employerName))
387
+ {
388
+ $data['employerName'] = trim($employerName);
389
+ }
390
+ $employmentStartDate = $this->getRequest()->getParam('employmentStartDate');
391
+ if(isset($employmentStartDate)){
392
+ $data['employmentStartDate'] = trim($employmentStartDate);
393
+ }
394
+ $occupation = $this->getRequest()->getParam('occupation');
395
+ if(isset($occupation)){
396
+ $data['occupation'] = trim($occupation);
397
+ }
398
+ }
399
+
400
+
401
+ $applicationId = "APP-".$data['emailId']."-".strtotime(date('Y-m-d H:i:s'));
402
+ $data['applicationId'] = $applicationId;
403
  /* to save loan application form data to custom clx table */
404
  $clx_loan_application_data = $data;
405
  $clx_loan_application_data['application_id'] = $applicationId;
406
+ $clx_loan_application_data['applicationId'] = $applicationId;
407
  $clx_loan_application_data['quote_id'] = $quoteId;
408
  Mage::getSingleton('checkout/session')->setLoanApplicationDataToSave($clx_loan_application_data);
409
+ Mage::getSingleton('checkout/session')->setLoanApplicationId($applicationId);
410
  /* to save loan application form data to custom clx table */
411
+
 
412
  if (isset($clx_button_flag) && !empty($clx_button_flag)) {
413
  if ($clx_button_flag == 'check_eligibility') {
414
  $data['isBestOffer'] = (isset($isBestOffer) && $isBestOffer=="1")?TRUE:FALSE;
415
+ $result = Mage::helper('clxfunding')->masterCurlRequestToClxAPIs("get_loan_offer",$data,FALSE,FALSE);
416
+
 
 
417
  if (isset($result['valid']) && $result['valid']) {
418
  if (isset($result['result'])) {
419
  $api_response = json_decode($result['result']);
434
  }
435
  }
436
  }
437
+
438
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/loan_offer_response.phtml'));
439
  $block->setLoanOffers(json_decode($result['result']));
440
  $myHtml = $block->toHtml();
445
  Mage_Core_Controller_Varien_Action::_redirectUrl(Mage::getBaseUrl());
446
  }
447
  } else {
448
+ $result = Mage::helper('clxfunding')->masterCurlRequestToClxAPIs("create_application",$data,FALSE,FALSE);
 
 
 
 
449
  if (isset($result['valid']) && $result['valid']) {
450
+
451
  if (isset($result['result'])) {
452
  $api_response = json_decode($result['result']);
453
  if (isset($api_response->application_status) && $api_response->application_status == "REJECTED") {
532
  Mage::getSingleton('checkout/session')->unsLoanOfferFlag();
533
  Mage::getSingleton('checkout/session')->unsLoanApplicationFlag();
534
 
535
+ if (isset($LoanOfferFlag) && $LoanOfferFlag){
 
 
 
 
 
 
 
536
  $formData = unserialize(Mage::getSingleton('checkout/session')->getLoanApplicationData());
537
+ if (isset($formData) && !empty($formData)){
538
+
539
+ $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
540
+ $quote = Mage::getModel('checkout/session')->getQuote();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541
  $quoteData = $quote->getData();
542
  if (isset($quoteData['grand_total'])) {
543
  $grandTotal = $quoteData['grand_total'];
544
  }
 
 
 
 
 
 
545
  $data = array(
546
+ "firstName" => (string)trim($formData['firstName']),
547
+ "lastName" => (string)trim($formData['lastName']),
548
+ "emailId" => (string)trim($formData['emailId']),
549
+ "birthDate" => (string)trim($formData['birthDate']),
550
+ "street" => (string)trim($formData['street']),
551
+ "city" => (string)trim($formData['city']),
552
+ "country" => (string)trim($formData['country']),
553
+ "state" => (string)trim($formData['state']),
554
+ "zipcode" => (string)trim($formData['zipcode']),
555
+ "loanAmount" => floatval($formData['loanAmount']),
556
+ "loanPurpose" => (string)trim($formData['loanPurpose']),
557
  "loanTerms" => floatval(trim($formData['loanTerms'])),
558
  "yearlyIncome" => floatval(trim($formData['yearlyIncome'])),
559
+ "employmentStatus" => (string)trim($formData['employmentStatus']),
560
  "selfReportedCreditScore" => intval(trim($formData['selfReportedCreditScore'])),
561
+ "mobilePhoneAreaCode" => (string)trim($formData['mobilePhoneAreaCode']),
562
+ "mobileNumber" => (string)trim($formData['mobileNumber']),
563
+ "bankName" => (string)trim($formData['bankName']),
564
+ "firstAccountHolderName" => (string)trim($formData['firstAccountHolderName']),
565
+ "bankAccountType" => (string)trim($formData['bankAccountType']),
566
+ "bankAccountNumber" => (string)trim($formData['bankAccountNumber']),
567
+ "routingNumber" => (string)trim($formData['routingNumber']),
568
+ "loanOfferId" => (string)trim($formData['loanOfferId']),
569
+ "currency" => (string)Mage::app()->getStore()->getCurrentCurrencyCode()
 
 
 
 
 
570
  );
571
+ if(isset($formData['ssn'])){
572
+ $data['ssn'] = $formData['ssn'];
573
+ }
574
+ if(isset($formData['employmentStatus']) && $formData['employmentStatus']!='Not Employed'){
575
+ $data["employmentStartDate"] = trim($formData['employmentStartDate']);
576
+ $data["occupation"] = trim($formData['occupation']);
577
+ $data["employerName"] = trim($formData['employerName']);
578
+ }
579
 
580
+ $url = "http://clexchange-dev.herokuapp.com/api/loan-offers/" . $data['loanOfferId'] . "/loan-applications";
 
581
  $page = "/api/loan-offers/" . $data['loanOfferId'] . "/loan-applications";
582
+ $data['isOfferAccepted'] = TRUE;
 
583
 
584
+ $applicationId = (string)Mage::getSingleton('checkout/session')->getLoanApplicationId();
585
+
586
  $formData['application_id'] = $applicationId;
587
+ $data["applicationId"]= $applicationId;
588
  $formData['quote_id'] = $quoteId;
589
  Mage::getSingleton('checkout/session')->setLoanApplicationDataToSave($formData);
590
+ $result = Mage::helper('clxfunding')->masterCurlRequestToClxAPIs("loan_offer_accept_or_reject",$data,$data['loanOfferId'],FALSE);
591
+
592
  if ($result['valid']) {
593
  if (isset($result['result'])) {
594
  $this->loadLayout();
601
  } else {
602
  Mage_Core_Controller_Varien_Action::_redirectUrl(Mage::getBaseUrl());
603
  }
 
 
 
 
 
 
 
 
604
  } else if (isset($loanApplicationFlag) && $loanApplicationFlag) {
605
+
606
  $approve_required = Mage::getStoreConfig('payment/clxfunding/approve_Required'); // user approve required
607
  $clx_status_track_model = Mage::getModel('clxfunding/CronOrderStatusUpdate'); // load clx status update model
608
 
609
  $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
610
+
611
+ $clx_loan_application_data = Mage::getSingleton('checkout/session')->getLoanApplicationDataToSave();
612
+ if (isset($quoteId) && isset($clx_loan_application_data) && !empty($clx_loan_application_data) && isset($clx_loan_application_data['applicationId'])) {
 
 
 
 
 
613
  $order = new Mage_Sales_Model_Order();
614
  $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
615
  $order->loadByIncrementId($orderId);
616
  $order->setState(Mage_Sales_Model_Order::STATE_NEW, true, 'Loan Application Approved.');
617
 
 
 
 
 
618
  $loanAppFlag = 0;
619
  if (isset($approve_required) && $approve_required) {
620
  $loanAppFlag = 1;
 
 
621
  }
622
 
623
  try {
626
  Mage::logException($ex);
627
  }
628
  $order->save();
629
+ $clx_loan_application_data['quote_id'] = $quoteId;
 
630
  $clx_loan_application_data['order_id'] = $orderId;
631
  $clx_loan_application_data['status'] = 'PENDING';
632
  $clx_loan_application_data['approvalRequired_flag'] = $loanAppFlag;
633
  $clx_status_track_model->saveLoanApplicationDetails($clx_loan_application_data);
634
  Mage::getSingleton('checkout/session')->unsLoanApplicationDataToSave();
 
 
635
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => false));
636
  } else {
637
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure' => false));
642
  }
643
 
644
  function saveOrderCustomAction() {
 
 
 
 
 
645
  $clx_status_track_model = Mage::getModel('clxfunding/CronOrderStatusUpdate'); // load clx status update model
 
646
  $quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
 
 
 
 
 
 
 
647
  $order = new Mage_Sales_Model_Order();
648
  $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
649
  $order->loadByIncrementId($orderId);
650
  $order->setState(Mage_Sales_Model_Order::STATE_NEW, true, 'Loan Application Approved.');
 
 
 
651
  try {
652
  $order->sendNewOrderEmail();
653
  } catch (Exception $ex) {
657
 
658
  $clx_loan_application_data = Mage::getSingleton('checkout/session')->getLoanApplicationDataToSave();
659
  $clx_loan_application_data['order_id'] = $orderId;
660
+ $clx_loan_application_data['quote_id'] = $quoteId;
661
  $clx_loan_application_data['status'] = 'PENDING';
662
  $clx_loan_application_data['approvalRequired_flag'] = 0;
663
  $clx_loan_application_data['offer_acceptance_flag'] = true;
664
  $clx_status_track_model->saveLoanApplicationDetails($clx_loan_application_data);
665
  Mage::getSingleton('checkout/session')->unsLoanApplicationDataToSave();
666
+ if ($order) {
 
 
 
 
 
 
 
 
667
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => false));
668
  }else {
669
  Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure' => false));
670
  }
671
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
672
  function getLoanApplicationFormAction() {
673
  $quote = Mage::getModel('checkout/session')->getQuote();
674
  $quoteData = $quote->getData();
684
  $myHtml = $block->toHtml();
685
  echo json_encode(array('valid' => TRUE, 'loan_app_view' => $myHtml));
686
  }
687
+
688
+ function getStateListAction(){
689
+ if ($this->getRequest()->isXmlHttpRequest()) {
690
+ $country_code = trim($this->getRequest()->getParam('country_code'));
691
+ if(isset($country_code) && !empty($country_code)){
692
+ $states = Mage::getModel('directory/country')->load($country_code)->getRegions();
693
+ $state_option = '<input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-alpha-spac validate-no-html-tags" id="state" name="state" value="">';
694
+ if (count($states) > 0){
695
+ $state_option = '';
696
+ $state_option = '<select class="select_input_f validate-select validate-no-html-tags" id="state" name="state"><option value="">-- Please Select --</option>';
697
+ foreach($states as $state):
698
+ $state_option.='<option value="'.$state->getName().'">'.$state->getName().'</option>';
699
+ endforeach;
700
+ $state_option .='</select>';
701
+ }
702
+ echo $state_option;
703
+ }
704
+ else{
705
+ echo 'error';
706
+ }
707
+ }
708
+ else{
709
+ echo 'error';
710
+ }
711
+ }
712
 
713
  function loanOfferRejectAction() {
714
  $applicationId = $this->getRequest()->getParam('applicationId');
731
  unset($new_data['clx_loan_application_detail_id'], $new_data['order_id'], $new_data['application_id'], $new_data['quote_id'], $new_data['approvalRequired_flag'], $new_data['status'], $new_data['created_time'], $new_data['update_time']);
732
  $accountId = Mage::getStoreConfig('payment/clxfunding/account_id');
733
  $authorizationField = Mage::getStoreConfig('payment/clxfunding/authorization_field');
734
+
735
+ if(!(isset($new_data['ssn']) && !empty($new_data['ssn']))){
736
+ unset($new_data['ssn']);
737
+ }
738
+ if(isset($new_data['employmentStatus']) && $new_data['employmentStatus']=='Not Employed'){
739
+ unset($new_data['employerName'],$new_data['employmentStartDate'],$new_data['occupation']);
740
+ }
741
  $new_data['accountId'] = $accountId;
742
  $new_data['loanOfferId'] = $loanOfferId;
743
  $new_data['applicationId'] = $applicationId;
744
  $new_data['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
745
  $new_data['isOfferAccepted'] = FALSE;
746
+ $result = Mage::helper('clxfunding')->masterCurlRequestToClxAPIs("loan_offer_accept_or_reject",$new_data,$loanOfferId,FALSE);
747
+
 
 
 
748
  if (isset($result['result']) && $result['result']) {
749
  /* Mail notification to Merchant about loan offer rejected by customer */
750
  $parameters = array('applicationId' => $applicationId, 'orderNumber' => $row['order_id'], 'customerName' => ucfirst(strtolower($row['firstName'])) . ' ' . ucfirst(strtolower($row['lastName'])));
781
  }
782
  /* Order Cancel */
783
 
 
 
784
  /* Notification on FrontEnd */
785
  $this->loadLayout();
786
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/user_loan_offer_reject.phtml'));
795
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/link_Expire.phtml'));
796
  $this->getLayout()->getBlock('content')->append($block);
797
  $this->renderLayout();
 
798
  }
799
  } else {
800
  $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');
830
  $new_data['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
831
 
832
  $new_data['isOfferAccepted'] = TRUE;
833
+ $result = Mage::helper('clxfunding')->masterCurlRequestToClxAPIs("loan_offer_accept_or_reject",$new_data,$loanOfferId,FALSE);
 
 
 
 
834
  if (isset($result['result']) && $result['result']) {
835
  $clxOfferAcceptRes = json_decode($result['result']);
836
  if ($clxOfferAcceptRes->application_status == "ACCEPTED") {
861
  $connectionWrite->update($clx_table, $data, $where);
862
  $connectionWrite->commit();
863
 
 
 
 
 
864
  } else {
865
 
866
  }
878
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/link_Expire.phtml'));
879
  $this->getLayout()->getBlock('content')->append($block);
880
  $this->renderLayout();
 
881
  }
882
  } else {
883
  $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');
890
  $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/form/aboutCLXFunding.phtml'));
891
  echo $block->toHtml();
892
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
  }
app/code/community/CLExchange/Clexchangefunding/controllers/PaymentController.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- // app/code/local/Envato/Clexchangefunding/controllers/PaymentController.php
4
- class CLExchange_Clexchangefunding_PaymentController extends Mage_Core_Controller_Front_Action {
5
-
6
- public function gatewayAction() {
7
- if ($this->getRequest()->get("orderId")) {
8
- $arr_querystring = array(
9
- 'flag' => 1,
10
- 'orderId' => $this->getRequest()->get("orderId")
11
- );
12
-
13
- Mage_Core_Controller_Varien_Action::_redirect('clxfunding/payment/response', array('_secure' => false, '_query' => $arr_querystring));
14
- }
15
- }
16
-
17
- public function redirectAction() {
18
- $this->loadLayout();
19
- $block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'clxfunding', array('template' => 'clxfunding/redirect.phtml'));
20
- $this->getLayout()->getBlock('content')->append($block);
21
- $this->renderLayout();
22
- }
23
-
24
- public function responseAction() {
25
- if ($this->getRequest()->get("flag") == "1" && $this->getRequest()->get("orderId")) {
26
- $orderId = $this->getRequest()->get("orderId");
27
- $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
28
- $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, true, 'Payment Success.');
29
- $order->save();
30
-
31
- Mage::getSingleton('checkout/session')->unsQuoteId();
32
- Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => false));
33
- } else {
34
- Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/error', array('_secure' => false));
35
- }
36
- }
37
-
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/CLExchange/Clexchangefunding/etc/config.xml CHANGED
@@ -32,6 +32,14 @@ and open the template in the editor.
32
  </clxfunding_payment_method_is_active>
33
  </observers>
34
  </payment_method_is_active>
 
 
 
 
 
 
 
 
35
  </events>
36
  <layout>
37
  <updates>
@@ -39,6 +47,11 @@ and open the template in the editor.
39
  <file>clxblock.xml</file>
40
  </clx_custom>
41
  </updates>
 
 
 
 
 
42
  </layout>
43
  </frontend>
44
  <global>
@@ -80,18 +93,6 @@ and open the template in the editor.
80
  </connection>
81
  </clxfunding_read>
82
  </resources>
83
-
84
- <!--fieldsets>
85
- <sales_convert_quote_payment>
86
- <custom_field_one>
87
- <to_order_payment>*</to_order_payment>
88
- </custom_field_one>
89
- <custom_field_two>
90
- <to_order_payment>*</to_order_payment>
91
- </custom_field_two>
92
- </sales_convert_quote_payment>
93
- </fieldsets-->
94
-
95
  <helpers>
96
  <clxfunding>
97
  <class>CLExchange_Clexchangefunding_Helper</class>
@@ -103,7 +104,6 @@ and open the template in the editor.
103
  <class>CLExchange_Clexchangefunding_Block</class>
104
  </clxfunding>
105
  </blocks>
106
-
107
  <events>
108
  <checkout_onepage_index>
109
  <observers>
@@ -115,7 +115,6 @@ and open the template in the editor.
115
  </observers>
116
  </checkout_onepage_index>
117
  </events>
118
-
119
  <template>
120
  <email>
121
  <clx_loan_approve_email_template>
@@ -128,6 +127,11 @@ and open the template in the editor.
128
  <file>CLX/email-template/clx_loan_funded.html</file>
129
  <type>html</type>
130
  </clx_loan_funded_email_template>
 
 
 
 
 
131
  <clx_loan_offerdetail_email_template>
132
  <label>Clx Loan Offer Template</label>
133
  <file>CLX/email-template/clx_loan_offer.html</file>
@@ -184,11 +188,30 @@ and open the template in the editor.
184
  <active>0</active>
185
  <model>clxfunding/paymentmethod</model>
186
  <order_status>pending</order_status>
187
- <title>CLX Funding</title>
188
  <allowspecific>0</allowspecific>
189
  <payment_action>sale</payment_action>
190
  <sort_order>3</sort_order>
191
  </clxfunding>
192
  </payment>
193
  </default>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  </config>
32
  </clxfunding_payment_method_is_active>
33
  </observers>
34
  </payment_method_is_active>
35
+ <core_block_abstract_to_html_after>
36
+ <observers>
37
+ <clxfunding_custom_order_view_info>
38
+ <class>clxfunding/observer</class>
39
+ <method>addCustomMessage</method>
40
+ </clxfunding_custom_order_view_info>
41
+ </observers>
42
+ </core_block_abstract_to_html_after>
43
  </events>
44
  <layout>
45
  <updates>
47
  <file>clxblock.xml</file>
48
  </clx_custom>
49
  </updates>
50
+ <updates>
51
+ <clx_custom_n module="CLExchange_Clexchangefunding">
52
+ <file>clxfunding.xml</file>
53
+ </clx_custom_n>
54
+ </updates>
55
  </layout>
56
  </frontend>
57
  <global>
93
  </connection>
94
  </clxfunding_read>
95
  </resources>
 
 
 
 
 
 
 
 
 
 
 
 
96
  <helpers>
97
  <clxfunding>
98
  <class>CLExchange_Clexchangefunding_Helper</class>
104
  <class>CLExchange_Clexchangefunding_Block</class>
105
  </clxfunding>
106
  </blocks>
 
107
  <events>
108
  <checkout_onepage_index>
109
  <observers>
115
  </observers>
116
  </checkout_onepage_index>
117
  </events>
 
118
  <template>
119
  <email>
120
  <clx_loan_approve_email_template>
127
  <file>CLX/email-template/clx_loan_funded.html</file>
128
  <type>html</type>
129
  </clx_loan_funded_email_template>
130
+ <clx_loan_funded_user_email_template>
131
+ <label>Clx Loan Funded User Template</label>
132
+ <file>CLX/email-template/clx_loan_funded_U.html</file>
133
+ <type>html</type>
134
+ </clx_loan_funded_user_email_template>
135
  <clx_loan_offerdetail_email_template>
136
  <label>Clx Loan Offer Template</label>
137
  <file>CLX/email-template/clx_loan_offer.html</file>
188
  <active>0</active>
189
  <model>clxfunding/paymentmethod</model>
190
  <order_status>pending</order_status>
191
+ <title>Purchase Through Loan</title>
192
  <allowspecific>0</allowspecific>
193
  <payment_action>sale</payment_action>
194
  <sort_order>3</sort_order>
195
  </clxfunding>
196
  </payment>
197
  </default>
198
+ <adminhtml>
199
+ <layout>
200
+ <updates>
201
+ <clx_custom module="CLExchange_Clexchangefunding">
202
+ <file>clxfunding.xml</file>
203
+ </clx_custom>
204
+ </updates>
205
+ </layout>
206
+ <events>
207
+ <core_block_abstract_to_html_after>
208
+ <observers>
209
+ <mymodule_custom_order_view_info>
210
+ <class>clxfunding/observer</class>
211
+ <method>getSalesOrderViewInfo</method>
212
+ </mymodule_custom_order_view_info>
213
+ </observers>
214
+ </core_block_abstract_to_html_after>
215
+ </events>
216
+ </adminhtml>
217
  </config>
app/code/community/CLExchange/Clexchangefunding/etc/config.xml~ CHANGED
@@ -14,22 +14,22 @@ and open the template in the editor.
14
  </modules>
15
  <frontend>
16
  <routers>
17
- <clexchangefunding>
18
  <use>standard</use>
19
  <args>
20
  <module>CLExchange_Clexchangefunding</module>
21
- <frontName>clexchangefunding</frontName>
22
  </args>
23
- </clexchangefunding>
24
  </routers>
25
  <events>
26
  <payment_method_is_active>
27
  <observers>
28
- <clexchangefunding_payment_method_is_active>
29
  <type>singleton</type>
30
- <class>clexchangefunding/observer</class>
31
  <method>paymentMethodIsActive</method>
32
- </clexchangefunding_payment_method_is_active>
33
  </observers>
34
  </payment_method_is_active>
35
  </events>
@@ -43,24 +43,24 @@ and open the template in the editor.
43
  </frontend>
44
  <global>
45
  <models>
46
- <clexchangefunding>
47
  <class>CLExchange_Clexchangefunding_Model</class>
48
- <resourceModel>clexchangefunding_mysql4</resourceModel>
49
- </clexchangefunding>
50
- <clexchangefunding_mysql4>
51
  <class>CLExchange_Clexchangefunding_Model_Mysql4</class>
52
  <entities>
53
- <clxloanapplicationdetails>
54
  <table>clx_loan_application_detail</table>
55
- </clxloanapplicationdetails>
56
  <clxloanofferdetails>
57
  <table>clx_loan_offer_detail</table>
58
  </clxloanofferdetails>
59
  </entities>
60
- </clexchangefunding_mysql4>
61
  </models>
62
  <resources>
63
- <clexchangefunding_setup>
64
  <setup>
65
  <module>CLExchange_Clexchangefunding</module>
66
  <class>CLExchange_Clexchangefunding_Model_Resource_Setup</class>
@@ -68,17 +68,17 @@ and open the template in the editor.
68
  <connection>
69
  <use>core_setup</use>
70
  </connection>
71
- </clexchangefunding_setup>
72
- <clexchangefunding_write>
73
  <connection>
74
  <use>core_write</use>
75
  </connection>
76
- </clexchangefunding_write>
77
- <clexchangefunding_read>
78
  <connection>
79
  <use>core_read</use>
80
  </connection>
81
- </clexchangefunding_read>
82
  </resources>
83
 
84
  <!--fieldsets>
@@ -93,25 +93,25 @@ and open the template in the editor.
93
  </fieldsets-->
94
 
95
  <helpers>
96
- <clexchangefunding>
97
  <class>CLExchange_Clexchangefunding_Helper</class>
98
- </clexchangefunding>
99
  </helpers>
100
 
101
  <blocks>
102
- <clexchangefunding>
103
  <class>CLExchange_Clexchangefunding_Block</class>
104
- </clexchangefunding>
105
  </blocks>
106
 
107
  <events>
108
  <checkout_onepage_index>
109
  <observers>
110
- <clexchangefunding>
111
  <type>singleton</type>
112
- <class>clexchangefunding/observer</class>
113
  <method>paymentMethodIsActive</method>
114
- </clexchangefunding>
115
  </observers>
116
  </checkout_onepage_index>
117
  </events>
@@ -128,6 +128,11 @@ and open the template in the editor.
128
  <file>CLX/email-template/clx_loan_funded.html</file>
129
  <type>html</type>
130
  </clx_loan_funded_email_template>
 
 
 
 
 
131
  <clx_loan_offerdetail_email_template>
132
  <label>Clx Loan Offer Template</label>
133
  <file>CLX/email-template/clx_loan_offer.html</file>
@@ -159,36 +164,36 @@ and open the template in the editor.
159
  </global>
160
  <crontab>
161
  <jobs>
162
- <clexchangefunding_setStatus>
163
  <schedule>
164
  <!--<cron_expr>*/5 * * * *</cron_expr>-->
165
- <config_path>payment/clexchangefunding/cron_expr</config_path>
166
  </schedule>
167
  <run>
168
- <model>clexchangefunding/Observer::checkCron</model>
169
  </run>
170
- </clexchangefunding_setStatus>
171
- <clexchangefunding_timeframe>
172
  <schedule>
173
- <cron_expr>30 * * * *</cron_expr>
174
  </schedule>
175
  <run>
176
- <model>clexchangefunding/Observer::timeframeCancelOrder</model>
177
  </run>
178
- </clexchangefunding_timeframe>
179
  </jobs>
180
  </crontab>
181
  <default>
182
  <payment>
183
- <clexchangefunding>
184
- <active>1</active>
185
- <model>clexchangefunding/paymentmethod</model>
186
  <order_status>pending</order_status>
187
  <title>CLX Funding</title>
188
  <allowspecific>0</allowspecific>
189
  <payment_action>sale</payment_action>
190
  <sort_order>3</sort_order>
191
- </clexchangefunding>
192
  </payment>
193
  </default>
194
  </config>
14
  </modules>
15
  <frontend>
16
  <routers>
17
+ <clxfunding>
18
  <use>standard</use>
19
  <args>
20
  <module>CLExchange_Clexchangefunding</module>
21
+ <frontName>clxfunding</frontName>
22
  </args>
23
+ </clxfunding>
24
  </routers>
25
  <events>
26
  <payment_method_is_active>
27
  <observers>
28
+ <clxfunding_payment_method_is_active>
29
  <type>singleton</type>
30
+ <class>clxfunding/observer</class>
31
  <method>paymentMethodIsActive</method>
32
+ </clxfunding_payment_method_is_active>
33
  </observers>
34
  </payment_method_is_active>
35
  </events>
43
  </frontend>
44
  <global>
45
  <models>
46
+ <clxfunding>
47
  <class>CLExchange_Clexchangefunding_Model</class>
48
+ <resourceModel>clxfunding_mysql4</resourceModel>
49
+ </clxfunding>
50
+ <clxfunding_mysql4>
51
  <class>CLExchange_Clexchangefunding_Model_Mysql4</class>
52
  <entities>
53
+ <clxloanappdtls>
54
  <table>clx_loan_application_detail</table>
55
+ </clxloanappdtls>
56
  <clxloanofferdetails>
57
  <table>clx_loan_offer_detail</table>
58
  </clxloanofferdetails>
59
  </entities>
60
+ </clxfunding_mysql4>
61
  </models>
62
  <resources>
63
+ <clxfunding_setup>
64
  <setup>
65
  <module>CLExchange_Clexchangefunding</module>
66
  <class>CLExchange_Clexchangefunding_Model_Resource_Setup</class>
68
  <connection>
69
  <use>core_setup</use>
70
  </connection>
71
+ </clxfunding_setup>
72
+ <clxfunding_write>
73
  <connection>
74
  <use>core_write</use>
75
  </connection>
76
+ </clxfunding_write>
77
+ <clxfunding_read>
78
  <connection>
79
  <use>core_read</use>
80
  </connection>
81
+ </clxfunding_read>
82
  </resources>
83
 
84
  <!--fieldsets>
93
  </fieldsets-->
94
 
95
  <helpers>
96
+ <clxfunding>
97
  <class>CLExchange_Clexchangefunding_Helper</class>
98
+ </clxfunding>
99
  </helpers>
100
 
101
  <blocks>
102
+ <clxfunding>
103
  <class>CLExchange_Clexchangefunding_Block</class>
104
+ </clxfunding>
105
  </blocks>
106
 
107
  <events>
108
  <checkout_onepage_index>
109
  <observers>
110
+ <clxfunding>
111
  <type>singleton</type>
112
+ <class>clxfunding/observer</class>
113
  <method>paymentMethodIsActive</method>
114
+ </clxfunding>
115
  </observers>
116
  </checkout_onepage_index>
117
  </events>
128
  <file>CLX/email-template/clx_loan_funded.html</file>
129
  <type>html</type>
130
  </clx_loan_funded_email_template>
131
+ <clx_loan_funded_user_email_template>
132
+ <label>Clx Loan Funded User Template</label>
133
+ <file>CLX/email-template/clx_loan_funded_U.html</file>
134
+ <type>html</type>
135
+ </clx_loan_funded_user_email_template>
136
  <clx_loan_offerdetail_email_template>
137
  <label>Clx Loan Offer Template</label>
138
  <file>CLX/email-template/clx_loan_offer.html</file>
164
  </global>
165
  <crontab>
166
  <jobs>
167
+ <clxfunding_setStatus>
168
  <schedule>
169
  <!--<cron_expr>*/5 * * * *</cron_expr>-->
170
+ <config_path>payment/clxfunding/cron_expr</config_path>
171
  </schedule>
172
  <run>
173
+ <model>clxfunding/Observer::checkCron</model>
174
  </run>
175
+ </clxfunding_setStatus>
176
+ <clxfunding_timeframe>
177
  <schedule>
178
+ <cron_expr>0 * * * *</cron_expr>
179
  </schedule>
180
  <run>
181
+ <model>clxfunding/Observer::timeframeCancelOrder</model>
182
  </run>
183
+ </clxfunding_timeframe>
184
  </jobs>
185
  </crontab>
186
  <default>
187
  <payment>
188
+ <clxfunding>
189
+ <active>0</active>
190
+ <model>clxfunding/paymentmethod</model>
191
  <order_status>pending</order_status>
192
  <title>CLX Funding</title>
193
  <allowspecific>0</allowspecific>
194
  <payment_action>sale</payment_action>
195
  <sort_order>3</sort_order>
196
+ </clxfunding>
197
  </payment>
198
  </default>
199
  </config>
app/code/community/CLExchange/Clexchangefunding/etc/system.xml CHANGED
@@ -4,7 +4,6 @@ To change this license header, choose License Headers in Project Properties.
4
  To change this template file, choose Tools | Templates
5
  and open the template in the editor.
6
  -->
7
-
8
  <config>
9
  <sections>
10
  <payment>
@@ -19,6 +18,7 @@ and open the template in the editor.
19
  <title translate="label">
20
  <backend_model>clxfunding/PaymentMethodTitle</backend_model>
21
  <label>Title</label>
 
22
  <frontend_type>text</frontend_type>
23
  <show_in_default>1</show_in_default>
24
  <show_in_website>1</show_in_website>
4
  To change this template file, choose Tools | Templates
5
  and open the template in the editor.
6
  -->
 
7
  <config>
8
  <sections>
9
  <payment>
18
  <title translate="label">
19
  <backend_model>clxfunding/PaymentMethodTitle</backend_model>
20
  <label>Title</label>
21
+ <readonly>true</readonly>
22
  <frontend_type>text</frontend_type>
23
  <show_in_default>1</show_in_default>
24
  <show_in_website>1</show_in_website>
app/code/community/CLExchange/Clexchangefunding/sql/clxfunding_setup/mysql4-install-1.0.0.0.php CHANGED
@@ -30,7 +30,7 @@ CREATE TABLE {$this->getTable('clx_loan_application_detail')} (
30
  `country` varchar(255) NOT NULL,
31
  `yearlyIncome` DECIMAL NOT NULL COMMENT 'Borrowers yearly income',
32
  `employmentStatus` varchar(30) NOT NULL,
33
- `employmentName` varchar(100) NOT NULL,
34
  `loanTerms` DOUBLE NOT NULL COMMENT 'loan terms in months',
35
  `employmentStartDate` date NOT NULL,
36
  `occupation` varchar(100) NOT NULL,
30
  `country` varchar(255) NOT NULL,
31
  `yearlyIncome` DECIMAL NOT NULL COMMENT 'Borrowers yearly income',
32
  `employmentStatus` varchar(30) NOT NULL,
33
+ `employerName` varchar(100) NOT NULL,
34
  `loanTerms` DOUBLE NOT NULL COMMENT 'loan terms in months',
35
  `employmentStartDate` date NOT NULL,
36
  `occupation` varchar(100) NOT NULL,
app/design/adminhtml/default/default/layout/clxfunding.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!-- Functionality : Adding disable_title.js to admin panel & this is for disabling title field in admin panel
3
+ Next we have added a block which will show current loan application status to admin.
4
+ -->
5
+ <layout version="1.0">
6
+ <!-- Adding the block in sales/order/view page -->
7
+ <adminhtml_sales_order_view>
8
+ <reference name="order_info">
9
+ <block type="clxfunding/adminhtml_sales_order_view_info_block" name="mymodule.order.info.custom.block" template="clxfunding/custom.phtml" before="order_history" />
10
+ </reference>
11
+ </adminhtml_sales_order_view>
12
+ </layout>
app/design/adminhtml/default/default/template/clxfunding/custom.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $order = $this->getOrder(); // Admin Menu: Sales/orders & clicked view link
3
+ $clx_order_id = $order->getRealOrderId(); // get order id
4
+ $table_prefix = Mage::getConfig()->getTablePrefix();
5
+ $clx_table = $table_prefix . 'clx_loan_application_detail';
6
+ $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');
7
+ $select = $connectionRead->select()
8
+ ->from($clx_table, array('*'))
9
+ ->where('order_id=?',$clx_order_id); //check whether, this order is placed using Online loan payment method using our custom table `clx_loan_application_detail`
10
+ $row = $connectionRead->fetchRow($select); //return rows
11
+
12
+ /* Show loan application status block only if order id is exist in our table
13
+ */
14
+ if (isset($row) && !empty($row) && is_array($row) && isset($row['clx_loan_application_detail_id'])){
15
+ ?>
16
+ <div class="entry-edit box-left">
17
+ <div class="entry-edit-head">
18
+ <h4 class="icon-head"><?php echo $this->__('CLExchange Application Status') ?></h4>
19
+ </div>
20
+ <fieldset>
21
+ <div id="mymodule_custom_block">
22
+ Current loan application status for this order : <?php echo $row['status'];?>
23
+ </div>
24
+ </fieldset>
25
+ </div>
26
+ <div class="clear"></div>
27
+ <?php }?>
app/design/frontend/base/default/layout/clxblock.xml CHANGED
@@ -1,18 +1,6 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <layout version="0.1.0">
3
- <!--default>
4
- <reference name="head">
5
- <action method="addItem">
6
- <type>skin_css</type>
7
- <name>css/Clx/clx_custom.css</name>
8
- </action>
9
- </reference>
10
- </default-->
11
  <checkout_onepage_index>
12
- <!--reference name="footer">
13
- <block type="core/template" template="clxfunding/form/modal_clxfunding.phtml">
14
- </block>
15
- </reference-->
16
  <reference name="head">
17
  <action method="addItem">
18
  <type>skin_js</type>
@@ -34,12 +22,6 @@
34
  <type>skin_js</type>
35
  <name>js/Clx/bootstrap-datepicker.min.js</name>
36
  </action>
37
- <!--action method="addJs">
38
- <script>CLX/Clexchangefunding/bootstrap.min.js</script>
39
- </action-->
40
- <!--action method="addJs">
41
- <script>CLX/Clexchangefunding/clx.custom.js</script>
42
- </action-->
43
 
44
  <action method="addItem">
45
  <type>skin_css</type>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <layout version="0.1.0">
 
 
 
 
 
 
 
 
3
  <checkout_onepage_index>
 
 
 
 
4
  <reference name="head">
5
  <action method="addItem">
6
  <type>skin_js</type>
22
  <type>skin_js</type>
23
  <name>js/Clx/bootstrap-datepicker.min.js</name>
24
  </action>
 
 
 
 
 
 
25
 
26
  <action method="addItem">
27
  <type>skin_css</type>
app/design/frontend/base/default/template/clxfunding/form/clxfunding.phtml CHANGED
@@ -2,73 +2,85 @@
2
  $show_loan_offer_flag = Mage::getStoreConfig('payment/clxfunding/show_loan_offer');
3
  ?>
4
  <script>
5
- jQuery(document).ready(function (jQuery) {
6
- jQuery(document).on('focus', '#birthDate', function (event) {
 
 
 
 
 
7
  var cur_input = jQuery(this);
8
- jQuery(this).datepicker({
9
- autoclose: true,
10
  format: "yyyy-mm-dd",
11
- endDate: new Date()
 
 
12
  }).on('hide', function (e) {
13
  e.preventDefault();
14
  jQuery(cur_input).removeAttr('style');
15
- }).on('changeDate',function(e){
16
  jQuery('#employmentStartDate').val('');
 
 
 
17
  jQuery('#employmentStartDate').datepicker({
18
- autoclose: true,
19
  format: "yyyy-mm-dd",
 
20
  endDate: new Date(),
21
- startDate: e.date
22
  });
 
23
  });
24
  });
25
- jQuery(document).on('focus', '#employmentStartDate', function (event) {
26
  var cur_input = jQuery(this);
27
- jQuery(this).datepicker({
28
- autoclose: true,
29
  format: "yyyy-mm-dd",
 
30
  endDate: new Date(),
31
- startDate:new Date(jQuery('#employmentStartDate').val())
32
  }).on('hide', function (e) {
33
  e.preventDefault();
34
  jQuery(cur_input).removeAttr('style');
35
  });
36
  });
37
- var t;
38
- jQuery(document).on(
39
- 'DOMMouseScroll mousewheel scroll',
40
- '#clxLoanApplicationModal',
41
- function () {
42
- window.clearTimeout(t);
43
- t = window.setTimeout(function () {
44
- jQuery('#birthDate').datepicker('place');
45
- jQuery('#employmentStartDate').datepicker('place');
46
- }, 10);
47
- jQuery('#birthDate').datepicker({
48
- autoclose: true,
49
- format: "yyyy-mm-dd",
50
- endDate: new Date()
51
- }).on('hide', function (e) {
52
- e.preventDefault();
53
- jQuery('#birthDate').removeAttr('style');
54
- });
55
- jQuery('#employmentStartDate').datepicker({
56
- autoclose: true,
57
- format: "yyyy-mm-dd",
58
- endDate: new Date()
59
- }).on('hide', function (e) {
60
- e.preventDefault();
61
- jQuery('#employmentStartDate').removeAttr('style');
62
- });
 
 
 
63
  }
64
- );
65
- jQuery("#clxLoanApplicationModal").on("show", function () {
66
- jQuery("body").addClass("modal-open");
67
- }).on("hidden", function () {
68
- jQuery("body").removeClass("modal-open")
69
  });
70
- //CLX Funding radio button click
71
- jQuery('#p_method_clxfunding').prop('checked', false); //radio button unchecked until application accepted
72
  jQuery('<a href="javascript:void(0);" class="clx_info" title="About CLX Funding"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>frontend/base/default/css/Clx/help.png"/></a>').insertAfter(jQuery('#p_method_clxfunding').next('label'));
73
  jQuery('#p_method_clxfunding').click(function (event) {
74
  event.preventDefault();
@@ -92,7 +104,7 @@ $show_loan_offer_flag = Mage::getStoreConfig('payment/clxfunding/show_loan_offer
92
  var loanAppForm = response.loan_app_view;
93
  jQuery(loanAppForm).find('#loading_div').hide();
94
  jQuery(loanAppForm).modal({backdrop: 'static', keyboard: false}); // show modal
95
- jQuery('body').css({"padding-right": "0px", "overflow": "scroll"});
96
  }
97
  else
98
  {
@@ -157,7 +169,7 @@ $show_loan_offer_flag = Mage::getStoreConfig('payment/clxfunding/show_loan_offer
157
  <?php
158
  if ($show_loan_offer_flag) {
159
  ?>
160
- jQuery('#clxLoanApplicationModal').find('.modal-footer').html('<a href="javascript:void(0);" class="btn btn-default clx_common_next_prev_btn" data-tab="1" data-btn="prev">Previous</a><a href="javascript:void(0);" class="btn btn-default clx_check_eligibility_btn">Check Eligibility</a><a href="javascript:void(0);" class="btn btn-primary clx_loan_application_submit_btn">Create Loan Application</a>');
161
  <?php
162
  } else {
163
  ?>
@@ -219,7 +231,7 @@ if ($show_loan_offer_flag) {
219
  <?php
220
  if ($show_loan_offer_flag) {
221
  ?>
222
- jQuery('#clxLoanApplicationModal').find('.modal-footer').html('<a href="javascript:void(0);" class="btn btn-default clx_common_next_prev_btn" data-tab="1" data-btn="prev">Previous</a><a href="javascript:void(0);" class="btn btn-default clx_check_eligibility_btn">Check Eligibility</a><a href="javascript:void(0);" class="btn btn-primary clx_loan_application_submit_btn">Create Loan Application</a>');
223
  <?php
224
  } else {
225
  ?>
@@ -260,7 +272,7 @@ if ($show_loan_offer_flag) {
260
 
261
  var current_element = jQuery(this);
262
  jQuery(current_element).addClass('disabled');
263
- jQuery('#loanApplicationForm').hide();
264
  var serializeData = jQuery('#personal_information_form1,#bankdetails_and_ssn_form2,#confirmation_and_submit_form3').serializeArray();
265
  var selected_loan_offer = jQuery('.clx_loan_offer_select:checked');
266
  serializeData.push({name: 'loanOfferId', value: jQuery(selected_loan_offer).val()});
@@ -272,11 +284,15 @@ if ($show_loan_offer_flag) {
272
  serializeData.push({name: 'lenderName', value: jQuery(selected_loan_offer).data('lendername')});
273
  serializeData.push({name: 'paymentFrequency', value: jQuery(selected_loan_offer).data('paymentfrequency')});
274
  serializeData.push({name: 'downPayment', value: jQuery(selected_loan_offer).data('downpayment')});
275
- <?php /*
276
  var current_tr = jQuery('.clx_loan_offer_select:checked').closest('tr').clone(true);
277
  jQuery(current_tr).find('td').first().remove();
278
- jQuery(current_tr).find('td').last().remove();
279
- */?>
 
 
 
 
280
  jQuery.ajax({
281
  url: "<?php echo(Mage::getBaseUrl() . 'clxfunding/ClxAPI/storeSelectedLoanOffer'); ?>",
282
  data: serializeData,
@@ -284,6 +300,7 @@ if ($show_loan_offer_flag) {
284
  dataType: 'json',
285
  success: function (res)
286
  {
 
287
  jQuery(current_element).removeClass('disabled');
288
  if (res.valid)
289
  {
@@ -300,12 +317,14 @@ if ($show_loan_offer_flag) {
300
  }
301
  }
302
  });
303
- <?php /*
 
304
  var custom_table = '<table class="table table-bordered"><caption><h5>Offer selected by you </h5></caption><thead><tr><th>Monthly Payment</th><th>Terms</th><th>APR(%)</th><th>Loan Rate(%)</th></tr></thead><tbody><tr>' + jQuery(current_tr).html() + '</tr></tbody></table>';
305
  bootbox.dialog({
306
  message: custom_table,
307
  title: "Confirmation",
308
  className:'textAlign_c',
 
309
  buttons: {
310
  success: {
311
  label: "Yes",
@@ -318,6 +337,7 @@ if ($show_loan_offer_flag) {
318
  dataType: 'json',
319
  success: function (res)
320
  {
 
321
  jQuery(current_element).removeClass('disabled');
322
  if (res.valid)
323
  {
@@ -341,29 +361,31 @@ if ($show_loan_offer_flag) {
341
  className: "btn-danger",
342
  callback: function () {
343
  jQuery(current_element).removeClass('disabled');
344
- jQuery('#loanApplicationForm').show();
 
345
  }
346
  }
347
  }
348
- });*/?>
 
349
  });
350
  jQuery(document).on('click', '.clx_loan_offer_back', function (event) {
351
  event.preventDefault();
352
  event.stopImmediatePropagation();
353
-
354
  jQuery(this).closest('.modal').remove();
355
- jQuery(document).find('#clxLoanApplicationModal').show();
 
356
  });
357
  /* continue button after loan application accepted by clx*/
358
  jQuery(document).on('click', '.clx_funding_continue', function (event) {
359
  event.preventDefault();
360
  event.stopImmediatePropagation();
361
-
362
  jQuery.ajax({
363
  url: "<?php echo(Mage::getBaseUrl() . 'clxfunding/ClxAPI/setLoanApplicationSess'); ?>",
364
  dataType: 'json',
365
  success: function (res)
366
  {
 
367
  if (res.valid)
368
  {
369
  jQuery(document).find('#p_method_clxfunding').prop('checked', 'checked');
@@ -378,19 +400,17 @@ if ($show_loan_offer_flag) {
378
  jQuery(document).on('click', '.clx_funding_return', function (event) {
379
  event.preventDefault();
380
  event.stopImmediatePropagation();
381
-
382
  jQuery(this).closest('.modal').remove();
383
  jQuery(document).find('#clxLoanApplicationModal').remove();
384
  jQuery(document).find('#loanApplicationForm').remove();
385
  jQuery(document).find('#loanApplicationStatus').remove();
386
  jQuery(document).find('#loading_div').remove();
387
-
388
  });
389
  /* form submit on button click check eligibility,submit button click*/
390
  jQuery(document).on('click', '.clx_check_eligibility_btn,.clx_loan_application_submit_btn', function (event) {
391
  event.preventDefault();
392
  event.stopImmediatePropagation();
393
-
394
  jQuery('#loading_div').show();
395
  var btn_flag = jQuery(this);
396
  jQuery(btn_flag).addClass('disabled');
@@ -406,16 +426,30 @@ if ($show_loan_offer_flag) {
406
  {
407
  jQuery("#clxLoanApplicationModal").find('#clx_btn_flag').val('loan_apply');
408
  }
409
-
410
  loan_application_form_submit(btn_flag);
411
  });
412
  /* loan form close event - uncheck radio button*/
413
  jQuery('body').delegate('.clx_modal_form_close', 'click', function () {
414
  jQuery('#p_method_clxfunding').prop('checked', false);
 
415
 
416
  });
417
  /* end */
 
 
 
 
418
  });
 
 
 
 
 
 
 
 
 
 
419
  function loan_application_form_submit(btn_flag)
420
  {
421
  var url = jQuery('#clxLoanApplicationModal').find('#loan_application_redirect_url').val();
@@ -498,7 +532,7 @@ if ($show_loan_offer_flag) {
498
  <?php
499
  if ($show_loan_offer_flag) {
500
  ?>
501
- jQuery('#clxLoanApplicationModal').find('.modal-footer').html('<a href="javascript:void(0);" class="btn btn-default clx_common_next_prev_btn" data-tab="1" data-btn="prev">Previous</a><a href="javascript:void(0);" class="btn btn-default clx_check_eligibility_btn">Check Eligibility</a><a href="javascript:void(0);" class="btn btn-primary clx_loan_application_submit_btn">Create Loan Application</a>');
502
  <?php
503
  } else {
504
  ?>
@@ -540,11 +574,11 @@ if ($show_loan_offer_flag) {
540
  {
541
  if (jQuery('#clxLoanApplicationModal').length)
542
  {
543
- jQuery('#clxLoanApplicationModal').hide();
544
  }
545
  if (jQuery('#loanApplicationForm').length)
546
  {
547
- jQuery('#loanApplicationForm').hide();
548
  }
549
  var offerView = ret_data.offer_view;
550
  jQuery(offerView).modal({backdrop: 'static', keyboard: false});
@@ -589,11 +623,11 @@ if ($show_loan_offer_flag) {
589
  {
590
  if (jQuery('#clxLoanApplicationModal').length)
591
  {
592
- jQuery('#clxLoanApplicationModal').hide();
593
  }
594
  if (jQuery('#loanApplicationForm').length)
595
  {
596
- jQuery('#loanApplicationForm').hide();
597
  }
598
  var offerView = ret_data.offer_view;
599
  jQuery(offerView).modal({backdrop: 'static', keyboard: false});
@@ -656,5 +690,84 @@ if ($show_loan_offer_flag) {
656
  }
657
  return diff;
658
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
  </script>
660
 
2
  $show_loan_offer_flag = Mage::getStoreConfig('payment/clxfunding/show_loan_offer');
3
  ?>
4
  <script>
5
+ jQuery(document).ready(function (jQuery) {
6
+
7
+ var FromEndDate = new Date();
8
+ var ToEndDate = new Date();
9
+
10
+ ToEndDate.setDate(ToEndDate.getDate()+365);
11
+ jQuery(document).on('focus','#birthDate',function(){
12
  var cur_input = jQuery(this);
13
+ jQuery('#birthDate').datepicker({
14
+ container:jQuery('#birthDate').closest('div.custom_width'),
15
  format: "yyyy-mm-dd",
16
+ orientation:'top auto',
17
+ endDate: FromEndDate,
18
+ autoclose: true
19
  }).on('hide', function (e) {
20
  e.preventDefault();
21
  jQuery(cur_input).removeAttr('style');
22
+ }).on('changeDate', function(selected){
23
  jQuery('#employmentStartDate').val('');
24
+ jQuery('#employmentStartDate').prop('disabled',false);
25
+ var startDate = new Date(selected.date.valueOf());
26
+ startDate.setDate(startDate.getDate(new Date(selected.date.valueOf())));
27
  jQuery('#employmentStartDate').datepicker({
28
+ container:jQuery('#employmentStartDate').closest('div.custom_width'),
29
  format: "yyyy-mm-dd",
30
+ orientation:'bottom left',
31
  endDate: new Date(),
32
+ autoclose: true
33
  });
34
+ jQuery('#employmentStartDate').datepicker('setStartDate', startDate);
35
  });
36
  });
37
+ jQuery(document).on('focus','#employmentStartDate',function(){
38
  var cur_input = jQuery(this);
39
+ jQuery('#employmentStartDate').datepicker({
40
+ container:jQuery('#employmentStartDate').closest('div.custom_width'),
41
  format: "yyyy-mm-dd",
42
+ orientation:'bottom left',
43
  endDate: new Date(),
44
+ autoclose: true
45
  }).on('hide', function (e) {
46
  e.preventDefault();
47
  jQuery(cur_input).removeAttr('style');
48
  });
49
  });
50
+
51
+ jQuery(document).on('change','#country',function(){
52
+ var c_code = jQuery(this).find(":selected").attr('data-countryCode');
53
+ jQuery('#ssn').val('');
54
+ if(c_code!='US'){
55
+ jQuery('#ssn').closest('li').hide();
56
+ jQuery('#ssn').prop('disabled','disabled');
57
+ }
58
+ else{
59
+ jQuery('#ssn').closest('li').show();
60
+ jQuery('#ssn').prop('disabled',false);
61
+ }
62
+ jQuery.ajax({
63
+ url: "<?php echo(Mage::getBaseUrl() . 'clxfunding/ClxAPI/getStateList'); ?>",
64
+ data : {'country_code':c_code},
65
+ type:'post',
66
+ dataType: 'html',
67
+ success: function (response)
68
+ {
69
+ if(response!='error')
70
+ {
71
+ jQuery('#state').closest('div.custom_width').html(response);
72
+ }
73
+ },
74
+ beforeSend: function () {
75
+ jQuery('#loading_div').show();
76
+ },
77
+ complete: function () {
78
+ jQuery(document).find('#loading_div').hide();
79
  }
80
+ });
 
 
 
 
81
  });
82
+ jQuery('#p_method_clxfunding').prop('checked', false); // uncheck online loan initially
83
+ /* to show help link along with radio button */
84
  jQuery('<a href="javascript:void(0);" class="clx_info" title="About CLX Funding"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>frontend/base/default/css/Clx/help.png"/></a>').insertAfter(jQuery('#p_method_clxfunding').next('label'));
85
  jQuery('#p_method_clxfunding').click(function (event) {
86
  event.preventDefault();
104
  var loanAppForm = response.loan_app_view;
105
  jQuery(loanAppForm).find('#loading_div').hide();
106
  jQuery(loanAppForm).modal({backdrop: 'static', keyboard: false}); // show modal
107
+ jQuery('body').css({"padding-right": "0px"});
108
  }
109
  else
110
  {
169
  <?php
170
  if ($show_loan_offer_flag) {
171
  ?>
172
+ jQuery('#clxLoanApplicationModal').find('.modal-footer').html('<a href="javascript:void(0);" class="btn btn-default clx_common_next_prev_btn" data-tab="1" data-btn="prev">Previous</a><a href="javascript:void(0);" class="btn btn-default clx_check_eligibility_btn">Get Loan Offers</a><a href="javascript:void(0);" class="btn btn-primary clx_loan_application_submit_btn">Create Loan Application</a>');
173
  <?php
174
  } else {
175
  ?>
231
  <?php
232
  if ($show_loan_offer_flag) {
233
  ?>
234
+ jQuery('#clxLoanApplicationModal').find('.modal-footer').html('<a href="javascript:void(0);" class="btn btn-default clx_common_next_prev_btn" data-tab="1" data-btn="prev">Previous</a><a href="javascript:void(0);" class="btn btn-default clx_check_eligibility_btn">Get Loan Offers</a><a href="javascript:void(0);" class="btn btn-primary clx_loan_application_submit_btn">Create Loan Application</a>');
235
  <?php
236
  } else {
237
  ?>
272
 
273
  var current_element = jQuery(this);
274
  jQuery(current_element).addClass('disabled');
275
+ jQuery('#loanApplicationForm').modal('hide');
276
  var serializeData = jQuery('#personal_information_form1,#bankdetails_and_ssn_form2,#confirmation_and_submit_form3').serializeArray();
277
  var selected_loan_offer = jQuery('.clx_loan_offer_select:checked');
278
  serializeData.push({name: 'loanOfferId', value: jQuery(selected_loan_offer).val()});
284
  serializeData.push({name: 'lenderName', value: jQuery(selected_loan_offer).data('lendername')});
285
  serializeData.push({name: 'paymentFrequency', value: jQuery(selected_loan_offer).data('paymentfrequency')});
286
  serializeData.push({name: 'downPayment', value: jQuery(selected_loan_offer).data('downpayment')});
287
+
288
  var current_tr = jQuery('.clx_loan_offer_select:checked').closest('tr').clone(true);
289
  jQuery(current_tr).find('td').first().remove();
290
+ //jQuery(current_tr).find('td').last().remove();
291
+ if(!(jQuery(current_tr).find('td').last().hasClass('last'))){
292
+ jQuery(current_tr).find('td').last().remove();
293
+ }
294
+
295
+ <?php /*
296
  jQuery.ajax({
297
  url: "<?php echo(Mage::getBaseUrl() . 'clxfunding/ClxAPI/storeSelectedLoanOffer'); ?>",
298
  data: serializeData,
300
  dataType: 'json',
301
  success: function (res)
302
  {
303
+
304
  jQuery(current_element).removeClass('disabled');
305
  if (res.valid)
306
  {
317
  }
318
  }
319
  });
320
+ <?php */ ?>
321
+
322
  var custom_table = '<table class="table table-bordered"><caption><h5>Offer selected by you </h5></caption><thead><tr><th>Monthly Payment</th><th>Terms</th><th>APR(%)</th><th>Loan Rate(%)</th></tr></thead><tbody><tr>' + jQuery(current_tr).html() + '</tr></tbody></table>';
323
  bootbox.dialog({
324
  message: custom_table,
325
  title: "Confirmation",
326
  className:'textAlign_c',
327
+ closeButton: false,
328
  buttons: {
329
  success: {
330
  label: "Yes",
337
  dataType: 'json',
338
  success: function (res)
339
  {
340
+ removeModalFromBody();
341
  jQuery(current_element).removeClass('disabled');
342
  if (res.valid)
343
  {
361
  className: "btn-danger",
362
  callback: function () {
363
  jQuery(current_element).removeClass('disabled');
364
+ jQuery('#loanApplicationForm').modal('show');
365
+ ModalOpenFix();
366
  }
367
  }
368
  }
369
+ });
370
+ jQuery('body').css({"padding-right": "0px"});
371
  });
372
  jQuery(document).on('click', '.clx_loan_offer_back', function (event) {
373
  event.preventDefault();
374
  event.stopImmediatePropagation();
 
375
  jQuery(this).closest('.modal').remove();
376
+ jQuery(document).find('#clxLoanApplicationModal').modal('show');
377
+ ModalOpenFix();
378
  });
379
  /* continue button after loan application accepted by clx*/
380
  jQuery(document).on('click', '.clx_funding_continue', function (event) {
381
  event.preventDefault();
382
  event.stopImmediatePropagation();
 
383
  jQuery.ajax({
384
  url: "<?php echo(Mage::getBaseUrl() . 'clxfunding/ClxAPI/setLoanApplicationSess'); ?>",
385
  dataType: 'json',
386
  success: function (res)
387
  {
388
+ removeModalFromBody();
389
  if (res.valid)
390
  {
391
  jQuery(document).find('#p_method_clxfunding').prop('checked', 'checked');
400
  jQuery(document).on('click', '.clx_funding_return', function (event) {
401
  event.preventDefault();
402
  event.stopImmediatePropagation();
 
403
  jQuery(this).closest('.modal').remove();
404
  jQuery(document).find('#clxLoanApplicationModal').remove();
405
  jQuery(document).find('#loanApplicationForm').remove();
406
  jQuery(document).find('#loanApplicationStatus').remove();
407
  jQuery(document).find('#loading_div').remove();
408
+ removeModalFromBody();
409
  });
410
  /* form submit on button click check eligibility,submit button click*/
411
  jQuery(document).on('click', '.clx_check_eligibility_btn,.clx_loan_application_submit_btn', function (event) {
412
  event.preventDefault();
413
  event.stopImmediatePropagation();
 
414
  jQuery('#loading_div').show();
415
  var btn_flag = jQuery(this);
416
  jQuery(btn_flag).addClass('disabled');
426
  {
427
  jQuery("#clxLoanApplicationModal").find('#clx_btn_flag').val('loan_apply');
428
  }
 
429
  loan_application_form_submit(btn_flag);
430
  });
431
  /* loan form close event - uncheck radio button*/
432
  jQuery('body').delegate('.clx_modal_form_close', 'click', function () {
433
  jQuery('#p_method_clxfunding').prop('checked', false);
434
+ removeModalFromBody();
435
 
436
  });
437
  /* end */
438
+
439
+ jQuery(document).on("shown.bs.modal","#clxLoanApplicationModal,#loanApplicationForm", function () {
440
+ jQuery("body").addClass("modal-open");
441
+ jQuery("body").css("padding-right","0px");
442
  });
443
+
444
+ function ModalOpenFix(){
445
+ console.log(jQuery(document).find('body'));
446
+ jQuery(document).find('body').addClass("modal-open1");
447
+ jQuery(document).find('body').css({"padding-right":"0px"});
448
+ }
449
+ function removeModalFromBody(){
450
+ jQuery(document).find('body').removeClass('modal-open');
451
+ jQuery(document).find('body').css({'padding-right':'0px'});
452
+ }
453
  function loan_application_form_submit(btn_flag)
454
  {
455
  var url = jQuery('#clxLoanApplicationModal').find('#loan_application_redirect_url').val();
532
  <?php
533
  if ($show_loan_offer_flag) {
534
  ?>
535
+ jQuery('#clxLoanApplicationModal').find('.modal-footer').html('<a href="javascript:void(0);" class="btn btn-default clx_common_next_prev_btn" data-tab="1" data-btn="prev">Previous</a><a href="javascript:void(0);" class="btn btn-default clx_check_eligibility_btn">Get Loan Offers</a><a href="javascript:void(0);" class="btn btn-primary clx_loan_application_submit_btn">Create Loan Application</a>');
536
  <?php
537
  } else {
538
  ?>
574
  {
575
  if (jQuery('#clxLoanApplicationModal').length)
576
  {
577
+ jQuery('#clxLoanApplicationModal').modal('hide');
578
  }
579
  if (jQuery('#loanApplicationForm').length)
580
  {
581
+ jQuery('#loanApplicationForm').modal('hide');
582
  }
583
  var offerView = ret_data.offer_view;
584
  jQuery(offerView).modal({backdrop: 'static', keyboard: false});
623
  {
624
  if (jQuery('#clxLoanApplicationModal').length)
625
  {
626
+ jQuery('#clxLoanApplicationModal').modal('hide');
627
  }
628
  if (jQuery('#loanApplicationForm').length)
629
  {
630
+ jQuery('#loanApplicationForm').modal('hide');
631
  }
632
  var offerView = ret_data.offer_view;
633
  jQuery(offerView).modal({backdrop: 'static', keyboard: false});
690
  }
691
  return diff;
692
  }
693
+
694
+
695
+ Validation.addAllThese([
696
+ ['validate-select', 'Please select an option.', function(v) {
697
+ return ((v != "none") && (v != null) && (v.length != 0));
698
+ }],
699
+ ['required-entry', 'This is a required field.', function(v) {
700
+ return !Validation.get('IsEmpty').test(v);
701
+ }],
702
+ ['validate-number', 'Please enter a valid number.', function(v) {
703
+ return Validation.get('IsEmpty').test(v) || (!isNaN(parseNumber(v)) && !/^\s+$/.test(parseNumber(v)));
704
+ }],
705
+ ['validate-digits', 'Please use numbers only in this field.', function(v) {
706
+ return Validation.get('IsEmpty').test(v) || !/[^\d]/.test(v);
707
+ }],
708
+ ['validate-digits-range', 'The value is not within the specified range.', function(v, elm) {
709
+ var result = Validation.get('IsEmpty').test(v) || !/[^\d]/.test(v);
710
+ var reRange = new RegExp(/^digits-range-[0-9]+-[0-9]+$/);
711
+ $w(elm.className).each(function(name, index) {
712
+ if (name.match(reRange) && result) {
713
+ var min = parseInt(name.split('-')[2], 10);
714
+ var max = parseInt(name.split('-')[3], 10);
715
+ var val = parseInt(v, 10);
716
+ result = (v >= min) && (v <= max);
717
+ }
718
+ });
719
+ return result;
720
+ }],
721
+ ['validate-email', 'Please enter a valid email address.', function (v) {
722
+ return Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
723
+ }],
724
+ ['validate-ssn', 'Please enter a valid social security number.', function(v) {
725
+ return Validation.get('IsEmpty').test(v) || /^\d{3}-?\d{2}-?\d{4}$/.test(v);
726
+ }],
727
+ ['validate-zip-international', 'Please enter a valid zip code.', function(v) {
728
+ return true;
729
+ }],
730
+ ['validate-greater-than-zero', 'Loan Terms should be greater than 0.', function(v) {
731
+ if(v.length)
732
+ return parseFloat(v) > 0;
733
+ else
734
+ return true;
735
+ }],
736
+
737
+ ['validate-mobile-number', 'Mobile number should not greater than 10 digits.', function (v, elm) {
738
+ var reMax = new RegExp(/^maximum-length-[0-9]+$/);
739
+ var reMin = new RegExp(/^minimum-length-[0-9]+$/);
740
+ var result = true;
741
+ $w(elm.className).each(function(name, index) {
742
+ if (name.match(reMax) && result) {
743
+ var length = name.split('-')[2];
744
+ result = (v.length <= length);
745
+ }
746
+ if (name.match(reMin) && result && !Validation.get('IsEmpty').test(v)) {
747
+ var length = name.split('-')[2];
748
+ result = (v.length >= length);
749
+ }
750
+ });
751
+ return result;
752
+ }],
753
+ ['validate-mobile-phone-area-code', 'This should not greater than 3 digits', function (v, elm) {
754
+ var reMax = new RegExp(/^maximum-length-[0-9]+$/);
755
+ var reMin = new RegExp(/^minimum-length-[0-9]+$/);
756
+ var result = true;
757
+ $w(elm.className).each(function(name, index) {
758
+ if (name.match(reMax) && result) {
759
+ var length = name.split('-')[2];
760
+ result = (v.length <= length);
761
+ }
762
+ if (name.match(reMin) && result && !Validation.get('IsEmpty').test(v)) {
763
+ var length = name.split('-')[2];
764
+ result = (v.length >= length);
765
+ }
766
+ });
767
+ return result;
768
+ }],
769
+
770
+ ]);
771
+ });
772
  </script>
773
 
app/design/frontend/base/default/template/clxfunding/form/confirm_user_acceptance.phtml CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="">
2
  <div class="">
3
  <form name="loan_offer_acceptance" id="loan_offer_acceptance" method="post" action="<?php echo Mage::getBaseUrl() . 'clxfunding/ClxAPI/checkLoanOfferAcceptanceStatus'; ?>">
1
+ <!-- trash file -->
2
  <div class="">
3
  <div class="">
4
  <form name="loan_offer_acceptance" id="loan_offer_acceptance" method="post" action="<?php echo Mage::getBaseUrl() . 'clxfunding/ClxAPI/checkLoanOfferAcceptanceStatus'; ?>">
app/design/frontend/base/default/template/clxfunding/form/loan_offer_response.phtml CHANGED
@@ -38,7 +38,7 @@
38
  <td><?php echo('$' . (isset($data->loan_offers[$i]->paymentAmount) ? $data->loan_offers[$i]->paymentAmount : '')); ?></td>
39
  <td><?php echo(isset($data->loan_offers[$i]->loanTerm) ? $data->loan_offers[$i]->loanTerm : ''); ?></td>
40
  <td><?php echo((isset($data->loan_offers[$i]->loanAPR) ? $data->loan_offers[$i]->loanAPR : '') . "%"); ?></td>
41
- <td><?php echo((isset($data->loan_offers[$i]->loanRate) ? $data->loan_offers[$i]->loanRate."%": '-')); ?></td>
42
  <?php if(isset($data->loan_offers[$i]->showSelectedOfferUrl)){
43
  echo "<td><a href='".$data->loan_offers[$i]->showSelectedOfferUrl."' target='_blank'>More Details</a></td>";
44
  }?>
@@ -51,10 +51,9 @@
51
  <?php } else { ?>
52
  <p>No loan offers available.<p>
53
  <?php }
54
- } else {
55
- ?>
56
  <p>We are sorry to inform you that your loan application cannot be processed further.<p>
57
- <?php } ?>
58
 
59
  </div>
60
  <div class="modal-footer">
38
  <td><?php echo('$' . (isset($data->loan_offers[$i]->paymentAmount) ? $data->loan_offers[$i]->paymentAmount : '')); ?></td>
39
  <td><?php echo(isset($data->loan_offers[$i]->loanTerm) ? $data->loan_offers[$i]->loanTerm : ''); ?></td>
40
  <td><?php echo((isset($data->loan_offers[$i]->loanAPR) ? $data->loan_offers[$i]->loanAPR : '') . "%"); ?></td>
41
+ <td class='<?php echo(!(count($data->loan_offers) && isset($data->loan_offers[0]->showSelectedOfferUrl))?'last':'');?>'><?php echo((isset($data->loan_offers[$i]->loanRate) ? $data->loan_offers[$i]->loanRate."%": '-')); ?></td>
42
  <?php if(isset($data->loan_offers[$i]->showSelectedOfferUrl)){
43
  echo "<td><a href='".$data->loan_offers[$i]->showSelectedOfferUrl."' target='_blank'>More Details</a></td>";
44
  }?>
51
  <?php } else { ?>
52
  <p>No loan offers available.<p>
53
  <?php }
54
+ } else {?>
 
55
  <p>We are sorry to inform you that your loan application cannot be processed further.<p>
56
+ <?php } ?>
57
 
58
  </div>
59
  <div class="modal-footer">
app/design/frontend/base/default/template/clxfunding/form/modal_clxfunding.phtml CHANGED
@@ -26,13 +26,13 @@
26
  <div class="col-md-6">
27
  <label for="firstName" class="required"><em>*</em>First Name:</label>
28
  <div class="input-box custom_width">
29
- <input type="text" autocapitalize="on" autocorrect="off" spellcheck="false" class="input-text required-entry validate-no-html-tags validate-alpha-spac" id="firstName" name="firstName" value="<?php echo(isset($customer_data['firstname'])?$customer_data['firstname']:'');?>">
30
  </div>
31
  </div>
32
  <div class="col-md-6">
33
  <label for="lastName" class="required"><em>*</em>Last Name:</label>
34
  <div class="input-box custom_width">
35
- <input type="text" autocapitalize="on" autocorrect="off" spellcheck="false" class="input-text required-entry validate-no-html-tags validate-alpha-spac" id="lastName" name="lastName" value="<?php echo(isset($customer_data['lastname'])?$customer_data['lastname']:'');?>">
36
  </div>
37
  </div>
38
  </div>
@@ -48,7 +48,7 @@
48
  <div class="col-md-6">
49
  <label for="birthDate" class="required"><em>*</em>Date of birth:</label>
50
  <div class="input-box custom_width">
51
- <input type="text" autocorrect="off" spellcheck="false" class="input-text required-entry validate-date validate-no-html-tags custom-dob" id="birthDate" name="birthDate" readonly="readonly" value="">
52
  </div>
53
  </div>
54
  </div>
@@ -64,7 +64,7 @@
64
  <div class="col-md-6">
65
  <label for="mobilePhoneAreaCode" class="required"><em>*</em>Mobile phone area code:</label>
66
  <div class="input-box custom_width">
67
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-length maximum-length-3 validate-no-html-tags" id="mobilePhoneAreaCode" name="mobilePhoneAreaCode" value="">
68
  </div>
69
  </div>
70
  </div>
@@ -74,13 +74,13 @@
74
  <div class="col-md-6">
75
  <label for="mobileNumber" class="required"><em>*</em>Mobile number:</label>
76
  <div class="input-box custom_width">
77
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-number validate-length validate-no-html-tags maximum-length-10" id="mobileNumber" name="mobileNumber" value="<?php echo(isset($customer_data['telephone'])?$customer_data['telephone']:'');?>">
78
  </div>
79
  </div>
80
  <div class="col-md-6">
81
  <label for="city" class="required"><em>*</em>City:</label>
82
  <div class="input-box custom_width">
83
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-alpha-spac validate-no-html-tags" id="city" name="city" value="<?php echo(isset($customer_data['city'])?$customer_data['city']:'');?>">
84
  </div>
85
  </div>
86
  </div>
@@ -90,77 +90,26 @@
90
  <div class="col-md-6">
91
  <label for="state" class="required"><em>*</em>State:</label>
92
  <div class="input-box custom_width">
93
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-alpha-spac validate-no-html-tags" id="state" name="state" value="<?php echo(isset($customer_data['region'])?$customer_data['region']:'');?>">
94
- </div>
95
- <?php /*
96
- <div class="input-box custom_width">
97
- <select class="input-text select_input_f validate-select validate-no-html-tags" id="state" name="state">
98
- <option value="">Please select state</option>
99
- <option value="Alabama">Alabama</option>
100
- <option value="Alaska">Alaska</option>
101
- <option value="Arizona">Arizona</option>
102
- <option value="Arkansas">Arkansas</option>
103
- <option value="California">California</option>
104
- <option value="Colorado">Colorado</option>
105
- <option value="Connecticut">Connecticut</option>
106
- <option value="Delaware">Delaware</option>
107
- <option value="District Of Columbia">District Of Columbia</option>
108
- <option value="Florida">Florida</option>
109
- <option value="Georgia">Georgia</option>
110
- <option value="Hawaii">Hawaii</option>
111
- <option value="Idaho">Idaho</option>
112
- <option value="Illinois">Illinois</option>
113
- <option value="Indiana">Indiana</option>
114
- <option value="Iowa">Iowa</option>
115
- <option value="Kansas">Kansas</option>
116
- <option value="Kentucky">Kentucky</option>
117
- <option value="Louisiana">Louisiana</option>
118
- <option value="Maine">Maine</option>
119
- <option value="Maryland">Maryland</option>
120
- <option value="Massachusetts">Massachusetts</option>
121
- <option value="Michigan">Michigan</option>
122
- <option value="Minnesota">Minnesota</option>
123
- <option value="Mississippi">Mississippi</option>
124
- <option value="Missouri">Missouri</option>
125
- <option value="Montana">Montana</option>
126
- <option value="Nebraska">Nebraska</option>
127
- <option value="Nevada">Nevada</option>
128
- <option value="New Hampshire">New Hampshire</option>
129
- <option value="New Jersey">New Jersey</option>
130
- <option value="New Mexico">New Mexico</option>
131
- <option value="New York">New York</option>
132
- <option value="North Carolina">North Carolina</option>
133
- <option value="North Dakota">North Dakota</option>
134
- <option value="Ohio">Ohio</option>
135
- <option value="Oklahoma">Oklahoma</option>
136
- <option value="Oregon">Oregon</option>
137
- <option value="Pennsylvania">Pennsylvania</option>
138
- <option value="Rhode Island">Rhode Island</option>
139
- <option value="South Carolina">South Carolina</option>
140
- <option value="South Dakota">South Dakota</option>
141
- <option value="Tennessee">Tennessee</option>
142
- <option value="Texas">Texas</option>
143
- <option value="Utah">Utah</option>
144
- <option value="Vermont">Vermont</option>
145
- <option value="Virginia">Virginia</option>
146
- <option value="Washington">Washington</option>
147
- <option value="West Virginia">West Virginia</option>
148
- <option value="Wisconsin">Wisconsin</option>
149
- <option value="Wyoming">Wyoming</option>
150
- <option value="American Samoa">American Samoa</option>
151
- <option value="Guam">Guam</option>
152
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
153
- <option value="Puerto Rico">Puerto Rico</option>
154
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
155
- <option value="Virgin Islands">Virgin Islands</option>
156
  </select>
 
 
 
157
  </div>
158
- */ ?>
159
  </div>
160
  <div class="col-md-6">
161
  <label for="zipcode" class="required"><em>*</em>Zipcode:</label>
162
  <div class="input-box custom_width">
163
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-zip validate-length maximum-length-10" id="zipcode" name="zipcode" value="<?php echo(isset($customer_data['postcode'])?$customer_data['postcode']:'');?>">
164
  </div>
165
  </div>
166
  </div>
@@ -170,8 +119,22 @@
170
  <div class="col-md-6">
171
  <label for="country" class="required"><em>*</em>Country:</label>
172
  <div class="input-box custom_width">
173
- <?php if(isset($customer_data['country_id'])){$countryName = Mage::getModel('directory/country')->load($customer_data['country_id'])->getName();}?>
174
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-alpha-spac" id="country" name="country" value="<?php echo(isset($countryName)?$countryName:'');?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  </div>
176
  </div>
177
  <div class="col-md-6">
@@ -272,13 +235,13 @@
272
  <div class="col-md-6">
273
  <label for="employerName" class="required"><em>*</em>Employer name:</label>
274
  <div class="input-box custom_width">
275
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-alpha-spac" id="employerName" name="employerName" value="">
276
  </div>
277
  </div>
278
  <div class="col-md-6">
279
  <label for="employmentStartDate" class="required"><em>*</em>Employment start date:</label>
280
  <div class="input-box custom_width">
281
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-date" id="employmentStartDate" name="employmentStartDate" readonly="readonly" value="">
282
  </div>
283
  </div>
284
  </div>
@@ -308,7 +271,7 @@
308
  <li>
309
  <label for="firstAccountHolderName" class="required"><em>*</em>First account holder name:</label>
310
  <div class="input-box">
311
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-alpha-spac validate-length maximum-length-255" id="firstAccountHolderName" name="firstAccountHolderName" value="">
312
  </div>
313
  </li>
314
  <li>
@@ -334,10 +297,10 @@
334
  <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-length maximum-length-255" id="routingNumber" name="routingNumber" value="">
335
  </div>
336
  </li>
337
- <li>
338
  <label for="ssn" class="required"><em>*</em>Social Security Number:</label>
339
  <div class="input-box">
340
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text custom-ssn required-entry validate-number" id="ssn" name="ssn" value="">
341
  </div>
342
  </li>
343
  </form>
@@ -348,42 +311,17 @@
348
  <label for="loanAmount" class="required"><em>*</em>Loan amount:(<?php echo(Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol()); ?>)</label>
349
  <div class="input-box">
350
  <?php $grand_total = $this->getLoanAmmount(); ?>
351
- <input type="text" autocapitalize="off" readonly="readonly" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-number" id="loanAmount" name="loanAmount" value="<?php echo(isset($grand_total) ? $grand_total : ''); ?>">
 
352
  </div>
353
  </li>
354
  <?php
355
- echo "<input type='hidden' name='loanPurpose' value='Other'/>";
356
- /*
357
- <li>
358
- <label for="loanPurpose" class="required"><em>*</em>Loan purpose:</label>
359
- <div class="input-box">
360
- <select class="input-text select_input_f validate-select validate-no-html-tags" id="loanPurpose" name="loanPurpose">
361
- <option value="">Please select loan purpose</option>
362
- <option value="Debt consolidation">Debt consolidation</option>
363
- <option value="Home improvement">Home improvement</option>
364
- <option value="Business">Business</option>
365
- <option value="Auto">Auto</option>
366
- <option value="Other">Other</option>
367
- <option value="Baby & adoption loans">Baby & adoption loans</option>
368
- <option value="Boat">Boat</option>
369
- <option value="Cosmetic procedures">Cosmetic procedures</option>
370
- <option value="Green loans">Green loans</option>
371
- <option value="Household expenses">Household expenses</option>
372
- <option value="Large purchases">Large purchases</option>
373
- <option value="Medical/Dental">Medical/Dental</option>
374
- <option value="Motorcycle">Motorcycle</option>
375
- <option value="RV">RV</option>
376
- <option value="Taxes">Taxes</option>
377
- <option value="Vacation">Vacation</option>
378
- <option value="Special Occasion">Special Occasion</option>
379
- </select>
380
- </div>
381
- </li>
382
- */ ?>
383
  <li>
384
  <label for="loanTerms" class="required"><em>*</em>Loan terms (In months):</label>
385
  <div class="input-box">
386
- <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-digits" id="loanTerms" name="loanTerms" value="">
387
  </div>
388
  </li>
389
  </form>
@@ -403,6 +341,20 @@
403
  Validation.add('validate-alpha-spac', 'Allowed only alphabets', function (v) {
404
  return Validation.get('IsEmpty').test(v) || /^[a-zA-Z ]+$/.test(v)
405
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  });
407
  </script>
408
 
26
  <div class="col-md-6">
27
  <label for="firstName" class="required"><em>*</em>First Name:</label>
28
  <div class="input-box custom_width">
29
+ <input type="text" autocapitalize="on" autocorrect="off" spellcheck="false" class="input-text required-entry validate-no-html-tags" id="firstName" name="firstName" value="<?php echo(isset($customer_data['firstname'])?$customer_data['firstname']:'');?>">
30
  </div>
31
  </div>
32
  <div class="col-md-6">
33
  <label for="lastName" class="required"><em>*</em>Last Name:</label>
34
  <div class="input-box custom_width">
35
+ <input type="text" autocapitalize="on" autocorrect="off" spellcheck="false" class="input-text required-entry validate-no-html-tags" id="lastName" name="lastName" value="<?php echo(isset($customer_data['lastname'])?$customer_data['lastname']:'');?>">
36
  </div>
37
  </div>
38
  </div>
48
  <div class="col-md-6">
49
  <label for="birthDate" class="required"><em>*</em>Date of birth:</label>
50
  <div class="input-box custom_width">
51
+ <input type="text" autocorrect="off" spellcheck="false" class="input-text required-entry validate-date validate-no-html-tags custom-dob" id="birthDate" name="birthDate" readonly="readonly" value="" data-date-container='#clxLoanApplicationModal'>
52
  </div>
53
  </div>
54
  </div>
64
  <div class="col-md-6">
65
  <label for="mobilePhoneAreaCode" class="required"><em>*</em>Mobile phone area code:</label>
66
  <div class="input-box custom_width">
67
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-digits validate-mobile-phone-area-code maximum-length-3 validate-no-html-tags" id="mobilePhoneAreaCode" name="mobilePhoneAreaCode" value="">
68
  </div>
69
  </div>
70
  </div>
74
  <div class="col-md-6">
75
  <label for="mobileNumber" class="required"><em>*</em>Mobile number:</label>
76
  <div class="input-box custom_width">
77
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-digits validate-mobile-number validate-no-html-tags maximum-length-10" id="mobileNumber" name="mobileNumber" value="<?php echo(isset($customer_data['telephone'])?$customer_data['telephone']:'');?>">
78
  </div>
79
  </div>
80
  <div class="col-md-6">
81
  <label for="city" class="required"><em>*</em>City:</label>
82
  <div class="input-box custom_width">
83
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-no-html-tags" id="city" name="city" value="<?php echo(isset($customer_data['city'])?$customer_data['city']:'');?>">
84
  </div>
85
  </div>
86
  </div>
90
  <div class="col-md-6">
91
  <label for="state" class="required"><em>*</em>State:</label>
92
  <div class="input-box custom_width">
93
+ <?php
94
+ $states = Mage::getModel('directory/country')->load($customer_data['country_id'])->getRegions();
95
+ if (isset($states) && isset($customer_data['region_id']) && count($states) > 0){?>
96
+ <select class="select_input_f validate-select validate-no-html-tags" id="state" name="state">
97
+ <option value="">-- Please Select --</option>
98
+ <?php foreach($states as $state): ?>
99
+ <option value="<?php echo $state->getName();?>" data-countryCode="<?php echo $state->getId();?>" <?php echo(isset($customer_data['region_id'])?$customer_data['region_id']==$state->getId()?'selected="selected"':'':''); ?>>
100
+ <?php echo $state->getName();?>
101
+ </option>
102
+ <?php endforeach; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  </select>
104
+ <?php }else{?>
105
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-no-html-tags" id="state" name="state" value="<?php echo(isset($customer_data['region'])?$customer_data['region']:'');?>">
106
+ <?php }?>
107
  </div>
 
108
  </div>
109
  <div class="col-md-6">
110
  <label for="zipcode" class="required"><em>*</em>Zipcode:</label>
111
  <div class="input-box custom_width">
112
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-digits validate-length maximum-length-10" id="zipcode" name="zipcode" value="<?php echo(isset($customer_data['postcode'])?$customer_data['postcode']:'');?>">
113
  </div>
114
  </div>
115
  </div>
119
  <div class="col-md-6">
120
  <label for="country" class="required"><em>*</em>Country:</label>
121
  <div class="input-box custom_width">
122
+ <?php
123
+ $_countries = Mage::getResourceModel('directory/country_collection')
124
+ ->loadData()
125
+ ->toOptionArray(false);
126
+ if (count($_countries) > 0){?>
127
+ <select class="select_input_f validate-select validate-no-html-tags" id="country" name="country">
128
+ <option value="">-- Please Select --</option>
129
+ <?php foreach($_countries as $_country): ?>
130
+ <option value="<?php echo $_country['label'] ?>" data-countryCode="<?php echo $_country['value'];?>" <?php echo(isset($customer_data['country_id'])?$customer_data['country_id']==$_country['value']?'selected="selected"':'':''); ?>>
131
+ <?php echo $_country['label'] ?>
132
+ </option>
133
+ <?php endforeach; ?>
134
+ </select>
135
+ <?php }else{?>
136
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry" id="country" name="country" value="<?php echo(isset($countryName)?$countryName:'');?>">
137
+ <?php }?>
138
  </div>
139
  </div>
140
  <div class="col-md-6">
235
  <div class="col-md-6">
236
  <label for="employerName" class="required"><em>*</em>Employer name:</label>
237
  <div class="input-box custom_width">
238
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry" id="employerName" name="employerName" value="">
239
  </div>
240
  </div>
241
  <div class="col-md-6">
242
  <label for="employmentStartDate" class="required"><em>*</em>Employment start date:</label>
243
  <div class="input-box custom_width">
244
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-date" id="employmentStartDate" name="employmentStartDate" readonly="readonly" value="" data-date-container='#clxLoanApplicationModal'>
245
  </div>
246
  </div>
247
  </div>
271
  <li>
272
  <label for="firstAccountHolderName" class="required"><em>*</em>First account holder name:</label>
273
  <div class="input-box">
274
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-length maximum-length-255" id="firstAccountHolderName" name="firstAccountHolderName" value="">
275
  </div>
276
  </li>
277
  <li>
297
  <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-length maximum-length-255" id="routingNumber" name="routingNumber" value="">
298
  </div>
299
  </li>
300
+ <li <?php echo((isset($customer_data['country_id']) && $customer_data['country_id']=='US')?'style="display:block"':'style="display:none"');?>>
301
  <label for="ssn" class="required"><em>*</em>Social Security Number:</label>
302
  <div class="input-box">
303
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text custom-ssn required-entry validate-number" id="ssn" name="ssn" value="" <?php echo((isset($customer_data['country_id']) && $customer_data['country_id']=='US')?'':'disabled');?> />
304
  </div>
305
  </li>
306
  </form>
311
  <label for="loanAmount" class="required"><em>*</em>Loan amount:(<?php echo(Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol()); ?>)</label>
312
  <div class="input-box">
313
  <?php $grand_total = $this->getLoanAmmount(); ?>
314
+ <input type="text" disabled="disabled" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-number disabled" id="loanAmountDummy" name="loanAmountDummy" value="<?php echo(isset($grand_total) ? $grand_total : ''); ?>">
315
+ <input type="hidden" autocapitalize="off" autocorrect="off" spellcheck="false" id="loanAmount" name="loanAmount" value="<?php echo(isset($grand_total) ? $grand_total : ''); ?>">
316
  </div>
317
  </li>
318
  <?php
319
+ echo "<input type='hidden' name='loanPurpose' value='Other'/>";
320
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  <li>
322
  <label for="loanTerms" class="required"><em>*</em>Loan terms (In months):</label>
323
  <div class="input-box">
324
+ <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" class="validate-no-html-tags input-text required-entry validate-digits validate-greater-than-zero" id="loanTerms" name="loanTerms" value="">
325
  </div>
326
  </li>
327
  </form>
341
  Validation.add('validate-alpha-spac', 'Allowed only alphabets', function (v) {
342
  return Validation.get('IsEmpty').test(v) || /^[a-zA-Z ]+$/.test(v)
343
  });
344
+ jQuery(document).on('change','#employmentStatus',function(){
345
+ if(jQuery(this).val()!='Not Employed'){
346
+ jQuery('#employerName').closest('li').show();
347
+ jQuery('#occupation').closest('div.col-md-6').show();
348
+ jQuery('#occupation').prop('disabled',false);
349
+ jQuery('#employerName,#employmentStartDate').prop('disabled',false);
350
+ }
351
+ else{
352
+ jQuery('#occupation').closest('div.col-md-6').hide();
353
+ jQuery('#occupation').prop('disabled','disabled');
354
+ jQuery('#employerName').closest('li').hide();
355
+ jQuery('#employerName,#employmentStartDate').prop('disabled','disabled');
356
+ }
357
+ });
358
  });
359
  </script>
360
 
app/design/frontend/base/default/template/clxfunding/form/user_loan_offer_accept.phtml CHANGED
@@ -8,7 +8,7 @@ $data = $this->getLoanOfferStatus();
8
  ?>
9
  <form name="loan_offer_acceptance_res" id="loan_offer_acceptance_res" method="post" action="<?php echo Mage::getBaseUrl() . 'clxfunding/ClxAPI/saveOrderCustom'; ?>">
10
  <div class="">
11
- <p>Your application has been preliminarily approved and it will be processed within 24 hours.</p>
12
  <div class="buttons-set border-top-none">
13
  <button type="submit" class="button align-left" id="Confirm_Acceptance_Continue" title="Continue"><span><span>Continue to save order</span></span></button>
14
  </div>
8
  ?>
9
  <form name="loan_offer_acceptance_res" id="loan_offer_acceptance_res" method="post" action="<?php echo Mage::getBaseUrl() . 'clxfunding/ClxAPI/saveOrderCustom'; ?>">
10
  <div class="">
11
+ <p>Your application has been accepted, you will receive a confirmation email soon.</p>
12
  <div class="buttons-set border-top-none">
13
  <button type="submit" class="button align-left" id="Confirm_Acceptance_Continue" title="Continue"><span><span>Continue to save order</span></span></button>
14
  </div>
app/design/frontend/base/default/template/clxfunding/form/user_loan_offer_status.phtml CHANGED
@@ -7,7 +7,7 @@ $data = $this->getLoanOfferStatus();
7
  if (isset($data->application_status) && $data->application_status == "ACCEPTED") {
8
  ?>
9
  <div class="">
10
- <p>Your application has been preliminarily approved and it will be processed within 24 hours.</p>
11
  <div class="buttons-set border-top-none">
12
  <button class="button align-left" onclick="redirectURL()" title="My Account"><span><span>My Account</span></span></button>
13
  </div>
7
  if (isset($data->application_status) && $data->application_status == "ACCEPTED") {
8
  ?>
9
  <div class="">
10
+ <p>Your application has been accepted, you will receive a confirmation email soon.</p>
11
  <div class="buttons-set border-top-none">
12
  <button class="button align-left" onclick="redirectURL()" title="My Account"><span><span>My Account</span></span></button>
13
  </div>
app/locale/en_US/template/email/CLX/email-template/clx_loan_funded_U.html ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
2
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
3
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
4
+ <tr>
5
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
6
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
7
+ <!-- [ header starts here] -->
8
+ <tr>
9
+ <td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
10
+ </tr>
11
+ <tr>
12
+ <td>
13
+ <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
14
+ <tr>
15
+ <td align="center" style="margin: 0; padding: 0;padding: 35px 0">
16
+ <table cellpadding="0" cellspacing="0" border="0" align="center" width="650">
17
+ <tr>
18
+ <td width="620" valign="top" align="left" bgcolor="#ffffff"style="font-family: Georgia, serif; background: #fff;">
19
+ <p><strong>Dear Customer,</strong></p>
20
+ <br/>
21
+ <p>Your application <strong>{{var applicationID}}</strong> for the order number <strong>{{var orderNumber}}</strong> has been funded by lender</p>
22
+ </td>
23
+ </tr>
24
+ </table><!-- body -->
25
+ </td>
26
+ </tr>
27
+ </table>
28
+ </td>
29
+ </tr>
30
+ <tr>
31
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
32
+ </tr>
33
+ </table>
34
+ </td>
35
+ </tr>
36
+ </table>
37
+ </div>
38
+ </body>
package.xml CHANGED
@@ -2,7 +2,7 @@
2
  <package>
3
  <name>Clexchange_Funding</name>
4
  <version>1.0.0.0</version>
5
- <stability>stable</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
@@ -10,9 +10,9 @@
10
  <description>CLX Funding provides a way for online retailers to sell goods as part of the loan experience, but submitting application to CL exchange so that lenders can bid on them. It is basically an online marketplace that enables people to borrow money from the lenders without the involvement of banks or credit card companies. By cutting out the middle men and bypassing many of the traditional banking costs, it is able to provide multiple loan offers at different rates for borrowers</description>
11
  <notes>Stable Module</notes>
12
  <authors><author><name>Dhananjay Goel</name><user>agsdhananjay</user><email>dhananjay.goel@agstechnologies.com</email></author></authors>
13
- <date>2015-12-03</date>
14
- <time>07:37:18</time>
15
- <contents><target name="magecommunity"><dir name="."><dir name="CLExchange"><dir name="Clexchangefunding"><file name="ApprovalRequired.php" hash="96688bf7b67f8c0742ab9bad39cedeb9"/><dir name="Block"><dir name="Form"><file name="Clxfunding.php" hash="081527c555695d5ef6c431f7f6c12c95"/><file name="Clxfunding.php~" hash="a20584db3e9f4b099a7144d12a2b8ef3"/></dir></dir><file name="CronExpressionList.php" hash="d60ce922145f3ae36946fb439933de84"/><file name="CronExpressionList.php~" hash="517b5955d0b9a57f981774a24cc85f21"/><dir name="Helper"><file name="Data.php" hash="f3de7be5f6112b1bdccf39296da819f7"/><file name="Data.php~" hash="a730a72d6b337f5ef6f7ff871e5eda01"/></dir><file name="IsBestOffer.php" hash="96d8ff73ade5a8982181d61471f76140"/><dir name="Model"><file name="AccountIdV.php" hash="fce6f3dafa1e2cea6cf124864d9fc782"/><file name="AuthorizationKeyV.php" hash="cc385bd818815d084fdc33adca0274b7"/><file name="ClxEmail.php" hash="b9fce4e10ba99984dd59fb748c327e0e"/><file name="Clxloanappdtls.php" hash="d131567dcf509e63989e7d5739699c35"/><file name="Clxloanofferdetails.php" hash="673d4de3b8aaa9d0409a8a8a3a2b5060"/><file name="CronOrderStatusUpdate.php" hash="c0ffc89deeadfee459f9e009a37a411d"/><dir name="Mysql4"><dir name="Clxloanappdtls"><file name="Collection.php" hash="9d3b2d78188b257fb9022057c17ac948"/></dir><file name="Clxloanappdtls.php" hash="10402960edc7dc8e6b248bc60e3fc589"/><dir name="Clxloanofferdetails"><file name="Collection.php" hash="518d07728d6296b14512fc5cc5a8b37e"/></dir><file name="Clxloanofferdetails.php" hash="4f94744cc78e809eb718d55bee297455"/></dir><file name="Observer.php" hash="f9de34cdae961c9e6b9d763430977056"/><file name="Observer.php~" hash="fe6c42be3c15b14f36c5b7d9e8003dbd"/><file name="PaymentMethodTitle.php" hash="9fd8ce6214e2e6a7dba330f6913dda0b"/><file name="Paymentmethod.php" hash="036b7356644228046ab8ec880f7f2fe5"/><file name="QueueAuthKeyV.php" hash="bdb91ab2589bd0a025f2ca0fe051f420"/><file name="QueueEndpointV.php" hash="80f1dc2c25dea674a6208a411921a82f"/><dir name="Resource"><file name="Setup.php" hash="891431034dc2144ccf9ed0f89b81a93a"/></dir></dir><file name="TimeFrames.php" hash="c6003d6e6639431fe3a96b057aa84c21"/><dir name="controllers"><file name="ClxAPIController.php" hash="a845844c6fa315b885b39b27bf670dd1"/><file name="ClxAPIController.php~" hash="b0e4e7bfe1c10cd756c647713fc878d6"/><file name="PaymentController.php" hash="7bfa38bd5d5e4e92aafe3f2a20073f76"/></dir><dir name="etc"><file name="config.xml" hash="3394d2b161f0c6c8e0ac4bcb8441cd8c"/><file name="config.xml~" hash="2fb2c5db0f6eeb0ceb1df3a88d41e4e8"/><file name="system.xml" hash="a6c50f131ac6faf145e29666b1de961b"/></dir><dir name="sql"><dir name="clxfunding_setup"><file name="mysql4-install-1.0.0.0.php" hash="ed180b5d726026a8aa4464bbe6f9e40c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="."><dir name="modules"><file name="CLExchange_Clexchangefunding.xml" hash="baacaefedc8b344c94325fb0707ac4fa"/></dir></dir></target><target name="magedesign"><dir name="."><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="clxblock.xml" hash="33d1ee86efa9a2ca1a69cd0a1193f036"/></dir><dir name="template"><dir name="clxfunding"><dir name="form"><file name="aboutCLXFunding.phtml" hash="d770c8fb641e9d80318893735b63a07e"/><file name="clxfunding.phtml" hash="63074651223b2e3999fcd5da94151322"/><file name="confirm_user_acceptance.phtml" hash="ac94290aef0ec7b0ad0fd1c0eda1ea82"/><file name="custompaymentmethod.phtml~" hash="eb341bef92ad331d87cc04826a3c6d80"/><file name="link_Expire.phtml" hash="dc348778a35a160616661e5f57eecc2a"/><file name="loan_offer_response.phtml" hash="c9a62e6b568f72907bf6ff40b15a4aec"/><file name="loan_offer_response.phtml~" hash="fb3bd4c15f59244d1581744b75433b07"/><file name="loanapplicationstatus.phtml" hash="3f28370fe0adcbbcdf0a3934e7027ba8"/><file name="modal_clxfunding.phtml" hash="7b982715958f7f9b7da2b7905ed476c2"/><file name="modal_clxfunding.phtml~" hash="83cb30ea1c0f9ab50ddf8d02f75a45c8"/><file name="modal_custompaymentmethod.phtml~" hash="3bd861132e0dc8e856d87aa90d0c504d"/><file name="user_loan_offer_accept.phtml" hash="082ef7c1c33fe01966d562237efe056f"/><file name="user_loan_offer_reject.phtml" hash="f3e265bf67ab7f46b7d88fed85e526f0"/><file name="user_loan_offer_status.phtml" hash="f95386d992f0581c2c9dc2f4c3e4470b"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="."><dir name="en_US"><dir name="template"><dir name="email"><dir name="CLX"><dir name="email-template"><file name="clx_error.html" hash="00e79d990018928d6744e2674a5f8f96"/><file name="clx_loan_approved.html" hash="c1c65d26dc7d8ffe3202b84d563d8ca1"/><file name="clx_loan_funded.html" hash="6b79fecb27ee174eb371260ed49bfbb1"/><file name="clx_loan_offer.html" hash="5bcc0e69296527e5c72fcd008f4d06dd"/><file name="clx_loan_offer_reject.html" hash="5ef3d5cda7e3854a2d8c4297f122127b"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="."><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="Clx"><file name="bootstrap-datepicker.min.css" hash="cd2c0b0211d190705a331aec86e9b58b"/><file name="bootstrap.min.css" hash="f5be102f57c28817dfd7cb45c2e348cc"/><file name="clx_custom.css" hash="98e74ca9d4dc37207ba7dd5009b95f02"/><file name="clxloanofferdata.php~" hash="2b9a4570344187bb80e7e4d3aacf5bae"/><file name="clxloantabledata.php~" hash="04fd656486dda8e8edd0118f2c284997"/><file name="cron_status.php~" hash="9475575fe75cd8ae8e944e88485bd325"/><file name="help.png" hash="8d624cc7c85c82d94af8c733bbbfe70c"/><file name="loading.gif" hash="b93b075c32e850e533118e9da3ab908f"/><file name="loading11.gif" hash="76a38d8ef9d1c3b220ad82562e199b40"/></dir></dir><dir name="js"><dir name="Clx"><file name="bootbox.min.js" hash="05d23d3920015845ca00414081fd0ec6"/><file name="bootstrap-datepicker.min.js" hash="8162cad799165edbecd075126bc9ba9a"/><file name="bootstrap.min.js" hash="1e111f47ca44c667c9db657ef90e08bf"/><file name="jquery-1.11.3.min.js" hash="e73e73f10b0074aeb269444ce5e3f9b6"/><file name="jquery-migrate-1.2.1.min.js" hash="d73215496d38ffbaf7136ced76910a96"/><file name="noConflict.js" hash="7be7463c1b83b4ab8daad25a2da121ed"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
18
  </package>
2
  <package>
3
  <name>Clexchange_Funding</name>
4
  <version>1.0.0.0</version>
5
+ <stability>devel</stability>
6
  <license>Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
10
  <description>CLX Funding provides a way for online retailers to sell goods as part of the loan experience, but submitting application to CL exchange so that lenders can bid on them. It is basically an online marketplace that enables people to borrow money from the lenders without the involvement of banks or credit card companies. By cutting out the middle men and bypassing many of the traditional banking costs, it is able to provide multiple loan offers at different rates for borrowers</description>
11
  <notes>Stable Module</notes>
12
  <authors><author><name>Dhananjay Goel</name><user>agsdhananjay</user><email>dhananjay.goel@agstechnologies.com</email></author></authors>
13
+ <date>2016-02-24</date>
14
+ <time>06:47:25</time>
15
+ <contents><target name="magecommunity"><dir name="."><dir name="CLExchange"><dir name="Clexchangefunding"><file name="ApprovalRequired.php" hash="6e389173fa40f7e98c34aa5f06d9ff20"/><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Info"><file name="Block.php" hash="de79d5b6cccd8029ca5084e54b17f8e5"/></dir></dir></dir></dir></dir><dir name="Form"><file name="Clxfunding.php" hash="14e5c34a88c6b24861cdc478457796f1"/><file name="Clxfunding.php~" hash="a20584db3e9f4b099a7144d12a2b8ef3"/></dir></dir><file name="CronExpressionList.php" hash="adbb2dfe3c393aa89aa6395a7cf5458d"/><file name="CronExpressionList.php~" hash="517b5955d0b9a57f981774a24cc85f21"/><dir name="Helper"><file name="Data.php" hash="b57d9696b5aa8ea3096c5b026f2ad80a"/><file name="Data.php~" hash="a730a72d6b337f5ef6f7ff871e5eda01"/></dir><file name="IsBestOffer.php" hash="895a424575c5bf1c4980f8805e3e3857"/><dir name="Model"><file name="AccountIdV.php" hash="fce6f3dafa1e2cea6cf124864d9fc782"/><file name="AuthorizationKeyV.php" hash="cc385bd818815d084fdc33adca0274b7"/><file name="ClxEmail.php" hash="b9fce4e10ba99984dd59fb748c327e0e"/><file name="Clxloanappdtls.php" hash="d131567dcf509e63989e7d5739699c35"/><file name="Clxloanofferdetails.php" hash="673d4de3b8aaa9d0409a8a8a3a2b5060"/><file name="CronOrderStatusUpdate.php" hash="641c1807f045fc0f27e2c5c2ab49994a"/><dir name="Mysql4"><dir name="Clxloanappdtls"><file name="Collection.php" hash="9d3b2d78188b257fb9022057c17ac948"/></dir><file name="Clxloanappdtls.php" hash="10402960edc7dc8e6b248bc60e3fc589"/><dir name="Clxloanofferdetails"><file name="Collection.php" hash="518d07728d6296b14512fc5cc5a8b37e"/></dir><file name="Clxloanofferdetails.php" hash="4f94744cc78e809eb718d55bee297455"/></dir><file name="Observer.php" hash="2d671c25b517e59f3f439a6fc563ded7"/><file name="Observer.php~" hash="fe6c42be3c15b14f36c5b7d9e8003dbd"/><file name="PaymentMethodTitle.php" hash="588c143673f395290d22afaf3fc98d4e"/><file name="Paymentmethod.php" hash="036b7356644228046ab8ec880f7f2fe5"/><file name="QueueAuthKeyV.php" hash="bdb91ab2589bd0a025f2ca0fe051f420"/><file name="QueueEndpointV.php" hash="80f1dc2c25dea674a6208a411921a82f"/><dir name="Resource"><file name="Setup.php" hash="891431034dc2144ccf9ed0f89b81a93a"/></dir></dir><file name="TimeFrames.php" hash="44c157f48dc1ce71bd634a3e3ab91558"/><dir name="controllers"><file name="ClxAPIController.php" hash="c70be9fc29fdb377c817253fb65a03da"/><file name="ClxAPIController.php~" hash="b0e4e7bfe1c10cd756c647713fc878d6"/></dir><dir name="etc"><file name="config.xml" hash="bbe5411723d46ae720277a72e7e6074f"/><file name="config.xml~" hash="26e037b103f3b691d4b5b0ffd45b72c8"/><file name="system.xml" hash="554df251af7fb87bf261e0ea9d6d4eb3"/></dir><dir name="sql"><dir name="clxfunding_setup"><file name="mysql4-install-1.0.0.0.php" hash="e2462d7b06a392441fa18468aea75121"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="."><dir name="modules"><file name="CLExchange_Clexchangefunding.xml" hash="baacaefedc8b344c94325fb0707ac4fa"/></dir></dir></target><target name="magedesign"><dir name="."><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="clxblock.xml" hash="9858651c48be685d22a246bb263a97da"/></dir><dir name="template"><dir name="clxfunding"><dir name="form"><file name="aboutCLXFunding.phtml" hash="d770c8fb641e9d80318893735b63a07e"/><file name="clxfunding.phtml" hash="339fd8f9d32abe60e134693ab75105a5"/><file name="confirm_user_acceptance.phtml" hash="6561ce8fc0b36c589a91c7f58afa92b3"/><file name="custompaymentmethod.phtml~" hash="eb341bef92ad331d87cc04826a3c6d80"/><file name="link_Expire.phtml" hash="dc348778a35a160616661e5f57eecc2a"/><file name="loan_offer_response.phtml" hash="43f68d4710a210d4f2df093cc251f1a2"/><file name="loan_offer_response.phtml~" hash="fb3bd4c15f59244d1581744b75433b07"/><file name="loanapplicationstatus.phtml" hash="3f28370fe0adcbbcdf0a3934e7027ba8"/><file name="modal_clxfunding.phtml" hash="33af9763dc11f9e093b7a9d9452e9b06"/><file name="modal_clxfunding.phtml~" hash="83cb30ea1c0f9ab50ddf8d02f75a45c8"/><file name="modal_custompaymentmethod.phtml~" hash="3bd861132e0dc8e856d87aa90d0c504d"/><file name="user_loan_offer_accept.phtml" hash="f68b76e3ec10ef7b691c316f60d8fed9"/><file name="user_loan_offer_reject.phtml" hash="f3e265bf67ab7f46b7d88fed85e526f0"/><file name="user_loan_offer_status.phtml" hash="578ec13018d13c952e88e4e81fbbe446"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="clxfunding.xml" hash="52a5c93f0ca288e041228bb1c9ef427b"/></dir><dir name="template"><dir name="clxfunding"><file name="custom.phtml" hash="12139ce506bd90fb0c866aebbe03144c"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="."><dir name="en_US"><dir name="template"><dir name="email"><dir name="CLX"><dir name="email-template"><file name="clx_error.html" hash="00e79d990018928d6744e2674a5f8f96"/><file name="clx_loan_approved.html" hash="c1c65d26dc7d8ffe3202b84d563d8ca1"/><file name="clx_loan_funded.html" hash="6b79fecb27ee174eb371260ed49bfbb1"/><file name="clx_loan_funded_U.html" hash="c49677e384d8c6393c703b9a02c86692"/><file name="clx_loan_offer.html" hash="5bcc0e69296527e5c72fcd008f4d06dd"/><file name="clx_loan_offer_reject.html" hash="5ef3d5cda7e3854a2d8c4297f122127b"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="."><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="Clx"><file name="bootstrap-datepicker.min.css" hash="cd2c0b0211d190705a331aec86e9b58b"/><file name="bootstrap.min.css" hash="f5be102f57c28817dfd7cb45c2e348cc"/><file name="clx_custom.css" hash="06adc2492b793035da267c9a10848356"/><file name="clxloanofferdata.php~" hash="2f0e96f77b383a517d7b4b93a6779949"/><file name="clxloantabledata.php~" hash="f422c38e95c4c66c64d8642571982bca"/><file name="cron_status.php~" hash="9475575fe75cd8ae8e944e88485bd325"/><file name="help.png" hash="8d624cc7c85c82d94af8c733bbbfe70c"/><file name="loading.gif" hash="b93b075c32e850e533118e9da3ab908f"/></dir></dir><dir name="js"><dir name="Clx"><file name="bootbox.min.js" hash="05d23d3920015845ca00414081fd0ec6"/><file name="bootstrap-datepicker.min.js" hash="8162cad799165edbecd075126bc9ba9a"/><file name="bootstrap.min.js" hash="1e111f47ca44c667c9db657ef90e08bf"/><file name="jquery-1.11.3.min.js" hash="e73e73f10b0074aeb269444ce5e3f9b6"/><file name="jquery-migrate-1.2.1.min.js" hash="d73215496d38ffbaf7136ced76910a96"/><file name="noConflict.js" hash="7be7463c1b83b4ab8daad25a2da121ed"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>5.6.18</max></php></required></dependencies>
18
  </package>
skin/frontend/base/default/css/Clx/clx_custom.css CHANGED
@@ -59,4 +59,18 @@
59
  .custom_modal_open .modal{
60
  overflow-x: hidden;
61
  overflow-y: auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
59
  .custom_modal_open .modal{
60
  overflow-x: hidden;
61
  overflow-y: auto;
62
+ }
63
+ .custom_width .datepicker-switch{
64
+ color: black;
65
+ background-image: linear-gradient(to bottom, #FFF 0%, #E0E0E0 100%);
66
+ background-repeat: repeat-x;
67
+ text-shadow: 0px 1px 0px #FFF;
68
+ border: 1px solid #CCC !important; /* Green */
69
+ }
70
+ .custom_width .datepicker-switch:hover{
71
+ color: black;
72
+ background-image: linear-gradient(to bottom, #FFF 0%, #E0E0E0 100%);
73
+ background-repeat: repeat-x;
74
+ text-shadow: 0px 1px 0px #FFF;
75
+ border: 1px solid #CCC !important; /* Green */
76
  }
skin/frontend/base/default/css/Clx/clxloanofferdata.php~ CHANGED
@@ -1,9 +1,10 @@
1
  <?php
2
 
3
  // Parse magento's local.xml to get db info, if local.xml is found
4
- if (file_exists('../../../../../../app/etc/local.xml')) {
5
 
6
- $xml = simplexml_load_file('./app/etc/local.xml');
 
 
7
 
8
  $tblprefix = $xml->global->resources->db->table_prefix;
9
  $dbhost = $xml->global->resources->default_setup->connection->host;
@@ -11,8 +12,7 @@ $dbuser = $xml->global->resources->default_setup->connection->username;
11
  $dbpass = $xml->global->resources->default_setup->connection->password;
12
  $dbname = $xml->global->resources->default_setup->connection->dbname;
13
 
14
- }
15
-
16
  else {
17
  exit('Failed to open app/etc/local.xml');
18
  }
1
  <?php
2
 
3
  // Parse magento's local.xml to get db info, if local.xml is found
 
4
 
5
+ if (file_exists('./../../../../../../app/etc/local.xml')) {
6
+
7
+ $xml = simplexml_load_file('./../../../../../../app/etc/local.xml');
8
 
9
  $tblprefix = $xml->global->resources->db->table_prefix;
10
  $dbhost = $xml->global->resources->default_setup->connection->host;
12
  $dbpass = $xml->global->resources->default_setup->connection->password;
13
  $dbname = $xml->global->resources->default_setup->connection->dbname;
14
 
15
+ }
 
16
  else {
17
  exit('Failed to open app/etc/local.xml');
18
  }
skin/frontend/base/default/css/Clx/clxloantabledata.php~ CHANGED
@@ -2,9 +2,9 @@
2
 
3
  // Parse magento's local.xml to get db info, if local.xml is found
4
 
5
- if (file_exists('../../../../../../app/etc/local.xml')) {
6
 
7
- $xml = simplexml_load_file('../../../../../../app/etc/local.xml');
8
 
9
  $tblprefix = $xml->global->resources->db->table_prefix;
10
  $dbhost = $xml->global->resources->default_setup->connection->host;
2
 
3
  // Parse magento's local.xml to get db info, if local.xml is found
4
 
5
+ if (file_exists('./../../../../../../app/etc/local.xml')) {
6
 
7
+ $xml = simplexml_load_file('./../../../../../../app/etc/local.xml');
8
 
9
  $tblprefix = $xml->global->resources->db->table_prefix;
10
  $dbhost = $xml->global->resources->default_setup->connection->host;
skin/frontend/base/default/css/Clx/loading11.gif DELETED
Binary file