Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
abr4xas authored and actions-user committed Mar 31, 2022
1 parent 1400733 commit 6ba1615
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.1.3","version":"3.7.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Services\/PayPalService.php":3052633147,"src\/Services\/StripeService.php":762555388,"src\/Services\/MercadoPagoService.php":3565754904,"src\/Facades\/PaymentProcessors.php":2030686091,"src\/PaymentProcessors.php":650133746,"src\/PaymentProcessorsServiceProvider.php":2373882181,"src\/Traits\/ConsumeExternalServices.php":2443817825,"tests\/Unit\/PayPalTest.php":815208030,"tests\/Unit\/MercadoPagoTest.php":98170131,"tests\/Unit\/StripeTest.php":3225832617,"tests\/TestCase.php":2231807821,"tests\/Pest.php":430967840}}
2 changes: 1 addition & 1 deletion src/Services/MercadoPagoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function resolveAuthorization(array &$queryParams, array &$formParams, ar
$headers['Content-Type'] = 'application/json';
$headers['Accept'] = 'application/json';

if (!empty($this->integratorId)) {
if (! empty($this->integratorId)) {
$headers['integrator_id'] = $this->integratorId;
}
}
Expand Down
23 changes: 10 additions & 13 deletions tests/Unit/MercadoPagoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
});

test('can resolve access token', function () {

$params = [
'base_uri' => 'https://api.mercadopago.com',
'key' => 'TEST-529cf55e-ccfa-4422-82f2-42f48528ae99',
Expand All @@ -31,7 +30,6 @@


test('can return array of payment methods', function () {

$params = [
'base_uri' => 'https://api.mercadopago.com',
'key' => 'TEST-529cf55e-ccfa-4422-82f2-42f48528ae99',
Expand All @@ -48,7 +46,6 @@


test('can create a preference', function () {

$params = [
'base_uri' => 'https://api.mercadopago.com',
'key' => 'TEST-529cf55e-ccfa-4422-82f2-42f48528ae99',
Expand All @@ -67,29 +64,29 @@
"category_id" => "cat123",
"quantity" => 1,
"currency_id" => "UYU",
"unit_price" => 10
]
"unit_price" => 10,
],
],
'payer' => [
'name' => 'John',
'surname' => 'Doe',
'email' => 'john.doe@domain.tld',
'identification' => [
'type' => '',
'number' => ''
'number' => '',
],
'date_created' => ''
'date_created' => '',
],
'payment_methods' => [
'excluded_payment_methods' => [
[
'id' => 'amex'
]
'id' => 'amex',
],
],
'excluded_payment_types' => [
[
'id' => 'atm'
]
'id' => 'atm',
],
],
'installments' => 6,
],
Expand All @@ -98,8 +95,8 @@
'back_urls' => [
'success' => 'http://project.dev/success_route',
'failure' => 'http://project.dev/error_route',
'pending' => 'http://project.dev/waiting_route'
]
'pending' => 'http://project.dev/waiting_route',
],
];

$preference = $mercadopago->createPreference($preference);
Expand Down
5 changes: 0 additions & 5 deletions tests/Unit/PayPalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

use Tepuilabs\PaymentProcessors\Facades\PaymentProcessors;


beforeEach(function () {

$this->params = [
'base_uri' => 'https://api.sandbox.paypal.com',
'client_id' => 'ARt435S0DIjl2rljuro1TIOQkeKvNSykbp34DBZIQBUxwqccrMZavTE0r-v7QDFtNQcMU-5SIwBf7B-n',
Expand All @@ -16,7 +14,6 @@


test('it can resolve paypal service', function () {

$mercadopago = PaymentProcessors::resolveService('paypal', $this->params);

$this->assertInstanceOf(\Tepuilabs\PaymentProcessors\Services\PayPalService::class, $mercadopago);
Expand All @@ -33,8 +30,6 @@


test('it can handle redirect to paypal', function () {


$paypal = PaymentProcessors::resolveService('paypal', $this->params);

$payment = $paypal->handlePayment(200);
Expand Down
9 changes: 1 addition & 8 deletions tests/Unit/StripeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

use Tepuilabs\PaymentProcessors\Facades\PaymentProcessors;


beforeEach(function () {

$this->params = [
'key' => 'pk_test_51IMzM0JcoyM5FfOypXlbYcOcg9EsrAwfhLikFrK436CqIGIRxysFz1G45NtJJik4NCVAje8xUddeeD0KjVeNe5Rf00JyWoyvEi',
'secret' => 'sk_test_51IMzM0JcoyM5FfOyoV47UeCAMpHFvkrPOrVRM0B83tE6NEffMlLJCuX09jh6Gv6nXKwx5pR3nWaBp5z4TPP08zIY00z3CLwJJw',
Expand All @@ -13,15 +11,13 @@


test('it can resolve stripe service', function () {

$stripe = PaymentProcessors::resolveService('stripe', $this->params);

$this->assertInstanceOf(\Tepuilabs\PaymentProcessors\Services\StripeService::class, $stripe);
});


test('it can get stripe balance', function () {

$stripe = PaymentProcessors::resolveService('stripe', $this->params);

$balance = $stripe->makeRequest('GET', '/v1/balance');
Expand All @@ -30,7 +26,6 @@
});

test('it can generate a stripe payment method id', function () {

$stripe = PaymentProcessors::resolveService('stripe', $this->params);

// only for test
Expand All @@ -52,7 +47,6 @@
});

test('it can handle a stripe payment', function ($paymentMethodId) {

$stripe = PaymentProcessors::resolveService('stripe', $this->params);

$paymentData = [
Expand All @@ -67,8 +61,7 @@
return $intent;
})->depends('it can generate a stripe payment method id');

test('it can confirm stripe payment', function($intent) {

test('it can confirm stripe payment', function ($intent) {
$stripe = PaymentProcessors::resolveService('stripe', $this->params);

$confirm = $stripe->confirmPayment($intent['id']);
Expand Down

0 comments on commit 6ba1615

Please sign in to comment.