Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : dynamic properties #10

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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