Commit 6cc40e6c authored by Andy J's avatar Andy J

SHOP-2492 #in-progress

parent 2ee50521
......@@ -364,24 +364,37 @@ class PayPalExpress extends PaymentMethod
$r = $e->getMessage();
$this->doLog("Response: DoExpressCheckoutPayment:\n\n<pre>{$r}</pre>", LOGLEVEL_NOTICE);
}
if ($response->Ack === 'Success') {
$paymentInfo = $response->DoExpressCheckoutPaymentResponseDetails->PaymentInfo[0];
$this->doLog("Payment status: {$paymentInfo->PaymentStatus} (Order: {$order->kBestellung}, Reason: {$paymentInfo->PendingReason})", LOGLEVEL_NOTICE);
if (strcasecmp($paymentInfo->PaymentStatus, 'Completed') === 0) {
$this->addIncomingPayment($order, [
'fBetrag' => $basket->total[WarenkorbHelper::GROSS],
'fZahlungsgebuehr' => $basket->surcharge[WarenkorbHelper::GROSS],
'cISO' => $basket->currency->cISO,
'cZahler' => $_SESSION['reshash']['Payer'],
'cHinweis' => $paymentInfo->TransactionID,
]);
$this->setOrderStatusToPaid($order);
}
}
switch ($response->Ack) {
case 'Success': {
$paymentInfo = $response->DoExpressCheckoutPaymentResponseDetails->PaymentInfo[0];
$this->doLog("Payment status: {$paymentInfo->PaymentStatus} (Order: {$order->kBestellung}, Reason: {$paymentInfo->PendingReason})", LOGLEVEL_NOTICE);
if (strcasecmp($paymentInfo->PaymentStatus, 'Completed') === 0) {
$this->addIncomingPayment($order, [
'fBetrag' => $basket->total[WarenkorbHelper::GROSS],
'fZahlungsgebuehr' => $basket->surcharge[WarenkorbHelper::GROSS],
'cISO' => $basket->currency->cISO,
'cZahler' => $_SESSION['reshash']['Payer'],
'cHinweis' => $paymentInfo->TransactionID,
]);
$this->setOrderStatusToPaid($order);
}
break;
}
// https://developer.paypal.com/docs/classic/express-checkout/ht_ec_fundingfailure10486/
case 'Failure': {
$error = $response->Errors[0];
if ((int)$error->ErrorCode === 10486) {
$redirect = $this->PayPalURL . $_SESSION['reshash']['Token'];
header("Location: {$redirect}");
exit;
}
break;
}
}
Session::getInstance()->cleanUp();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment