SEPA Payment
This commit is contained in:
parent
7ef7a507c7
commit
f117f79bb9
9 changed files with 286 additions and 95 deletions
|
|
@ -129,27 +129,26 @@ class CheckoutController extends Controller
|
|||
//check credit Card
|
||||
if(Input::get('payment_method')){
|
||||
|
||||
$cc_ret = [];
|
||||
$ret = [];
|
||||
//need precheck the card
|
||||
if(Input::get('payment_method') == 'cc'){
|
||||
if(Input::get('payment_method') === 'cc'){
|
||||
$pay = new PayoneController();
|
||||
$cc_ret = $pay->checkCreditCard($data);
|
||||
if($cc_ret['status'] == 'ERROR' || $cc_ret['status'] == 'INVALID'){
|
||||
$ret['cc'] = $pay->checkCreditCard($data);
|
||||
if($ret['cc']['status'] === 'ERROR' || $ret['cc']['status'] === 'INVALID'){
|
||||
/* PaymentTransaction::create([
|
||||
'shopping_payment_id' => //is no shopping_payment_id at this moment,
|
||||
'request' => 'creditcardcheck,
|
||||
'errorcode' => $cc_ret['errorcode'],
|
||||
'errormessage' => $cc_ret['errormessage'],
|
||||
'customermessage' => $cc_ret['customermessage'],
|
||||
'errorcode' => $ret['cc']['errorcode'],
|
||||
'errormessage' => $ret['cc']['errormessage'],
|
||||
'customermessage' => $ret['cc']['customermessage'],
|
||||
'status' => $response['status'],
|
||||
]);*/
|
||||
\Session::flash('cc-error', 1);
|
||||
\Session::flash('errormessage', $cc_ret['errormessage']);
|
||||
\Session::flash('customermessage', $cc_ret['customermessage']);
|
||||
\Session::flash('errormessage', $ret['cc']['errormessage']);
|
||||
\Session::flash('customermessage', $ret['cc']['customermessage']);
|
||||
return redirect(route('checkout.checkout_card'))->withInput(Input::all());
|
||||
exit;
|
||||
}
|
||||
if($cc_ret['status'] == 'VALID'){
|
||||
if($ret['cc']['status'] === 'VALID'){
|
||||
/*
|
||||
* array(4) { ["status"]=> string(5) "VALID" ["pseudocardpan"]=> string(19) "9410010000169020567" ["cardtype"]=> string(1) "V" ["truncatedcardpan"]=> string(16) "411111XXXXXX1111" }
|
||||
* application through http post
|
||||
|
|
@ -158,11 +157,56 @@ class CheckoutController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
//need precheck the card
|
||||
if(Input::get('payment_method') === 'elv' && is_null(Input::get('mandate_identification'))){
|
||||
$pay = new PayoneController();
|
||||
$amount = (int) (float) Yard::instance('shopping')->totalWithShipping(2, '.', ',') *100;
|
||||
$ret['elv'] = $pay->checkBankAccount($data, $amount, 'EUR', $shopping_user);
|
||||
|
||||
if($ret['elv']['status'] === 'ERROR' || $ret['elv']['status'] === 'INVALID'){
|
||||
/* PaymentTransaction::create([
|
||||
'shopping_payment_id' => //is no shopping_payment_id at this moment,
|
||||
'request' => 'creditcardcheck,
|
||||
'errorcode' => $ret['cc']['errorcode'],
|
||||
'errormessage' => $ret['cc']['errormessage'],
|
||||
'customermessage' => $ret['cc']['customermessage'],
|
||||
'status' => $response['status'],
|
||||
]);*/
|
||||
\Session::flash('elv-error', 1);
|
||||
\Session::flash('errormessage', $ret['elv']['errormessage']);
|
||||
\Session::flash('customermessage', $ret['elv']['customermessage']);
|
||||
return redirect(route('checkout.checkout_card'))->withInput(Input::all());
|
||||
}
|
||||
if($ret['elv']['status'] === 'APPROVED' && $ret['elv']['mandate_status'] !== "active"){
|
||||
dd($ret);
|
||||
\Session::flash('elv-managemandate', 1);
|
||||
\Session::flash('elv-mandate_identification', $ret['elv']['mandate_identification']);
|
||||
\Session::flash('elv-mandate_text', $ret['elv']['mandate_text']);
|
||||
\Session::flash('elv-creditor_identifier', $ret['elv']['creditor_identifier']);
|
||||
return redirect(route('checkout.checkout_card'))->withInput(Input::all());
|
||||
|
||||
|
||||
/*
|
||||
* array(4) { ["status"]=> string(5) "VALID" ["pseudocardpan"]=> string(19) "9410010000169020567" ["cardtype"]=> string(1) "V" ["truncatedcardpan"]=> string(16) "411111XXXXXX1111" }
|
||||
* application through http post
|
||||
* get this to the prepayment
|
||||
* */
|
||||
}
|
||||
$ret['elv']['bankaccountholder'] = $data['elv_bankaccountholder'];
|
||||
|
||||
}
|
||||
if(Input::get('payment_method') === 'elv' && Input::get('mandate_identification')) {
|
||||
$ret['elv']['mandate_identification'] = Input::get('mandate_identification');
|
||||
$ret['elv']['creditor_identifier'] = Input::get('creditor_identifier');
|
||||
$ret['elv']['iban'] = $data['iban'];
|
||||
$ret['elv']['bic'] = $data['elv_bic'];
|
||||
$ret['elv']['bankaccountholder'] = $data['elv_bankaccountholder'];
|
||||
}
|
||||
//other
|
||||
$pay = new PayoneController();
|
||||
$pay->init($shopping_user, $shopping_order);
|
||||
$amount = intval(floatval(Yard::instance('shopping')->totalWithShipping(2, '.', ',')) *100);
|
||||
$reference = $pay->setPrePayment(Input::get('payment_method'), $amount, 'EUR', $cc_ret);
|
||||
$amount = (int) (float) Yard::instance('shopping')->totalWithShipping(2, '.', ',') *100;
|
||||
$reference = $pay->setPrePayment(Input::get('payment_method'), $amount, 'EUR', $ret);
|
||||
$this->putPayments('payment_reference', $reference);
|
||||
$pay->setPersonalData();
|
||||
return $pay->ResponseData();
|
||||
|
|
@ -185,7 +229,7 @@ class CheckoutController extends Controller
|
|||
$ShoppingPayment->status = $status;
|
||||
$ShoppingPayment->save();
|
||||
|
||||
if($status == "success"){
|
||||
if($status === "success"){
|
||||
|
||||
Yard::instance('shopping')->destroy();
|
||||
$this->destroy();
|
||||
|
|
@ -199,12 +243,12 @@ class CheckoutController extends Controller
|
|||
];
|
||||
return view('web.templates.checkout-final', $data);
|
||||
}
|
||||
if($status == "cancel"){
|
||||
if($status === "cancel"){
|
||||
\Session::flash('checkout-error', 'Der Zahlungsvorgang wurde abgebrochen, die Bestellung konnte nicht ausgeführt werden.');
|
||||
return redirect(route('checkout.checkout_card'));
|
||||
|
||||
}
|
||||
if($status == "error"){
|
||||
if($status === "error"){
|
||||
\Session::flash('checkout-error', 'Der Zahlungsvorgang wurde abgebrochen, die Bestellung konnte nicht ausgeführt werden.');
|
||||
return redirect(route('checkout.checkout_card'));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue