Yellow_Pay - Version 1.0.0

Version Notes

* Payment invoice is now responsive
* Fix some styling issue (e.g. image size in email, fullscreen invoice width)
* Make plugin more permissive of api changes

Download this release

Release Info

Developer Tawfek Daghistani
Extension Yellow_Pay
Version 1.0.0
Comparing to
See all releases


Code changes from version 0.2.4 to 1.0.0

app/code/local/Yellow/Bitcoin/Block/Widget.php CHANGED
@@ -75,7 +75,7 @@ class Yellow_Bitcoin_Block_Widget extends Mage_Checkout_Block_Onepage_Payment
75
  }
76
  $quote = $this->getQuote();
77
  $payment = $quote->getPayment()->getMethodInstance();
78
- $invoice = $payment->createInvoice($quote, false);
79
  $this->server_root = $instance->getConfiguredServerRoot();
80
  return $invoice['url'];
81
  }
75
  }
76
  $quote = $this->getQuote();
77
  $payment = $quote->getPayment()->getMethodInstance();
78
+ $invoice = $payment->createInvoice($quote);
79
  $this->server_root = $instance->getConfiguredServerRoot();
80
  return $invoice['url'];
81
  }
app/code/local/Yellow/Bitcoin/Helper/Data.php CHANGED
@@ -27,6 +27,7 @@
27
  **/
28
  class Yellow_Bitcoin_Helper_Data extends Mage_Core_Helper_Abstract
