0nepeop1e 4 anni fa
parent
commit
99daa0ff8a
5 ha cambiato i file con 102 aggiunte e 47 eliminazioni
  1. 12
    0
      .idea/laravel-payment-dummy.iml
  2. 34
    22
      .idea/php.xml
  3. 43
    22
      .idea/workspace.xml
  4. 1
    1
      composer.json
  5. 12
    2
      src/DummyPayDriver.php

+ 12
- 0
.idea/laravel-payment-dummy.iml Vedi File

@@ -7,14 +7,19 @@
7 7
       <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
8 8
       <excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
9 9
       <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
10
+      <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/collections" />
10 11
       <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/contracts" />
11 12
       <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/filesystem" />
12 13
       <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/http" />
14
+      <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/macroable" />
13 15
       <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/session" />
14 16
       <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/support" />
15 17
       <excludeFolder url="file://$MODULE_DIR$/vendor/mirfalah/laravel-payment" />
16 18
       <excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
17 19
       <excludeFolder url="file://$MODULE_DIR$/vendor/paragonie/random_compat" />
20
+      <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
21
+      <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
22
+      <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
18 23
       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
19 24
       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
20 25
       <excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
@@ -24,10 +29,12 @@
24 29
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
25 30
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
26 31
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
32
+      <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-client-contracts" />
27 33
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
28 34
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" />
29 35
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
30 36
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
37
+      <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
31 38
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
32 39
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
33 40
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
@@ -35,10 +42,15 @@
35 42
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
36 43
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php73" />
37 44
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
45
+      <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/property-access" />
46
+      <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/property-info" />
47
+      <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/serializer" />
48
+      <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
38 49
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
39 50
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
40 51
       <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" />
41 52
       <excludeFolder url="file://$MODULE_DIR$/vendor/voku/portable-ascii" />
53
+      <excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
42 54
     </content>
43 55
     <orderEntry type="inheritedJdk" />
44 56
     <orderEntry type="sourceFolder" forTests="false" />

+ 34
- 22
.idea/php.xml Vedi File

@@ -2,40 +2,52 @@
2 2
 <project version="4">
3 3
   <component name="PhpIncludePathManager">
4 4
     <include_path>
5
-      <path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
6
-      <path value="$PROJECT_DIR$/vendor/mirfalah/laravel-payment" />
7
-      <path value="$PROJECT_DIR$/vendor/psr/log" />
8 5
       <path value="$PROJECT_DIR$/vendor/psr/container" />
9 6
       <path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
10 7
       <path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
11
-      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
12
-      <path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
13
-      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
14
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
15
-      <path value="$PROJECT_DIR$/vendor/symfony/translation" />
16
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
17
-      <path value="$PROJECT_DIR$/vendor/symfony/mime" />
8
+      <path value="$PROJECT_DIR$/vendor/psr/log" />
18 9
       <path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
19
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
20
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
21
-      <path value="$PROJECT_DIR$/vendor/composer" />
22
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
23 10
       <path value="$PROJECT_DIR$/vendor/voku/portable-ascii" />
24
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
11
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
12
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
25 13
       <path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
26
-      <path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
27
-      <path value="$PROJECT_DIR$/vendor/symfony/finder" />
28
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php70" />
29
-      <path value="$PROJECT_DIR$/vendor/illuminate/http" />
14
+      <path value="$PROJECT_DIR$/vendor/symfony/string" />
15
+      <path value="$PROJECT_DIR$/vendor/symfony/serializer" />
30 16
       <path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
17
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
18
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
19
+      <path value="$PROJECT_DIR$/vendor/symfony/mime" />
20
+      <path value="$PROJECT_DIR$/vendor/symfony/http-client-contracts" />
21
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
22
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
23
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php70" />
24
+      <path value="$PROJECT_DIR$/vendor/symfony/finder" />
25
+      <path value="$PROJECT_DIR$/vendor/symfony/property-access" />
26
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
27
+      <path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
28
+      <path value="$PROJECT_DIR$/vendor/symfony/property-info" />
29
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
30
+      <path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
31
+      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
32
+      <path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
33
+      <path value="$PROJECT_DIR$/vendor/symfony/translation" />
31 34
       <path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
35
+      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
36
+      <path value="$PROJECT_DIR$/vendor/mirfalah/laravel-payment" />
37
+      <path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
38
+      <path value="$PROJECT_DIR$/vendor/webmozart/assert" />
39
+      <path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
40
+      <path value="$PROJECT_DIR$/vendor/illuminate/macroable" />
41
+      <path value="$PROJECT_DIR$/vendor/illuminate/http" />
32 42
       <path value="$PROJECT_DIR$/vendor/illuminate/filesystem" />
