diff --git a/src/Subscription.php b/src/Subscription.php index 7930248..0e5bb8a 100644 --- a/src/Subscription.php +++ b/src/Subscription.php @@ -665,6 +665,16 @@ public function paddleEmail() return (string) $this->paddleInfo()['user_email']; } + /** + * Get the payment method type from the subscription. + * + * @return string + */ + public function paymentMethod() + { + return (string) $this->paddleInfo()['payment_information']['payment_method']; + } + /** * Get the card brand from the subscription. * diff --git a/tests/Feature/SubscriptionsTest.php b/tests/Feature/SubscriptionsTest.php index e06f713..0825dce 100644 --- a/tests/Feature/SubscriptionsTest.php +++ b/tests/Feature/SubscriptionsTest.php @@ -199,6 +199,7 @@ public function test_subscriptions_can_retrieve_their_payment_info() ]); $this->assertSame('john@example.com', $subscription->paddleEmail()); + $this->assertSame('card', $subscription->paymentMethod()); $this->assertSame('master', $subscription->cardBrand()); $this->assertSame('4050', $subscription->cardLastFour()); }