diff --git a/src/Paymongo.php b/src/Paymongo.php index f313205..cb96fee 100644 --- a/src/Paymongo.php +++ b/src/Paymongo.php @@ -2,17 +2,17 @@ namespace Luigel\Paymongo; -use Luigel\Paymongo\Models\Link; -use Luigel\Paymongo\Models\Refund; -use Luigel\Paymongo\Models\Source; -use Luigel\Paymongo\Models\Payment; -use Luigel\Paymongo\Models\Webhook; -use Luigel\Paymongo\Traits\Request; use Luigel\Paymongo\Models\Checkout; use Luigel\Paymongo\Models\Customer; +use Luigel\Paymongo\Models\Link; +use Luigel\Paymongo\Models\Payment; use Luigel\Paymongo\Models\PaymentIntent; use Luigel\Paymongo\Models\PaymentMethod; +use Luigel\Paymongo\Models\Refund; +use Luigel\Paymongo\Models\Source; +use Luigel\Paymongo\Models\Webhook; use Luigel\Paymongo\Traits\HasToggleWebhook; +use Luigel\Paymongo\Traits\Request; class Paymongo { diff --git a/src/Traits/Request.php b/src/Traits/Request.php index d48d40c..03beecc 100644 --- a/src/Traits/Request.php +++ b/src/Traits/Request.php @@ -4,19 +4,19 @@ use Exception; use GuzzleHttp\Client; -use Luigel\Paymongo\Models\Link; -use Illuminate\Support\Collection; -use Luigel\Paymongo\Models\Webhook; -use Luigel\Paymongo\Models\Checkout; -use Luigel\Paymongo\Models\Customer; -use Luigel\Paymongo\Models\BaseModel; use GuzzleHttp\Exception\ClientException; -use Luigel\Paymongo\Models\PaymentIntent; -use Luigel\Paymongo\Exceptions\NotFoundException; +use Illuminate\Support\Collection; +use Luigel\Paymongo\Exceptions\AmountTypeNotSupportedException; use Luigel\Paymongo\Exceptions\BadRequestException; +use Luigel\Paymongo\Exceptions\NotFoundException; use Luigel\Paymongo\Exceptions\PaymentErrorException; use Luigel\Paymongo\Exceptions\UnauthorizedException; -use Luigel\Paymongo\Exceptions\AmountTypeNotSupportedException; +use Luigel\Paymongo\Models\BaseModel; +use Luigel\Paymongo\Models\Checkout; +use Luigel\Paymongo\Models\Customer; +use Luigel\Paymongo\Models\Link; +use Luigel\Paymongo\Models\PaymentIntent; +use Luigel\Paymongo\Models\Webhook; trait Request { @@ -239,10 +239,8 @@ public function getPaymentMethods(Customer $customer) return $this->request(); } - /** - * - */ - public function expireCheckout(Checkout $checkout) { + public function expireCheckout(Checkout $checkout) + { $this->method = 'POST'; $this->apiUrl = $this->apiUrl.$checkout->id.'/expire'; @@ -252,7 +250,7 @@ public function expireCheckout(Checkout $checkout) { ], 'auth' => [config('paymongo.secret_key'), ''], ]); - + return $this->request(); } diff --git a/tests/PaymentTest.php b/tests/PaymentTest.php index f3e34a5..648ac10 100644 --- a/tests/PaymentTest.php +++ b/tests/PaymentTest.php @@ -36,4 +36,4 @@ ->currency->toBe('PHP') ->statement_descriptor->toBe('LUIGEL STORE') ->status->toBe('paid'); -}); \ No newline at end of file +}); diff --git a/tests/Pest.php b/tests/Pest.php index a887100..2bdad12 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -1,17 +1,17 @@ in(__DIR__); @@ -177,11 +177,11 @@ function createCheckout(): Checkout 'currency' => 'PHP', 'description' => 'Something of a product.', 'images' => [ - 'https://images.unsplash.com/photo-1613243555988-441166d4d6fd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80' + 'https://images.unsplash.com/photo-1613243555988-441166d4d6fd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80', ], 'name' => 'A payment card', - 'quantity' => 1 - ] + 'quantity' => 1, + ], ], 'payment_method_types' => [ 'atome', @@ -190,14 +190,14 @@ function createCheckout(): Checkout 'dob', 'dob_ubp', 'gcash', - 'grab_pay', - 'paymaya' + 'grab_pay', + 'paymaya', ], 'success_url' => 'https://paymongo.rigelkentcarbonel.com/', 'statement_descriptor' => 'Laravel Paymongo Library', 'metadata' => [ - 'Key' => 'Value' - ] + 'Key' => 'Value', + ], ]); }