From d6cfeec7fe42e1184bf213e37fd32c2baf4270ec Mon Sep 17 00:00:00 2001 From: GuilhermeFranca Date: Tue, 9 Jan 2024 18:32:17 -0300 Subject: [PATCH 1/4] cria o metodo setDefaultCard --- src/GuPaymentTrait.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/GuPaymentTrait.php b/src/GuPaymentTrait.php index a93c6f5..accdec7 100644 --- a/src/GuPaymentTrait.php +++ b/src/GuPaymentTrait.php @@ -92,6 +92,19 @@ public function defaultCard() return $customer->default_payment_method(); } + + /** + * Set customer's default card. + * + * @param String $paymentMethodId + * @return void + */ + public function setDefaultCard($paymentMethodId) + { + $customer = $this->asIuguCustomer(); + $customer['default_payment_method_id'] = $paymentMethodId; + $customer->save(); + } /** * Get a collection of the entity's cards. From e3aff204c404d42bfe338321964b70aaa98e3ce8 Mon Sep 17 00:00:00 2001 From: Guilherme-Franca-de-Souza Date: Mon, 22 Apr 2024 19:51:55 -0300 Subject: [PATCH 2/4] restore original file --- src/GuPaymentTrait.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/GuPaymentTrait.php b/src/GuPaymentTrait.php index accdec7..a93c6f5 100644 --- a/src/GuPaymentTrait.php +++ b/src/GuPaymentTrait.php @@ -92,19 +92,6 @@ public function defaultCard() return $customer->default_payment_method(); } - - /** - * Set customer's default card. - * - * @param String $paymentMethodId - * @return void - */ - public function setDefaultCard($paymentMethodId) - { - $customer = $this->asIuguCustomer(); - $customer['default_payment_method_id'] = $paymentMethodId; - $customer->save(); - } /** * Get a collection of the entity's cards. From 0efca4dc64ae3e817e1387140a51ef8e34178d2a Mon Sep 17 00:00:00 2001 From: Guilherme-Franca-de-Souza Date: Mon, 22 Apr 2024 19:53:56 -0300 Subject: [PATCH 3/4] Adiciona parametro no metodo resume() --- src/GuSubscriptionTrait.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/GuSubscriptionTrait.php b/src/GuSubscriptionTrait.php index 5fc1400..ff8c092 100644 --- a/src/GuSubscriptionTrait.php +++ b/src/GuSubscriptionTrait.php @@ -203,20 +203,23 @@ public function markAsCancelled() /** * Resume the cancelled subscription. * + * @param bool $ignoreChargeResult * @return $this * * @throws \LogicException */ - public function resume() + public function resume($ignoreChargeResult = false) { $subscription = $this->asIuguSubscription(); $subscription->activate(); - // Finally, we will remove the ending timestamp from the user's record in the - // local database to indicate that the subscription is active again and is - // no longer "cancelled". Then we will save this record in the database. - $this->fill(['ends_at' => null])->save(); + if ($ignoreChargeResult) { + // Finally, we will remove the ending timestamp from the user's record in the + // local database to indicate that the subscription is active again and is + // no longer "cancelled". Then we will save this record in the database. + $this->fill(['ends_at' => null])->save(); + } return $this; } From 6fc7729d4cc9016c5765bf9fb44a3ef9dd47fa2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Oliveira?= Date: Fri, 26 Apr 2024 15:59:13 -0300 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20$ignoreChargeResult=20tem=20valor=20?= =?UTF-8?q?true=20por=20padr=C3=A3o=20para=20manter=20o=20suporte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GuSubscriptionTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GuSubscriptionTrait.php b/src/GuSubscriptionTrait.php index ff8c092..ee1568f 100644 --- a/src/GuSubscriptionTrait.php +++ b/src/GuSubscriptionTrait.php @@ -208,7 +208,7 @@ public function markAsCancelled() * * @throws \LogicException */ - public function resume($ignoreChargeResult = false) + public function resume($ignoreChargeResult = true) { $subscription = $this->asIuguSubscription();