29
  {
 
30
  /**
31
  * check if the fullScreen setting is set to yes / no
32
  * @return bool
@@ -63,4 +64,23 @@ class Yellow_Bitcoin_Helper_Data extends Mage_Core_Helper_Abstract
63
  return str_replace("https://" , "http://" , $url);
64
  }
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
27
  **/
28
  class Yellow_Bitcoin_Helper_Data extends Mage_Core_Helper_Abstract
29
  {
30
+
31
  /**
32
  * check if the fullScreen setting is set to yes / no
33
  * @return bool
64
  return str_replace("https://" , "http://" , $url);
65
  }
66
 
67
+ /**
68
+ * return platform version
69
+ * @return string
70
+ */
71
+ public function getPlatformVersion()
72
+ {
73
+ $platform = "Magento " . Mage::getEdition() ." ". Mage::getVersion();
74
+ return $platform;
75
+ }
76
+
77
+ /**
78
+ * return plugin version
79
+ * @return string
80
+ */
81
+ public function getModuleVersion()
82
+ {
83
+ $plugin = (string) Mage::getConfig()->getNode()->modules->Yellow_Bitcoin->version;
84
+ return $plugin;
85
+ }
86
  }
app/code/local/Yellow/Bitcoin/Model/Bitcoin.php CHANGED
@@ -248,8 +248,8 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
248
  $payment->setIsTransactionPending(true);
249
  $order = $payment->getOrder();
250
  $status_message = "Yellow invoice created. Invoice Id: " . $invoice['id'];
251
- $order->addStatusToHistory(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, $status_message);
252
-
253
  /* start to invoice the order */
254
  /*$order = $payment->getOrder();
255
  $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
@@ -331,12 +331,11 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
331
  }
332
 
333
  /**
334
- *
335
  * @param Mage_Sales_Model_Quote $quote
336
- * @param boolean $redirect
337
  * @return boolean
338
  */
339
- public function createInvoice($quote, $redirect = true)
340
  {
341
  $this->clearSessionData();
342
  if (get_class($quote) == "Mage_Sales_Model_Quote") {
@@ -357,16 +356,11 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
357
  $ipnUrl = Mage::getUrl("bitcoin/index/ipn", array("_secure" => false, "id" => base64_encode($quote_id)));
358
  }
359
  $this->log( "GENERATED IPN URL : " . $ipnUrl);
360
- $redirectUrl = "";
361
- /*if ($redirect) {
362
- $redirectUrl = Mage::getUrl("bitcoin/index/status");
363
- }*/
364
  $http_client = $this->getHTTPClient();
365
  $yellow_payment_data = array(
366
  "base_price" => $base_price, /// Set to 0.30 for testing
367
  "base_ccy" => $base_ccy, /// Set to "USD" for testing
368
- "callback" => $ipnUrl,
369
- "redirect" => $redirectUrl
370
  );
371
  $post_body = json_encode($yellow_payment_data);
372
  $nonce = round(microtime(true) * 1000);
@@ -490,11 +484,11 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
490
  $this->log("Nothing to do. Redirecting back to the payment page.", $id);
491
  break;
492
  case $data["status"] == "paid" :
493
- $order->addStatusToHistory(
494
- $this->getSuccessStatus(),
495
  "Payment confirmed. Invoice Id: " . $data["id"],
496
- true
497
  );
 
498
  $order->sendNewOrderEmail();
499
  $order->save();
500
  Mage::getResourceModel("bitcoin/ipn")->MarkAsPaid($id);
@@ -504,13 +498,26 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
504
  $invoiceModel->capture($invoice_id);
505
  break;
506
  case $data["status"] == "authorizing":
507
- $order->addStatusToHistory(
508
- Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW,
509
- "Authorizing payment. This typically takes 10 minutes. Invoice Id: {$data['id']}"
510
  );
 
511
  $order->save();
512
  Mage::getResourceModel("bitcoin/ipn")->MarkAsAuthorizing($id);
513
  break;
 
 
 
 
 
 
 
 
 
 
 
 
514
  case $data["status"] == "refund_requested" :
515
  $order->setState(Mage_Sales_Model_Order::STATE_NEW);
516
  if (!$order->canCancel()) {
@@ -518,11 +525,11 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
518
  } else {
519
  $this->log("refund_requested order", $id);
520
  Mage::getResourceModel("bitcoin/ipn")->MarkAsRefundRequested($id);
521
- $order->addStatusToHistory(
522
- $this->getFailedStatus(),
523
- "refund_requested. Invoice #{$id} ",
524
- true
525
  );
 
526
  $order->cancel();
527
  $order->save();
528
  $this->log("Order cancelled. Order #" . $order->getIncrementId(), $id);
@@ -536,11 +543,11 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
536
  } else {
537
  $this->log("Order expired : " . $order->getIncrementId(), $id);
538
  Mage::getResourceModel("bitcoin/ipn")->MarkAsExpired($id);
539
- $order->addStatusToHistory(
540
- $this->getFailedStatus(),
541
- "Invoice expired. Invoice #{$id}",
542
- true
543
  );
 
544
  $order->cancel();
545
  $order->save();
546
  $this->log("Order cancelled. Order #" . $order->getIncrementId(), $id);
@@ -610,11 +617,18 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract
610
  */
611
  private function getHeaders($nonce, $signature)
612
  {
 
 
 
 
 
613
  $headers = array(
614
  "Content-type:application/json",
615
  "API-Key:" . Mage::helper('core')->decrypt($this->getConfiguration('public_key')),
616
  "API-Nonce:$nonce",
617
- "API-Sign:$signature"
 
 
618
  );
619
  return $headers;
620
  }
248
  $payment->setIsTransactionPending(true);
249
  $order = $payment->getOrder();
250
  $status_message = "Yellow invoice created. Invoice Id: " . $invoice['id'];
251
+ $commentHistory = $order->addStatusHistoryComment($status_message,Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW);
252
+ $commentHistory->setIsVisibleOnFront(1);
253
  /* start to invoice the order */
254
  /*$order = $payment->getOrder();
255
  $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
331
  }
332
 
333
  /**
334
+ * create a yellow invoice
335
  * @param Mage_Sales_Model_Quote $quote
 
336
  * @return boolean
337
  */
338
+ public function createInvoice($quote)
339
  {
340
  $this->clearSessionData();
341
  if (get_class($quote) == "Mage_Sales_Model_Quote") {
356
  $ipnUrl = Mage::getUrl("bitcoin/index/ipn", array("_secure" => false, "id" => base64_encode($quote_id)));
357
  }
358
  $this->log( "GENERATED IPN URL : " . $ipnUrl);
 
 
 
 
359
  $http_client = $this->getHTTPClient();
360
  $yellow_payment_data = array(
361
  "base_price" => $base_price, /// Set to 0.30 for testing
362
  "base_ccy" => $base_ccy, /// Set to "USD" for testing
363
+ "callback" => $ipnUrl
 
364
  );
365
  $post_body = json_encode($yellow_payment_data);
366
  $nonce = round(microtime(true) * 1000);
484
  $this->log("Nothing to do. Redirecting back to the payment page.", $id);
485
  break;
486
  case $data["status"] == "paid" :
487
+ $commentHistory = $order->addStatusHistoryComment(
 
488
  "Payment confirmed. Invoice Id: " . $data["id"],
489
+ $this->getSuccessStatus()
490
  );
491
+ $commentHistory->setIsVisibleOnFront(1);
492
  $order->sendNewOrderEmail();
493
  $order->save();
494
  Mage::getResourceModel("bitcoin/ipn")->MarkAsPaid($id);
498
  $invoiceModel->capture($invoice_id);
499
  break;
500
  case $data["status"] == "authorizing":
501
+ $commentHistory = $order->addStatusHistoryComment(
502
+ "Authorizing payment. This typically takes 10 minutes. Invoice Id: {$data['id']}",
503
+ Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW
504
  );
505
+ $commentHistory->setIsVisibleOnFront(1);
506
  $order->save();
507
  Mage::getResourceModel("bitcoin/ipn")->MarkAsAuthorizing($id);
508
  break;
509
+ case $data["status"] == "refund_owed" :
510
+ $order->setState(Mage_Sales_Model_Order::STATE_NEW);
511
+ $this->log("refund_owed order", $id);
512
+ Mage::getResourceModel("bitcoin/ipn")->MarkAsRefundOwed($id);
513
+ $message = "The bitcoin payment invoice received an incorrect payment. To request a refund please contact support@yellowpay.co and include your ".$order->getIncrementId()." order number as well as the invoice id " . $data['id'];
514
+ $commentHistory = $order->addStatusHistoryComment(
515
+ $message,
516
+ $this->getFailedStatus()
517
+ );
518
+ $commentHistory->setIsVisibleOnFront(1);
519
+ $order->save();
520
+ break;
521
  case $data["status"] == "refund_requested" :
522
  $order->setState(Mage_Sales_Model_Order::STATE_NEW);
523
  if (!$order->canCancel()) {
525
  } else {
526
  $this->log("refund_requested order", $id);
527
  Mage::getResourceModel("bitcoin/ipn")->MarkAsRefundRequested($id);
528
+ $commentHistory = $order->addStatusHistoryComment(
529
+ "Your request for a refund has been received! We'll be in touch soon. In the mean time, you can reach us at support@yellowpay.co",
530
+ $this->getFailedStatus()
 
531
  );
532
+ $commentHistory->setIsVisibleOnFront(1);
533
  $order->cancel();
534
  $order->save();
535
  $this->log("Order cancelled. Order #" . $order->getIncrementId(), $id);
543
  } else {
544
  $this->log("Order expired : " . $order->getIncrementId(), $id);
545
  Mage::getResourceModel("bitcoin/ipn")->MarkAsExpired($id);
546
+ $commentHistory = $order->addStatusHistoryComment(
547
+ "The bitcoin payment invoice has expired, please place your order again to receive a new invoice.",
548
+ $this->getFailedStatus()
 
549
  );
550
+ $commentHistory->setIsVisibleOnFront(1);
551
  $order->cancel();
552
  $order->save();
553
  $this->log("Order cancelled. Order #" . $order->getIncrementId(), $id);
617
  */
618
  private function getHeaders($nonce, $signature)
619
  {
620
+ //current platform information
621
+ $helper = Mage::helper("bitcoin");
622
+ $platform = $helper->getPlatformVersion();
623
+ $plugin = $helper->getModuleVersion();
624
+
625
  $headers = array(
626
  "Content-type:application/json",
627
  "API-Key:" . Mage::helper('core')->decrypt($this->getConfiguration('public_key')),
628
  "API-Nonce:$nonce",
629
+ "API-Sign:$signature",
630
+ "API-Platform:" . $platform ,
631
+ "API-Plugin:" . $plugin
632
  );
633
  return $headers;
634
  }
app/code/local/Yellow/Bitcoin/controllers/IndexController.php CHANGED
@@ -148,7 +148,8 @@ class Yellow_Bitcoin_IndexController extends Mage_Core_Controller_Front_Action
148
  case 'paid':
149
  $status = Mage::getModel("bitcoin/bitcoin")->getSuccessStatus();
150
  $status_message = "Payment confirmation received. Invoice Id: " . $body['id']; // $invoice["message"];
151
- $order->addStatusToHistory($status, $status_message);
 
152
  $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);
153
  $order->sendNewOrderEmail();
154
  $order->save();
@@ -162,13 +163,15 @@ class Yellow_Bitcoin_IndexController extends Mage_Core_Controller_Front_Action
162
  case 'reissue':
163
  $status = Mage::getModel("bitcoin/bitcoin")->getSuccessStatus(); /// this must bn changed when we had reissue / renew payment ready
164
  $status_message = "Client re-issued the invoice. Invoice Id: " . $body['id']; // $invoice["message"];
165
- $order->addStatusToHistory($status, $status_message);
 
166
  $order->save();
167
  break;
168
  case 'partial':
169
  $status = Mage::getModel("bitcoin/bitcoin")->getSuccessStatus(); /// this must bn changed when we had partial payment ready
170
  $status_message = "Client made a partial payment. Invoice Id: " . $body['id']; // $invoice["message"];
171
- $order->addStatusToHistory($status, $status_message);
 
172
  $order->save();
173
  Mage::getResourceModel("bitcoin/ipn")->MarkAsPartial($body["id"]);
174
  break;
@@ -176,7 +179,8 @@ class Yellow_Bitcoin_IndexController extends Mage_Core_Controller_Front_Action
176
  case 'invalid':
177
  $status = Mage::getModel("bitcoin/bitcoin")->getFailedStatus();
178
  $status_message = "Client failed to pay. Invoice Id: " . $body['id']; // $invoice["message"];
179
- $order->addStatusToHistory($status, $status_message);
 
180
  $order->setState(Mage_Sales_Model_Order::STATE_HOLDED);
181
  $order->cancel();
182
  $order->save();
148
  case 'paid':
149
  $status = Mage::getModel("bitcoin/bitcoin")->getSuccessStatus();
150
  $status_message = "Payment confirmation received. Invoice Id: " . $body['id']; // $invoice["message"];
151
+ $commentHistory = $order->addStatusHistoryComment($status_message,$status);
152
+ $commentHistory->setIsVisibleOnFront(1);
153
  $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);
154
  $order->sendNewOrderEmail();
155
  $order->save();
163
  case 'reissue':
164
  $status = Mage::getModel("bitcoin/bitcoin")->getSuccessStatus(); /// this must bn changed when we had reissue / renew payment ready
165
  $status_message = "Client re-issued the invoice. Invoice Id: " . $body['id']; // $invoice["message"];
166
+ $commentHistory = $order->addStatusHistoryComment($status_message,$status);
167
+ $commentHistory->setIsVisibleOnFront(1);
168
  $order->save();
169
  break;
170
  case 'partial':
171
  $status = Mage::getModel("bitcoin/bitcoin")->getSuccessStatus(); /// this must bn changed when we had partial payment ready
172
  $status_message = "Client made a partial payment. Invoice Id: " . $body['id']; // $invoice["message"];
173
+ $commentHistory = $order->addStatusHistoryComment($status_message,$status);
174
+ $commentHistory->setIsVisibleOnFront(1);
175
  $order->save();
176
  Mage::getResourceModel("bitcoin/ipn")->MarkAsPartial($body["id"]);
177
  break;
179
  case 'invalid':
180
  $status = Mage::getModel("bitcoin/bitcoin")->getFailedStatus();
181
  $status_message = "Client failed to pay. Invoice Id: " . $body['id']; // $invoice["message"];
182
+ $commentHistory = $order->addStatusHistoryComment($status_message,$status);
183
+ $commentHistory->setIsVisibleOnFront(1);
184
  $order->setState(Mage_Sales_Model_Order::STATE_HOLDED);
185
  $order->cancel();
186
  $order->save();
app/code/local/Yellow/Bitcoin/etc/config.xml CHANGED
@@ -27,7 +27,7 @@ SOFTWARE.
27
  <config>
28
  <modules>
29
  <Yellow_Bitcoin>
30
- <version>0.2.4</version>
31
  <depends>
32
  <Mage_Payment/>
33
  </depends>
27
  <config>
28
  <modules>
29
  <Yellow_Bitcoin>
30
+ <version>1.0.0</version>
31
  <depends>
32
  <Mage_Payment/>
33
  </depends>
app/design/frontend/base/default/layout/bitcoin.xml CHANGED
@@ -1,6 +1,12 @@
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
  <checkout_onepage_review>
 
 
 
 
 
 
4
  <reference name="checkout.onepage.review.info.items.after">
5
  <block name="yellow_widget" type="bitcoin/widget"/>
6
  </reference>
@@ -25,6 +31,10 @@
25
  <name>css/bitcoin.css</name>
26
  <params/>
27
  </action>
 
 
 
 
28
  </reference>
29
  <reference name="content">
30
  <block type="cms/block" name="yellow-invoice-custom-css">
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
  <checkout_onepage_review>
4
+ <reference name="head">
5
+ <action method="addItem">
6
+ <type>skin_js</type>
7
+ <name>js/iframeResizer.min.js</name>
8
+ </action>
9
+ </reference>
10
  <reference name="checkout.onepage.review.info.items.after">
11
  <block name="yellow_widget" type="bitcoin/widget"/>
12
  </reference>
31
  <name>css/bitcoin.css</name>
32
  <params/>
33
  </action>
34
+ <action method="addItem">
35
+ <type>skin_js</type>
36
+ <name>js/iframeResizer.min.js</name>
37
+ </action>
38
  </reference>
39
  <reference name="content">
40
  <block type="cms/block" name="yellow-invoice-custom-css">
app/design/frontend/base/default/template/bitcoin/fullscreen/widget/content.phtml CHANGED
@@ -18,7 +18,7 @@
18
  $iframe = false;
19
  break;
20
  default:
21
- $iframe = '<iframe src="' . $url . '" scrolling="no" allowtransparency="true" frameborder="0"> </iframe>';
22
  break;
23
  }
24
  if ($iframe): echo $iframe; ?>
@@ -40,9 +40,6 @@
40
  case "refund_requested":
41
  window.location = "<?php echo Mage::getUrl("bitcoin/index/status");?>";
42
  break;
43
- default:
44
- alert("unknown order status :" + event.data);
45
- break;
46
  }
47
  }
