提交 11d53bf1 编写于 作者: R root

paypal standard payment

上级 b91fba43
......@@ -53,9 +53,11 @@ class AppfrontController extends FecController
if(!$this->blockNamespace){
throw new \yii\web\HttpException(406,'blockNamespace is empty , you should config it in module->blockNamespace or controller blockNamespace ');
}
$viewId = $this->id;
$viewId = str_replace('/','\\',$viewId);
$relativeFile = '\\'.$this->blockNamespace;
$relativeFile .= '\\'.$this->id.'\\'.ucfirst($blockName);
$relativeFile .= '\\'.$viewId.'\\'.ucfirst($blockName);
return new $relativeFile;
}
......
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\appfront\modules\Payment\block\paypal\standard;
use Yii;
use fec\helpers\CModule;
use fec\helpers\CRequest;
use yii\base\InvalidValueException;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class Start {
public function getLastData(){
$increment_id = Yii::$service->order->getSessionIncrementId();
$loaderImg = Yii::$service->image->getImgUrl('images/loader.gif','appfront');
$paypalLogoImg = Yii::$service->image->getImgUrl('custom/logo.png','appfront');
/*
$store_name = Store::getCurrentStoreLabel();
$paypal = Config::param("payment_method");
$submitAction = $paypal['paypal']['payments_standard']['redirect_url'];
$paypal_account = $paypal['paypal']['payments_standard']['user'];
$order_increment_id = $this->_order['increment_id'];
$order_currency = $this->_order['order_currency_code'];
$paymentaction = "sale";
$cmd = '_cart';
$upload = 1;
$return_url = Url::getUrl('paypal/standard/success');
$cancel_url = Url::getUrl('paypal/standard/cancel');
$notify_url = Url::getUrl('paypal/ipn');
$tax = 0.00;
$tax_cart = 0.00;
$amount = $this->_order['grand_total'];
$shipping = $this->_order['shipping_total'];
$discount_amount = $this->_order['subtotal_with_discount'];
$discount_amount_cart = $discount_amount;
*/
return [
'loaderImg' => $loaderImg,
'paypalLogoImg' => $paypalLogoImg,
];
}
}
\ No newline at end of file
......@@ -33,6 +33,7 @@ class StandardController extends AppfrontController
}
}
......
......@@ -2676,4 +2676,35 @@ height: 33px;
color:#cc0000;
}
.text-center {
text-align: center;
}
.image404{width:600px;}
.content-404 h1 {
color: #363432;
font-family: "Roboto",sans-serif;
font-size: 41px;
font-weight: 300;
}
.content-404 h1 {
color: #363432;
font-family: "Roboto",sans-serif;
font-size: 41px;
font-weight: 300;
}
.content-404 p {
color: #363432;
font-family: "Roboto",sans-serif;
font-size: 18px;
}
<html>
<body>
You will be redirected to the PayPal website in a few seconds
<img src="<?= $loaderImg ?>" />
<?php // https://www.paypal.com/cgi-bin/webscr ?>
<form action="<?= $submitAction ?>" id="paypal_standard_checkout" name="paypal_standard_checkout" method="POST">
<input id="business" name="business" value="<?= $paypal_account ?>" type="hidden"/>
<input id="invoice" name="invoice" value="<?= $order_increment_id ?>" type="hidden"/>
<input id="currency_code" name="currency_code" value="<?= $order_currency ?>" type="hidden"/>
<input id="paymentaction" name="paymentaction" value="<?= $paymentaction ?>" type="hidden"/>
<input id="return" name="return" value="<?= $return_url ?>" type="hidden"/>
<input id="cancel_return" name="cancel_return" value="<?= $cancel_url ?>" type="hidden"/>
<input id="notify_url" name="notify_url" value="<?= $notify_url ?>" type="hidden"/>
<input id="cpp_header_image" name="cpp_header_image" value="<?= $paypal_logo_img ?>" type="hidden"/>
<input id="item_name" name="item_name" value="<?= $store_name ?>" type="hidden"/>
<input id="charset" name="charset" value="utf-8" type="hidden"/>
<input id="amount" name="amount" value="<?= $amount ?>" type="hidden"/>
<input id="tax" name="tax" value="<?= $tax ?>" type="hidden"/>
<input id="shipping" name="shipping" value="<?= $shipping ?>" type="hidden"/>
<input id="discount_amount" name="discount_amount" value="<?= $discount_amount ?>" type="hidden"/>
<?= $product_items ?>
<input id="cmd" name="cmd" value="<?= $cmd ?>" type="hidden"/>
<input id="upload" name="upload" value="<?= $upload ?>" type="hidden"/>
<input id="tax_cart" name="tax_cart" value="<?= $tax_cart ?>" type="hidden"/>
<input id="discount_amount_cart" name="discount_amount_cart" value="<?= $discount_amount_cart ?>" type="hidden"/>
<?= $address_html ?>.'
<span class="field-row">
<input id="submit_to_paypal_button_ffe6e6319afa1dc2e9e4d822e58ca9ca" name="" value="'.Translate::__("Click here if you are not redirected within 10 seconds").'..." type="submit" class=" submit"/>
</span>
</form>
<script type="text/javascript">
function func(){
document.getElementById("paypal_standard_checkout").submit();
}
window.onload=func;
</script>
</body>
</html>
\ No newline at end of file
......@@ -11,6 +11,13 @@ $this->title = $name;
?>
<div class="main container one-column">
<div class="col-main">
<div class="content-404 text-center">
<img class="image404" src="<?= Yii::$service->image->getImgUrl('images/404.png','appfront') ?>" class="img-responsive" alt="" />
<h1><b>OPPS!</b> We Couldn’t Find this Page</h1>
<p>Please contact us if you think this is a server error. Thank you..</p>
<h2><a href="<?= Yii::$service->url->homeUrl(); ?>">Bring me back Home</a></h2>
</div>
<!--
<div class="site-error">
<h1><?= Html::encode($this->title) ?></h1>
......@@ -27,4 +34,5 @@ $this->title = $name;
</p>
</div>
-->
</div>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册