33
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
34 43
       <path value="$PROJECT_DIR$/vendor/illuminate/support" />
35 44
       <path value="$PROJECT_DIR$/vendor/illuminate/session" />
36
-      <path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
37 45
       <path value="$PROJECT_DIR$/vendor/illuminate/contracts" />
38
-      <path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
46
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
47
+      <path value="$PROJECT_DIR$/vendor/illuminate/collections" />
48
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
49
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
50
+      <path value="$PROJECT_DIR$/vendor/composer" />
39 51
     </include_path>
40 52
   </component>
41 53
   <component name="PhpProjectSharedConfiguration" php_language_level="7.1" />

+ 43
- 22
.idea/workspace.xml Vedi File

@@ -20,7 +20,10 @@
20 20
   </component>
21 21
   <component name="ChangeListManager">
22 22
     <list default="true" id="d34cafd0-eade-4b43-97b9-dd7f3a1eae86" name="Default Changelist" comment="">
23
+      <change beforePath="$PROJECT_DIR$/.idea/laravel-payment-dummy.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/laravel-payment-dummy.iml" afterDir="false" />
24
+      <change beforePath="$PROJECT_DIR$/.idea/php.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/php.xml" afterDir="false" />
23 25
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
26
+      <change beforePath="$PROJECT_DIR$/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/composer.json" afterDir="false" />
24 27
       <change beforePath="$PROJECT_DIR$/src/DummyPayDriver.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/DummyPayDriver.php" afterDir="false" />
25 28
     </list>
26 29
     <option name="SHOW_DIALOG" value="false" />
@@ -39,40 +42,52 @@
39 42
   </component>
40 43
   <component name="PhpWorkspaceProjectConfiguration">
41 44
     <include_path>
42
-      <path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
43
-      <path value="$PROJECT_DIR$/vendor/mirfalah/laravel-payment" />
44
-      <path value="$PROJECT_DIR$/vendor/psr/log" />
45 45
       <path value="$PROJECT_DIR$/vendor/psr/container" />
46 46
       <path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
47 47
       <path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
48
-      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
49
-      <path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
50
-      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
51
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
52
-      <path value="$PROJECT_DIR$/vendor/symfony/translation" />
53
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
54
-      <path value="$PROJECT_DIR$/vendor/symfony/mime" />
48
+      <path value="$PROJECT_DIR$/vendor/psr/log" />
55 49
       <path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
56
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
57
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
58
-      <path value="$PROJECT_DIR$/vendor/composer" />
59
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
60 50
       <path value="$PROJECT_DIR$/vendor/voku/portable-ascii" />
61
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
51
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
52
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
62 53
       <path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
63
-      <path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
64
-      <path value="$PROJECT_DIR$/vendor/symfony/finder" />
65
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php70" />
66
-      <path value="$PROJECT_DIR$/vendor/illuminate/http" />
54
+      <path value="$PROJECT_DIR$/vendor/symfony/string" />
55
+      <path value="$PROJECT_DIR$/vendor/symfony/serializer" />
67 56
       <path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
57
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php73" />
58
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
59
+      <path value="$PROJECT_DIR$/vendor/symfony/mime" />
60
+      <path value="$PROJECT_DIR$/vendor/symfony/http-client-contracts" />
61
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
62
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
63
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php70" />
64
+      <path value="$PROJECT_DIR$/vendor/symfony/finder" />
65
+      <path value="$PROJECT_DIR$/vendor/symfony/property-access" />
66
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
67
+      <path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
68
+      <path value="$PROJECT_DIR$/vendor/symfony/property-info" />
69
+      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
70
+      <path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
71
+      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
72
+      <path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
73
+      <path value="$PROJECT_DIR$/vendor/symfony/translation" />
68 74
       <path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
75
+      <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
76
+      <path value="$PROJECT_DIR$/vendor/mirfalah/laravel-payment" />
77
+      <path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
78
+      <path value="$PROJECT_DIR$/vendor/webmozart/assert" />
79
+      <path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
80
+      <path value="$PROJECT_DIR$/vendor/illuminate/macroable" />
81
+      <path value="$PROJECT_DIR$/vendor/illuminate/http" />
69 82
       <path value="$PROJECT_DIR$/vendor/illuminate/filesystem" />
70
-      <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
71 83
       <path value="$PROJECT_DIR$/vendor/illuminate/support" />
