FLUX-SE / PayumStripe

Payum Stripe gateways (with SCA support)
MIT License
28 stars 15 forks source link

payment_method_types #13

Closed alexdpunkt closed 3 years ago

alexdpunkt commented 3 years ago

allow payment_method_types to be passed via details

Prometee commented 3 years ago

Hello @alexdpunkt !

I was thinking of doing this test for all of those 3 offsetSet at the beginning but I never get back to this piece of code. What do you think about adding :

if (false === $details-> offsetExists('...')) {
    $details-> offsetSet('...', '...');
}

Also are you able to fix the build, here is what you need to do to fix it :

    ---------- begin diff ----------
--- Original
+++ New
@@ -30,8 +30,8 @@
                 'quantity' => 1,
             ],
         ]);
-        
-        if ($details->offsetGet('payment_method_types') === null) {
+
+        if (null === $details->offsetGet('payment_method_types')) {
             $details->offsetSet('payment_method_types', ['card']);
         }
    ----------- end diff -----------

But you can also launch the following command :

vendor/bin/ecs check . --fix
alexdpunkt commented 3 years ago

@Prometee fixed it, but the builds are still failing.

Prometee commented 3 years ago

@alexdpunkt it seems there is remaining spaces before the if line :

    ---------- begin diff ----------
--- Original
+++ New
@@ -30,7 +30,7 @@
                 'quantity' => 1,
             ],
         ]);
-        
+
         if (false === $details->offsetExists('payment_method_types')) {
             $details->offsetSet('payment_method_types', ['card']);
         }
    ----------- end diff -----------
Prometee commented 3 years ago

@alexdpunkt helped you 😉

codecov[bot] commented 3 years ago

Codecov Report

Merging #13 (6a48152) into master (2a73098) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #13   +/-   ##
=========================================
  Coverage     99.80%   99.80%           
- Complexity      335      336    +1     
=========================================
  Files            88       88           
  Lines          1033     1033           
=========================================
  Hits           1031     1031           
  Misses            2        2           
Impacted Files Coverage Δ Complexity Δ
...ion/StripeCheckoutSession/ConvertPaymentAction.php 100.00% <100.00%> (ø) 6.00 <0.00> (+1.00)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2a73098...6a48152. Read the comment docs.

Prometee commented 3 years ago

Thanks you @alexdpunkt 🎉 !