48
  // Attach the message listener
@@ -51,6 +48,10 @@
51
  } else {
52
  attachEvent("onmessage", invoiceListener)
53
  }
 
 
 
 
54
  </script>
55
  <?php endif; ?>
56
  </div>
18
  $iframe = false;
19
  break;
20
  default:
21
+ $iframe = '<iframe src="' . $url . '" scrolling="no" width="100%" allowtransparency="true" frameborder="0"> </iframe>';
22
  break;
23
  }
24
  if ($iframe): echo $iframe; ?>
40
  case "refund_requested":
41
  window.location = "<?php echo Mage::getUrl("bitcoin/index/status");?>";
42
  break;
 
 
 
43
  }
44
  }
45
  // Attach the message listener
48
  } else {
49
  attachEvent("onmessage", invoiceListener)
50
  }
51
+ iFrameResize({
52
+ log : false,
53
+ enablePublicMethods : true
54
+ });
55
  </script>
56
  <?php endif; ?>
57
  </div>
app/design/frontend/base/default/template/bitcoin/info/invoice.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <!-- Yellow Logo -->
2
  <div id="bitcoin">
3
  <img src="<?php echo $this->getSkinUrl('images/bitcoin/bitcoin_accepted.png', array('_secure' => true)); ?>"
4
- alt="<?php echo Mage::helper('bitcoin')->__('Yellow Bitcoin') ?>" class="v-middle" style="height:35px;"/>
5
  </div>
