Skip to content

Commit

Permalink
Added name and bankaccountnumber to the order information
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Pieters committed Mar 21, 2016
1 parent 6666e38 commit 746d25e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
15 changes: 13 additions & 2 deletions app/addons/paynl_addon/func.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,19 @@ function fn_getPaynlOptionId($var) {

return $result['paymentOptions'];
}

function fn_paynl_getInfo($payNLTransactionID, $processor_data){
$payApiInfo = new Pay_Api_Info();
$payApiInfo->setApiToken($processor_data['processor_params']['token_api']);
$payApiInfo->setServiceId($processor_data['processor_params']['service_id']);
$payApiInfo->setTransactionId($payNLTransactionID);
try {
$result = $payApiInfo->doRequest();
} catch (Exception $ex) {
fn_set_notification('E', __('error'), $ex->getMessage());
fn_redirect('/index.php?dispatch=checkout.checkout');
}
return $result;
}
function fn_paynl_getState($payNLTransactionID, $processor_data) {
$payApiInfo = new Pay_Api_Info();
$payApiInfo->setApiToken($processor_data['processor_params']['token_api']);
Expand Down Expand Up @@ -107,7 +119,6 @@ function fn_paynl_startTransaction($order_id, $order_info, $processor_data, $exc
if (!empty($order_info['gift_certificates'])) {
foreach ($order_info['gift_certificates'] as $k => $v) {
$v['amount'] = (!empty($v['extra']['exclude_from_calculate'])) ? 0 : $v['amount'];
$total = $total + $v['amount'] * 100;
$payNL->addProduct($v['gift_cert_id'], $v['gift_cert_code'], (-100) * $v['amount'], 1);
}
}
Expand Down
13 changes: 12 additions & 1 deletion app/payments/paynl.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ function fn_manageState($state, $idstate, $mode, $orderId, $payNLTransactionID,
break;
case 'PAID':

$payData = fn_paynl_getInfo($payNLTransactionID, $processor_data);

$pp_response = array(
'order_status' => $idstate,
'naam' => $payData['paymentDetails']['identifierName'],
'rekening' => $payData['paymentDetails']['identifierPublic']
);

fn_finish_payment($orderId, $pp_response, true);

if ($mode == 'exchange') {
echo 'TRUE| orderId='.$orderId.', transactionId='.$payNLTransactionID.
',idState:'.$idstate.', service_id:'.$processor_data['processor_params']['service_id'].
Expand All @@ -144,7 +154,8 @@ function fn_manageState($state, $idstate, $mode, $orderId, $payNLTransactionID,
fn_change_order_status($_REQUEST['csCartOrderId'], $idstate, '',
false);
fn_updatePayTransaction($payNLTransactionID, 'PAID');
fn_finish_payment($orderId, $idstate, true);


fn_order_placement_routines('route', $orderId);
}

Expand Down

0 comments on commit 746d25e

Please sign in to comment.