Skip to content

Commit

Permalink
Release 2.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiano-mallmann authored Jan 21, 2025
2 parents bccf832 + 633a407 commit 910a5f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pagarme/ecommerce-module-core",
"description": "Core component for Pagar.me e-commerce platform modules.",
"license": "MIT",
"version": "2.7.0",
"version": "2.7.1",
"authors": [
{
"name":"Open Source Team"
Expand Down
10 changes: 7 additions & 3 deletions src/Kernel/Services/APIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ private function getRequestMetaData($orderRequest)
$metadata->moduleVersion = $versionService->getModuleVersion();
$metadata->coreVersion = $versionService->getCoreVersion();
$metadata->platformVersion = $versionService->getPlatformVersion();
if($this->hasCreditCardInPayments($orderRequest->payments) && !empty(MPSetup::getInstallmentType())){
if (
property_exists($orderRequest, "payments") &&
$this->hasCreditCardInPayments($orderRequest->payments) &&
!empty(MPSetup::getInstallmentType())
) {
$metadata->interestType = MPSetup::getInstallmentType();
}
return $metadata;
Expand All @@ -180,7 +184,7 @@ private function getRequestMetaData($orderRequest)
private function hasCreditCardInPayments($payments)
{
foreach ($payments as $payment) {
if($payment->paymentMethod === TransactionType::CREDIT_CARD) {
if ($payment->paymentMethod === TransactionType::CREDIT_CARD) {
return true;
}
}
Expand Down Expand Up @@ -291,7 +295,7 @@ public function createSubscription(Subscription $subscription)
$endpoint = $this->getAPIBaseEndpoint();

$subscription->addMetaData(
json_decode(json_encode($this->getRequestMetaData()), true)
json_decode(json_encode($this->getRequestMetaData($subscription)), true)
);

$subscriptionRequest = $subscription->convertToSDKRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ private function handleSubscriptionStatusPaid(Subscription $subscription)
return $cantCreateReason;
}

private function handleSubscriptionStatusProcessing(Subscription $subscription)
{
return $this->handleSubscriptionStatusPaid($subscription);
}

private function handleSubscriptionStatusPending(Subscription $subscription)
{
$order = $this->order;
Expand Down

0 comments on commit 910a5f4

Please sign in to comment.