6
  <!-- Yellow Logo -->
1
  <!-- Yellow Logo -->
2
  <div id="bitcoin">
3
  <img src="<?php echo $this->getSkinUrl('images/bitcoin/bitcoin_accepted.png', array('_secure' => true)); ?>"
4
+ alt="<?php echo Mage::helper('bitcoin')->__('Yellow Bitcoin') ?>" class="v-middle" style="height:35px;" height="35"/>
5
  </div>
6
  <!-- Yellow Logo -->
app/design/frontend/base/default/template/bitcoin/widget.phtml CHANGED
@@ -15,7 +15,7 @@ switch ($url) {
15
  $iframe = false;
16
  break;
17
  default:
18
- $iframe = '<iframe src="' . $url . '" style="width:500px; height:255px; overflow:hidden; border:none; margin:auto; display:block;" scrolling="no" allowtransparency="true" frameborder="0"> </iframe>';
19
  break;
20
  }
21
  if ($iframe): echo $iframe; ?>
@@ -39,10 +39,12 @@ if ($iframe): echo $iframe; ?>
39
  case "expired":
40
  case "refund_requested":
41
  break;
42
- default:
43
- alert("unknown order status :" + event.data);
44
- break;
45
  }
 
 
 
 
 
46
  }
47
  // Attach the message listener
48
  if (window.addEventListener) {
15
  $iframe = false;
16
  break;
17
  default:
18
+ $iframe = '<iframe src="' . $url . '" style="width:100%; height:255px; overflow:hidden; border:none; margin:auto; display:block;" scrolling="no" allowtransparency="true" frameborder="0"> </iframe>';
19
  break;
20
  }
21
  if ($iframe): echo $iframe; ?>
39
  case "expired":
40
  case "refund_requested":
41
  break;
 
 
 
42
  }
43
+ iFrameResize({
44
+ log : false,
45
+ enablePublicMethods : true
46
+ });
47
+
48
  }
49
  // Attach the message listener
