membership register
This commit is contained in:
parent
3711fcc8d0
commit
37cb2b06c7
38 changed files with 1261 additions and 463 deletions
|
|
@ -93,6 +93,15 @@ class PayoneController extends Controller
|
|||
die();
|
||||
}
|
||||
|
||||
/* TODO -- need this?
|
||||
|
||||
if($shopping_payment->txaction == $data['txaction']){
|
||||
\Log::channel('payone')->error('PaymentStatus: same txaction error: '.json_encode($data));
|
||||
echo "PaymentStatus: same txaction:";
|
||||
var_dump($data);
|
||||
die();
|
||||
}
|
||||
*/
|
||||
//create transaction
|
||||
PaymentTransaction::create([
|
||||
'shopping_payment_id' => $shopping_payment->id,
|
||||
|
|
@ -110,13 +119,15 @@ class PayoneController extends Controller
|
|||
$shopping_payment->txaction = $data['txaction'];
|
||||
$shopping_payment->save();
|
||||
|
||||
|
||||
if($data['txaction'] == 'failed'){
|
||||
$send_link = false;
|
||||
if($data['txaction'] === 'failed'){
|
||||
|
||||
}
|
||||
if($data['txaction'] == 'paid'){
|
||||
|
||||
if($data['txaction'] === 'paid'){
|
||||
$shopping_order->paid = true;
|
||||
$shopping_order->save();
|
||||
|
||||
//if product has actions
|
||||
if($shopping_order->shopping_order_items && $shopping_order->auth_user_id){
|
||||
foreach($shopping_order->shopping_order_items as $shopping_order_item){
|
||||
|
|
@ -124,14 +135,18 @@ class PayoneController extends Controller
|
|||
if($shopping_order_item->product->action){
|
||||
|
||||
$user = User::findOrFail($shopping_order->auth_user_id);
|
||||
$user->payment_order_id = $shopping_order_item->product->id;
|
||||
$user->save();
|
||||
$send_link = true;
|
||||
$date = date("Y-m-d H:i:s", strtotime("+1 years"));
|
||||
foreach ($shopping_order_item->product->action as $do){
|
||||
if($shopping_order_item->product->getActionName($do) === 'payment_for_account'){
|
||||
$user->payment_account = date("Y-m-d H:i:s", strtotime("+1 years"));
|
||||
$user->wizard = 10;
|
||||
$user->payment_account = $date;
|
||||
$user->wizard = 100;
|
||||
}
|
||||
if($shopping_order_item->product->getActionName($do) === 'payment_for_shop'){
|
||||
$user->payment_shop = date("Y-m-d H:i:s", strtotime("+1 years"));
|
||||
$user->wizard = 10;
|
||||
$user->payment_shop = $date;
|
||||
$user->wizard = 100;
|
||||
}
|
||||
$user->save();
|
||||
}
|
||||
|
|
@ -141,7 +156,7 @@ class PayoneController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if($data['txaction'] == 'appointed'){
|
||||
if($data['txaction'] === 'appointed'){
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -152,9 +167,9 @@ class PayoneController extends Controller
|
|||
}
|
||||
$checkout_mail = config('app.checkout_mail');
|
||||
if($user_shop_email){
|
||||
Mail::to($billing_email)->bcc([$user_shop_email, $checkout_mail])->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment));
|
||||
Mail::to($billing_email)->bcc([$user_shop_email, $checkout_mail])->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link));
|
||||
}else{
|
||||
Mail::to($billing_email)->bcc($checkout_mail)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment));
|
||||
Mail::to($billing_email)->bcc($checkout_mail)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link));
|
||||
}
|
||||
|
||||
print("TSOK");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue