Skip to content

Commit

Permalink
PT-5184 - add hint to internal comment so mark payments with invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
mitelg committed Jun 14, 2017
1 parent 33d9d68 commit 8a8bccb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Components/PaymentInstructionProvider.php
Expand Up @@ -33,10 +33,10 @@ public function __construct(PDOConnection $db)
*/
public function getInstructionsByOrderNumberAndTransactionId($orderNumber, $transactionId)
{
$sql = "SELECT *
$sql = 'SELECT *
FROM s_payment_paypal_plus_payment_instruction
WHERE ordernumber = :orderNumber
AND reference_number = :referenceNumber;";
AND reference_number = :referenceNumber;';

$result = $this->db->fetchRow(
$sql,
Expand Down Expand Up @@ -72,14 +72,19 @@ public function saveInstructionByOrderNumber($orderNumber, array $instructions)
);

$this->db->query($this->getInsertSql(), $parameter);

$sql = 'UPDATE s_order
SET internalcomment = CONCAT(internalcomment, :invoiceComment)
WHERE ordernumber = :orderNumber';
$this->db->query($sql, array('invoiceComment' => "\nPaid with Paypal Invoice\n", 'orderNumber' => $orderNumber));
}

/**
* @return string
*/
private function getInsertSql()
{
return "INSERT INTO s_payment_paypal_plus_payment_instruction (
return 'INSERT INTO s_payment_paypal_plus_payment_instruction (
ordernumber,
reference_number,
instruction_type,
Expand All @@ -103,6 +108,6 @@ private function getInsertSql()
:amount_currency,
:payment_due_date,
:links
);";
);';
}
}

0 comments on commit 8a8bccb

Please sign in to comment.