50
  if (window.addEventListener) {
app/etc/modules/Yellow_Bitcoin.xml CHANGED
@@ -33,7 +33,7 @@ SOFTWARE.
33
  <depends>
34
  <Mage_Payment/>
35
  </depends>
36
- <version>0.2.4</version>
37
  </Yellow_Bitcoin>
38
  </modules>
39
  </config>
33
  <depends>
34
  <Mage_Payment/>
35
  </depends>
36
+ <version>1.0.0</version>
37
  </Yellow_Bitcoin>
38
  </modules>
39
  </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Yellow_Pay</name>
4
- <version>0.2.4</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/YellowPay/yellow-magento/blob/master/LICENSE.md">MITL</license>
7
  <channel>community</channel>
@@ -30,11 +30,13 @@ Bitcoin payment is received and the customer is redirected to an order confirmat
30
  &#xD;
31
  6.&#xD;
32
  Yellow converts the received Bitcoin payment into a national currency (like AED) and transfers it to the merchant's bank account</description>
33
- <notes>* Remove unnecessary directory from package</notes>
 
 
34
  <authors><author><name>Tawfek Daghistani</name><user>tawfekov</user><email>tawfekov@gmail.com</email></author><author><name>James Piechota</name><user>YellowPay</user><email>james@yellowpay.co</email></author></authors>
35
- <date>2015-03-21</date>
36
- <time>00:35:20</time>
37
- <contents><target name="magelocal"><dir name="Yellow"><dir name="Bitcoin"><dir name="Block"><dir name="Adminhtml"><dir name="Ipn"><dir name="Edit"><file name="Form.php" hash="7f80eace317f9fe82d4f76c1964c1130"/><dir name="Tab"><file name="Form.php" hash="6a89244929f6cb68dfee02e8559cafb2"/></dir><file name="Tabs.php" hash="238c2dc91e560ea5b71964c8257d52a1"/></dir><file name="Edit.php" hash="025d0b4b35397890207a7ea8af97ee0e"/><file name="Grid.php" hash="84bf9234f25b8b27bbb1032442fc26ba"/></dir><file name="Ipn.php" hash="5fe044c4cb3fffcdab958c481a83e864"/><dir name="Log"><dir name="Edit"><file name="Form.php" hash="27fa08c710def8bf91ba212882c74e83"/><dir name="Tab"><file name="Form.php" hash="d9a427fd3e1011188f0214c128d3bb4e"/></dir><file name="Tabs.php" hash="275d186945a3cfc9d73ab2b7a606ca18"/></dir><file name="Edit.php" hash="6a4763b0d2427ce58ae46adef581d2f6"/><file name="Grid.php" hash="7eea4350f39da7956abfd60dec08e512"/></dir><file name="Log.php" hash="bca0901efdb1f99e5103fce583774967"/></dir><dir name="Form"><file name="Bitcoin.php" hash="def396189c0b2bc7d393cbb0f01eaa94"/></dir><dir name="Fullscreen"><dir name="Widget"><file name="Content.php" hash="f97e2a8a3ef850272fb5d3a7e2dd750d"/><file name="Footer.php" hash="d10cd8c519422fd4de3defcd88569239"/><file name="Header.php" hash="ba790b89254447b7d4a9362d02d2b4f3"/></dir></dir><file name="Info.php" hash="1d2052d6dcf46c18dd846d1072f259ef"/><file name="Status.php" hash="dd26ce7879dc006f19b8528b4cfe6dd4"/><file name="Widget.php" hash="8ccd444e154e061dc3bc70fe1991d421"/></dir><dir name="Helper"><file name="Data.php" hash="1cf4c54308119b860430666716aff650"/></dir><dir name="Model"><file name="Bitcoin.php" hash="183a7a0db190d7580f40b10085d5e117"/><file name="Http.php" hash="8cd7ca764944940130a54b7ed2927fdd"/><file name="Ipn.php" hash="cd66beab4f6bea576c6997bff68e0de2"/><file name="Log.php" hash="67d5fbbc997e57cefdbc1c8b28a94d93"/><dir name="Resource"><dir name="Ipn"><file name="Collection.php" hash="74285c584012f2b9d079ba258bc30ac9"/></dir><file name="Ipn.php" hash="a81ef4ed09a444a61c11ad1e92965438"/><dir name="Log"><file name="Collection.php" hash="fe97d78a654f856ea4eb005728b683e3"/></dir><file name="Log.php" hash="70de1ff87111d0ef4961c89810a1d8a0"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IpnController.php" hash="fcd760bd4f54eab247544dcd70cfa3e2"/><file name="LogController.php" hash="dbe296b63e4d3f6b7cc3b231fae8bf72"/></dir><file name="IndexController.php" hash="5a7835547242c091093b336f00bb1708"/></dir><dir name="etc"><file name="config.xml" hash="e4b9da86dcc28ff3bba119d1138dc6a9"/><file name="system.xml" hash="fa824ad05da3e4c10dab7841e9bf180f"/></dir><dir name="sql"><dir name="bitcoin_setup"><file name="mysql4-install-0.1.0.php" hash="2cd90bb78e7befc41e7b3c74d602db86"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="029263662ecc7b7dfe8e76cfa907b38b"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="afa8d749b6f82519964f9fe2aa4ff4a1"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="1872837133e08ed077cfa52eafd91a3a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bitcoin.xml" hash="7bfade000e7b0161459d711da6cc7461"/></dir><dir name="template"><dir name="bitcoin"><dir name="info"><file name="invoice.phtml" hash="61aa4bdffb8c22cc8601087cd1219057"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bitcoin.xml" hash="f7f9018e73c0a221d91836bec9b5e196"/></dir><dir name="template"><dir name="bitcoin"><dir name="form"><file name="bitcoin.phtml" hash="372b44fb50d60ff9d5d276d7110ecb22"/><file name="logo.phtml" hash="e5b1e7582fbea573179f7875fda5c5a0"/></dir><dir name="fullscreen"><dir name="widget"><file name="content.phtml" hash="2421622802bc48415f856f7595784c79"/><file name="footer.phtml" hash="e27fae4bc2d4bb87322b1246e3607c2b"/><file name="header.phtml" hash="959f3d652959d9eefde349f5bd42b412"/></dir></dir><dir name="info"><file name="invoice.phtml" hash="cb69a8227eebcfed673ec9c9ec848851"/></dir><file name="status.phtml" hash="4d7753c3efdcad9a2974b89ec636aa4c"/><file name="widget.phtml" hash="76708c6b5eb50513d5a911ae7e825582"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yellow_Bitcoin.xml" hash="6e221f66bd226da4be22e916229f70b8"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="bitcoin"><file name="bitcoin_accepted.png" hash="0682420205f3e2001b72901c44073163"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="bitcoin.css" hash="d000a6bb4999ce18a81284a4bbe84fab"/></dir><dir name="images"><dir name="bitcoin"><file name="bitcoin_accepted.png" hash="0682420205f3e2001b72901c44073163"/></dir></dir></dir></dir></dir></target></contents>
38
  <compatible/>
39
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
40
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Yellow_Pay</name>
4
+ <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/YellowPay/yellow-magento/blob/master/LICENSE.md">MITL</license>
7
  <channel>community</channel>
30
  &#xD;
31
  6.&#xD;
32
  Yellow converts the received Bitcoin payment into a national currency (like AED) and transfers it to the merchant's bank account</description>
33
+ <notes>* Payment invoice is now responsive&#xD;
34
+ * Fix some styling issue (e.g. image size in email, fullscreen invoice width)&#xD;
35
+ * Make plugin more permissive of api changes</notes>
36
  <authors><author><name>Tawfek Daghistani</name><user>tawfekov</user><email>tawfekov@gmail.com</email></author><author><name>James Piechota</name><user>YellowPay</user><email>james@yellowpay.co</email></author></authors>
37
+ <date>2015-04-26</date>
38
+ <time>20:02:08</time>
39
+ <contents><target name="magelocal"><dir name="Yellow"><dir name="Bitcoin"><dir name="Block"><dir name="Adminhtml"><dir name="Ipn"><dir name="Edit"><file name="Form.php" hash="7f80eace317f9fe82d4f76c1964c1130"/><dir name="Tab"><file name="Form.php" hash="6a89244929f6cb68dfee02e8559cafb2"/></dir><file name="Tabs.php" hash="238c2dc91e560ea5b71964c8257d52a1"/></dir><file name="Edit.php" hash="025d0b4b35397890207a7ea8af97ee0e"/><file name="Grid.php" hash="84bf9234f25b8b27bbb1032442fc26ba"/></dir><file name="Ipn.php" hash="5fe044c4cb3fffcdab958c481a83e864"/><dir name="Log"><dir name="Edit"><file name="Form.php" hash="27fa08c710def8bf91ba212882c74e83"/><dir name="Tab"><file name="Form.php" hash="d9a427fd3e1011188f0214c128d3bb4e"/></dir><file name="Tabs.php" hash="275d186945a3cfc9d73ab2b7a606ca18"/></dir><file name="Edit.php" hash="6a4763b0d2427ce58ae46adef581d2f6"/><file name="Grid.php" hash="7eea4350f39da7956abfd60dec08e512"/></dir><file name="Log.php" hash="bca0901efdb1f99e5103fce583774967"/></dir><dir name="Form"><file name="Bitcoin.php" hash="def396189c0b2bc7d393cbb0f01eaa94"/></dir><dir name="Fullscreen"><dir name="Widget"><file name="Content.php" hash="f97e2a8a3ef850272fb5d3a7e2dd750d"/><file name="Footer.php" hash="d10cd8c519422fd4de3defcd88569239"/><file name="Header.php" hash="ba790b89254447b7d4a9362d02d2b4f3"/></dir></dir><file name="Info.php" hash="1d2052d6dcf46c18dd846d1072f259ef"/><file name="Status.php" hash="dd26ce7879dc006f19b8528b4cfe6dd4"/><file name="Widget.php" hash="6d640b82fae0c83cce79aed368a05044"/></dir><dir name="Helper"><file name="Data.php" hash="b96124f0753fdaa49644b8fdac5f95ce"/></dir><dir name="Model"><file name="Bitcoin.php" hash="6d3b84f607ca2591d12db196da60cd71"/><file name="Http.php" hash="8cd7ca764944940130a54b7ed2927fdd"/><file name="Ipn.php" hash="cd66beab4f6bea576c6997bff68e0de2"/><file name="Log.php" hash="67d5fbbc997e57cefdbc1c8b28a94d93"/><dir name="Resource"><dir name="Ipn"><file name="Collection.php" hash="74285c584012f2b9d079ba258bc30ac9"/></dir><file name="Ipn.php" hash="a81ef4ed09a444a61c11ad1e92965438"/><dir name="Log"><file name="Collection.php" hash="fe97d78a654f856ea4eb005728b683e3"/></dir><file name="Log.php" hash="70de1ff87111d0ef4961c89810a1d8a0"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IpnController.php" hash="fcd760bd4f54eab247544dcd70cfa3e2"/><file name="LogController.php" hash="dbe296b63e4d3f6b7cc3b231fae8bf72"/></dir><file name="IndexController.php" hash="314d06d1fc10c37a171c07d23dc694f4"/></dir><dir name="etc"><file name="config.xml" hash="c3ed8674d1f925d2757984dda143ff08"/><file name="system.xml" hash="fa824ad05da3e4c10dab7841e9bf180f"/></dir><dir name="sql"><dir name="bitcoin_setup"><file name="mysql4-install-0.1.0.php" hash="2cd90bb78e7befc41e7b3c74d602db86"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="029263662ecc7b7dfe8e76cfa907b38b"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="afa8d749b6f82519964f9fe2aa4ff4a1"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="1872837133e08ed077cfa52eafd91a3a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bitcoin.xml" hash="7bfade000e7b0161459d711da6cc7461"/></dir><dir name="template"><dir name="bitcoin"><dir name="info"><file name="invoice.phtml" hash="61aa4bdffb8c22cc8601087cd1219057"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bitcoin.xml" hash="a014f0f6db51f74368c2b613038347a3"/></dir><dir name="template"><dir name="bitcoin"><dir name="form"><file name="bitcoin.phtml" hash="372b44fb50d60ff9d5d276d7110ecb22"/><file name="logo.phtml" hash="e5b1e7582fbea573179f7875fda5c5a0"/></dir><dir name="fullscreen"><dir name="widget"><file name="content.phtml" hash="6bfc9ee8833020bf300273efb8768111"/><file name="footer.phtml" hash="e27fae4bc2d4bb87322b1246e3607c2b"/><file name="header.phtml" hash="959f3d652959d9eefde349f5bd42b412"/></dir></dir><dir name="info"><file name="invoice.phtml" hash="ba13d5900d99c8fcf550601e378dcb4c"/></dir><file name="status.phtml" hash="4d7753c3efdcad9a2974b89ec636aa4c"/><file name="widget.phtml" hash="fe6e73c20d78b9a8ca5d6195b7fd07f8"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yellow_Bitcoin.xml" hash="4d89864189b7df774ee433a8fb4d33fe"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="bitcoin"><file name="bitcoin_accepted.png" hash="0682420205f3e2001b72901c44073163"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="bitcoin.css" hash="64690606065417b6a4a717dab367d7df"/></dir><dir name="images"><dir name="bitcoin"><file name="bitcoin_accepted.png" hash="0682420205f3e2001b72901c44073163"/></dir></dir><dir name="js"><file name="iframeResizer.min.js" hash="0f471bcfd5d0edf49ef67542b7a763a0"/></dir></dir></dir></dir></target></contents>
40
  <compatible/>
41
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
42
  </package>
skin/frontend/base/default/css/bitcoin.css CHANGED
@@ -14,6 +14,7 @@
14
  font-size: 13px;
15
  color: #333333;
16
  padding: 45px 10px;
 
17
  max-width: 625px;
18
  margin: auto;
19
  }