72 84
       <path value="$PROJECT_DIR$/vendor/illuminate/session" />
73
-      <path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
74 85
       <path value="$PROJECT_DIR$/vendor/illuminate/contracts" />
75
-      <path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
86
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
87
+      <path value="$PROJECT_DIR$/vendor/illuminate/collections" />
88
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
89
+      <path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
90
+      <path value="$PROJECT_DIR$/vendor/composer" />
76 91
     </include_path>
77 92
   </component>
78 93
   <component name="ProjectId" id="1htW5VaFbIHUzp9eSpkWJUVlqhl" />
@@ -85,6 +100,7 @@
85 100
     <property name="WebServerToolWindowFactoryState" value="false" />
86 101
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
87 102
     <property name="nodejs_package_manager_path" value="npm" />
103
+    <property name="php.override.implement.member.chooser.php.doc" value="NONE" />
88 104
     <property name="vue.rearranger.settings.migration" value="true" />
89 105
   </component>
90 106
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
@@ -98,6 +114,7 @@
98 114
       <workItem from="1600830687029" duration="3217000" />
99 115
       <workItem from="1600835177454" duration="172000" />
100 116
       <workItem from="1600835569280" duration="44000" />
117
+      <workItem from="1601966890356" duration="4888000" />
101 118
     </task>
102 119
     <servers />
103 120
   </component>
@@ -121,5 +138,9 @@
121 138
       <screen x="0" y="32" width="1920" height="1048" />
122 139
     </state>
123 140
     <state x="717" y="383" width="475" height="391" key="#Composer/0.32.1920.1048@0.32.1920.1048" timestamp="1600831395575" />
141
+    <state x="1080" y="227" width="389" height="624" key="#com.intellij.ide.util.MemberChooser" timestamp="1601971187393">
142
+      <screen x="0" y="30" width="2560" height="1020" />
143
+    </state>
144
+    <state x="1080" y="227" width="389" height="624" key="#com.intellij.ide.util.MemberChooser/0.30.2560.1020@0.30.2560.1020" timestamp="1601971187393" />
124 145
   </component>
125 146
 </project>

+ 1
- 1
composer.json Vedi File

@@ -7,7 +7,7 @@
7 7
     "readme": "README.md",
8 8
     "require": {
9 9
         "php": ">=7.1",
10
-        "mirfalah/laravel-payment": "^1.0"
10
+        "mirfalah/laravel-payment": "^2.0"
11 11
     },
12 12
     "license": "Mirfalah-Tech",
13 13
     "authors": [

+ 12
- 2
src/DummyPayDriver.php Vedi File

@@ -8,10 +8,14 @@ use Illuminate\Http\Request;
8 8
 use Illuminate\Support\Facades\Response as Res;
9 9
 use MirfalahTech\Laravel\Payment\Contracts\PayableEntity;
10 10
 use MirfalahTech\Laravel\Payment\Contracts\PaymentGatewayDriver;
11
+use MirfalahTech\Laravel\Payment\Facade\Payment;
12
+use MirfalahTech\Laravel\Payment\Traits\BillStatusBoolean;
11 13
 use Symfony\Component\HttpFoundation\Response;
12 14
 
13 15
 class DummyPayDriver implements PaymentGatewayDriver
14 16
 {
17
+    use BillStatusBoolean;
18
+
15 19
     /**
16 20
      * @var string
17 21
      */
@@ -43,7 +47,7 @@ class DummyPayDriver implements PaymentGatewayDriver
43 47
         $order_id = $request->query->get('order_id');
44 48
         if($request->query->has('status')){
45 49
             $response = Res::redirectTo($this->return_url.'?'.http_build_query(['order_id' => $order_id, 'status' => 'success']));
46
-            return $request->query->get('status') == 'success';
50
+            return true;
47 51
         } else {
48 52
             /** @noinspection HtmlUnknownTarget */
49 53
             $html = sprintf(
@@ -56,7 +60,13 @@ class DummyPayDriver implements PaymentGatewayDriver
56 60
         }
57 61
     }
58 62
 
59
-    public function getBillIdFromRequest(Request $request){
63
+    public function getBillIdFromRequest(Request $request): ?string{
60 64
         return $request->query->get('order_id');
61 65
     }
66
+
67
+    public function getBillStatus(Request $request): ?int
68
+    {
69
+        return $request->query->get('status') == 'success' ?
70
+            Payment::SUCCESS : Payment::FAILED;
71
+    }
62 72
 }

Loading…
Annulla
Salva