Skip to content

Commit

Permalink
fix : dynamic properties (#10)
Browse files Browse the repository at this point in the history
Fix Deprecated Functionality: Creation of dynamic property
  • Loading branch information
Francois-Gomis authored Nov 18, 2024
1 parent c4f644c commit a871f64
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

v0.3.3
------
* Fix Deprecated Functionality: Creation of dynamic property

v0.3.2
------
* remove payment plan deferred_type and deferred_duration
Expand Down
5 changes: 5 additions & 0 deletions Model/AlmaPlanDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
*/
class AlmaPlanDataProvider implements AdditionalDataProviderInterface
{
/**
* @var Logger
*/
private $logger;

public function __construct(
Logger $logger
) {
Expand Down
31 changes: 21 additions & 10 deletions Model/Resolver/AlmaPlaceOrderOutput.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
<?php

namespace Alma\GraphQL\Model\Resolver;

use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Alma\MonthlyPayments\Helpers\Logger;
use Alma\MonthlyPayments\Helpers\Eligibility;
use Alma\MonthlyPayments\Model\Api\Payment;

use Magento\Sales\Model\OrderFactory;

class AlmaPlaceOrderOutput implements ResolverInterface
{
/**
* @var Logger
*/
private $logger;
/**
* @var Payment
*/
private $almaPayment;
/**
* @var OrderFactory
*/
private $orderFactory;

public function __construct(
Logger $logger,
Eligibility $eligibility,
Logger $logger,
OrderFactory $orderFactory,
Payment $almaPayment
Payment $almaPayment
) {
$this->logger = $logger;
$this->eligibility = $eligibility;
$this->almaPayment = $almaPayment;
$this->orderFactory = $orderFactory;
}
Expand All @@ -35,19 +46,19 @@ public function __construct(
* @throws GraphQlInputException
*/
public function resolve(
Field $field,
$context,
Field $field,
$context,
ResolveInfo $info,
array $value = null,
array $args = null
array $value = null,
array $args = null
) {

$orderModel = $this->orderFactory->create();
$order = $orderModel->loadByIncrementId($value['order_id']);
$orderId = $order->getId();

$url = $this->almaPayment->getPaymentUrl($orderId);
$this->logger->info('$url',[$url]);
$this->logger->info('$url', [$url]);
return $url;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"magento/module-sales-graph-ql": ">=100.3.0"
},
"type": "magento2-module",
"version": "0.3.2",
"version": "0.3.3",
"license": [
"MIT"
],
Expand Down

0 comments on commit a871f64

Please sign in to comment.