14
  font-size: 13px;
15
  color: #333333;
16
  padding: 45px 10px;
17
+ width: 100%;
18
  max-width: 625px;
19
  margin: auto;
20
  }
skin/frontend/base/default/js/iframeResizer.min.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*! iFrame Resizer (iframeSizer.min.js ) - v2.8.5 - 2015-03-18
2
+ * Desc: Force cross domain iframes to size to content.
3
+ * Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
4
+ * Copyright: (c) 2015 David J. Bradshaw - dave@bradshaw.net
5
+ * License: MIT
6
+ */
7
+
8
+ !function(){"use strict";function a(a,b,c){"addEventListener"in window?a.addEventListener(b,c,!1):"attachEvent"in window&&a.attachEvent("on"+b,c)}function b(){var a,b=["moz","webkit","o","ms"];for(a=0;a<b.length&&!z;a+=1)z=window[b[a]+"RequestAnimationFrame"];z||e(" RequestAnimationFrame not supported")}function c(){var a="Host page";return window.top!==window.self&&(a=window.parentIFrame?window.parentIFrame.getId():"Nested host page"),a}function d(a){return v+"["+c()+"]"+a}function e(a){s&&"object"==typeof window.console&&console.log(d(a))}function f(a){"object"==typeof window.console&&console.warn(d(a))}function g(a){function b(){function a(){k(G),i(),B[H].resizedCallback(G)}g("Height"),g("Width"),l(a,G,"resetPage")}function c(a){var b=a.id;e(" Removing iFrame: "+b),a.parentNode.removeChild(a),B[b].closedCallback(b),e(" --")}function d(){var a=F.substr(w).split(":");return{iframe:document.getElementById(a[0]),id:a[0],height:a[1],width:a[2],type:a[3]}}function g(a){var b=Number(B[H]["max"+a]),c=Number(B[H]["min"+a]),d=a.toLowerCase(),f=Number(G[d]);if(c>b)throw new Error("Value for min"+a+" can not be greater than max"+a);e(" Checking "+d+" is in range "+c+"-"+b),c>f&&(f=c,e(" Set "+d+" to min value")),f>b&&(f=b,e(" Set "+d+" to max value")),G[d]=""+f}function m(){var b=a.origin,c=G.iframe.src.split("/").slice(0,3).join("/");if(B[H].checkOrigin&&(e(" Checking connection is from: "+c),""+b!="null"&&b!==c))throw new Error("Unexpected message received from: "+b+" for "+G.iframe.id+". Message was: "+a.data+". This error can be disabled by adding the checkOrigin: false option.");return!0}function n(){return v===(""+F).substr(0,w)}function o(){var a=G.type in{"true":1,"false":1};return a&&e(" Ignoring init message from meta parent page"),a}function p(a){return F.substr(F.indexOf(":")+u+a)}function q(a){e(" MessageCallback passed: {iframe: "+G.iframe.id+", message: "+a+"}"),B[H].messageCallback({iframe:G.iframe,message:JSON.parse(a)}),e(" --")}function t(){if(null===G.iframe)throw new Error("iFrame ("+G.id+") does not exist on "+x);return!0}function z(a){var b=a.getBoundingClientRect();return h(),{x:parseInt(b.left,10)+parseInt(y.x,10),y:parseInt(b.top,10)+parseInt(y.y,10)}}function A(a){function b(){y=g,C(),e(" --")}function c(){return{x:Number(G.width)+d.x,y:Number(G.height)+d.y}}var d=a?z(G.iframe):{x:0,y:0},g=c();e(" Reposition requested from iFrame (offset x:"+d.x+" y:"+d.y+")"),window.top!==window.self?window.parentIFrame?a?parentIFrame.scrollToOffset(g.x,g.y):parentIFrame.scrollTo(G.width,G.height):f(" Unable to scroll to requested position, window.parentIFrame not found"):b()}function C(){!1!==B[H].scrollCallback(y)&&i()}function D(a){function b(a){var b=z(a);e(" Moving to in page link (#"+c+") at x: "+b.x+" y: "+b.y),y={x:b.x,y:b.y},C(),e(" --")}var c=a.split("#")[1]||"",d=decodeURIComponent(c),f=document.getElementById(d)||document.getElementsByName(d)[0];window.top!==window.self?window.parentIFrame?parentIFrame.moveToAnchor(c):e(" In page link #"+c+" not found and window.parentIFrame not found"):f?b(f):e(" In page link #"+c+" not found")}function E(){switch(G.type){case"close":c(G.iframe),B[H].resizedCallback(G);break;case"message":q(p(6));break;case"scrollTo":A(!1);break;case"scrollToOffset":A(!0);break;case"inPageLink":D(p(9));break;case"reset":j(G);break;case"init":b(),B[H].initCallback(G.iframe);break;default:b()}}var F=a.data,G={},H=null;n()&&(G=d(),H=G.id,s=B[H].log,e(" Received: "+F),!o()&&t()&&m()&&(E(),r=!1))}function h(){null===y&&(y={x:void 0!==window.pageXOffset?window.pageXOffset:document.documentElement.scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop},e(" Get page position: "+y.x+","+y.y))}function i(){null!==y&&(window.scrollTo(y.x,y.y),e(" Set page position: "+y.x+","+y.y),y=null)}function j(a){function b(){k(a),m("reset","reset",a.iframe)}e(" Size reset requested by "+("init"===a.type?"host page":"iFrame")),h(),l(b,a,"init")}function k(a){function b(b){a.iframe.style[b]=a[b]+"px",e(" IFrame ("+c+") "+b+" set to "+a[b]+"px")}var c=a.iframe.id;B[c].sizeHeight&&b("height"),B[c].sizeWidth&&b("width")}function l(a,b,c){c!==b.type&&z?(e(" Requesting animation frame"),z(a)):a()}function m(a,b,c){e("["+a+"] Sending msg to iframe ("+b+")"),c.contentWindow.postMessage(v+b,"*")}function n(b){function c(){function a(a){1/0!==B[o][a]&&0!==B[o][a]&&(n.style[a]=B[o][a]+"px",e(" Set "+a+" = "+B[o][a]+"px"))}a("maxHeight"),a("minHeight"),a("maxWidth"),a("minWidth")}function d(a){return""===a&&(n.id=a="iFrameResizer"+q++,s=(b||{}).log,e(" Added missing iframe ID: "+a+" ("+n.src+")")),a}function f(){e(" IFrame scrolling "+(B[o].scrolling?"enabled":"disabled")+" for "+o),n.style.overflow=!1===B[o].scrolling?"hidden":"auto",n.scrolling=!1===B[o].scrolling?"no":"yes"}function g(){("number"==typeof B[o].bodyMargin||"0"===B[o].bodyMargin)&&(B[o].bodyMarginV1=B[o].bodyMargin,B[o].bodyMargin=""+B[o].bodyMargin+"px")}function h(){return o+":"+B[o].bodyMarginV1+":"+B[o].sizeWidth+":"+B[o].log+":"+B[o].interval+":"+B[o].enablePublicMethods+":"+B[o].autoResize+":"+B[o].bodyMargin+":"+B[o].heightCalculationMethod+":"+B[o].bodyBackground+":"+B[o].bodyPadding+":"+B[o].tolerance+":"+B[o].enableInPageLinks}function i(b){a(n,"load",function(){var a=r;m("iFrame.onload",b,n),!a&&B[o].heightCalculationMethod in A&&j({iframe:n,height:0,width:0,type:"init"})}),m("init",b,n)}function k(a){if("object"!=typeof a)throw new TypeError("Options is not an object.")}function l(a){a=a||{},B[o]={},k(a);for(var b in C)C.hasOwnProperty(b)&&(B[o][b]=a.hasOwnProperty(b)?a[b]:C[b]);s=B[o].log}var n=this,o=d(n.id);l(b),f(),c(),g(),i(h())}function o(){function a(a,b){if(!a.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==a.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+a.tagName+">.");n.call(a,b)}return function(b,c){switch(typeof c){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(c||"iframe"),function(c){a(c,b)});break;case"object":a(c,b);break;default:throw new TypeError("Unexpected data type ("+typeof c+").")}}}function p(a){a.fn.iFrameResize=function(a){return this.filter("iframe").each(function(b,c){n.call(c,a)}).end()}}var q=0,r=!0,s=!1,t="message",u=t.length,v="[iFrameSizer]",w=v.length,x="",y=null,z=window.requestAnimationFrame,A={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},B={},C={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,enableInPageLinks:!1,enablePublicMethods:!1,heightCalculationMethod:"offset",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,closedCallback:function(){},initCallback:function(){},messageCallback:function(){},resizedCallback:function(){},scrollCallback:function(){return!0}};b(),a(window,"message",g),window.jQuery&&p(jQuery),"function"==typeof define&&define.amd?define([],o):"object"==typeof module&&"object"==typeof module.exports?module.exports=o():window.iFrameResize=o()}();
9
+ //# sourceMappingURL=iframeResizer.map