Skip to content

Apply fixes from StyleCI #93

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

Merged
merged 1 commit into from
May 22, 2023
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
12 changes: 6 additions & 6 deletions src/Paymongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
26 changes: 12 additions & 14 deletions src/Traits/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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';

Expand All @@ -252,7 +250,7 @@ public function expireCheckout(Checkout $checkout) {
],
'auth' => [config('paymongo.secret_key'), ''],
]);

return $this->request();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
->currency->toBe('PHP')
->statement_descriptor->toBe('LUIGEL STORE')
->status->toBe('paid');
});
});
28 changes: 14 additions & 14 deletions tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

use Illuminate\Support\Str;
use Luigel\Paymongo\Models\Link;
use Luigel\Paymongo\Models\Token;
use Luigel\Paymongo\Models\Source;
use Luigel\Paymongo\Models\Payment;
use Luigel\Paymongo\Traits\Request;
use Luigel\Paymongo\Facades\Paymongo;
use Luigel\Paymongo\Models\Checkout;
use Luigel\Paymongo\Models\Customer;
use Luigel\Paymongo\Facades\Paymongo;
use Luigel\Paymongo\Tests\BaseTestCase;
use Luigel\Paymongo\Models\Link;
use Luigel\Paymongo\Models\Payment;
use Luigel\Paymongo\Models\PaymentIntent;
use Luigel\Paymongo\Models\PaymentMethod;
use Luigel\Paymongo\Models\Source;
use Luigel\Paymongo\Models\Token;
use Luigel\Paymongo\Tests\BaseTestCase;
use Luigel\Paymongo\Traits\Request;

uses(BaseTestCase::class, Request::class)
->in(__DIR__);
Expand Down Expand Up @@ -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',
Expand All @@ -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',
],
]);
}

Expand Down