Skip to content

Commit

Permalink
Added customer info in BillToCustomer field, order ref is passed in R…
Browse files Browse the repository at this point in the history
…efNr
  • Loading branch information
Franck Allimant committed Dec 16, 2024
1 parent 603cb0e commit 7920f1e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.1.0</version>
<version>2.1.1</version>
<authors>
<author>
<name>Nicolas Barbey</name>
Expand Down
19 changes: 18 additions & 1 deletion Service/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,31 @@ public function createPaymentData(Order $order, AxceptaScheme $schemeData = null
$paymentRequest->setTransID($transId);
$paymentRequest->setAmount((int) ($order->getTotalAmount() * 100));
$paymentRequest->setCurrency($order->getCurrency()->getCode());
$paymentRequest->setRefNr($order->getId());
$paymentRequest->setRefNr($order->getRef());
$paymentRequest->setURLSuccess($urlNotification);
$paymentRequest->setURLFailure($urlNotification);
$paymentRequest->setURLNotify($urlNotification);
$paymentRequest->setURLBack($urlAnnulation);
$paymentRequest->setReponse('encrypt');
$paymentRequest->setLanguage($this->requestStack->getCurrentRequest()?->getSession()->getLang()->getLocale());

// Customer info mail or mobile phone or landphone required
$btc = [
'customerNumber' => $order->getCustomer()->getRef(),
'consumer' => [
'salutation' => match ($order->getCustomer()->getTitleId()) {
3 => 'Miss',
2 => 'Mrs',
default => 'Mr',
},
'firstName' => $order->getCustomer()->getFirstname(),
'lastName' => $order->getCustomer()->getLastname(),
],
'email' => $order->getCustomer()->getEmail(),
];

$paymentRequest->setBillToCustomer(base64_encode(json_encode($btc)));

// Recurring payment request
$feature = Axepta::getConfigValue(Axepta::PAYMENT_FEATURE, Axepta::PAYMENT_FEATURE_UNIQUE);

Expand Down

0 comments on commit 7920f1e

Please sign in to comment.