Skip to content

Commit a9a407d

Browse files
committed
changed htran generation method
1 parent f0165de commit a9a407d

File tree

11 files changed

+206
-496
lines changed

11 files changed

+206
-496
lines changed

config/wallet.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
*/
1515

1616
'mode' => env('WALLET_MODE', 'production'),
17-
1817
'asanpardakht' => [
1918
'debug' => true,
20-
'host_id' => '',
21-
'url' => '',
22-
'private_key' => '',
23-
]
24-
19+
'host_id' => env('ASANPARDAKHT_WALLET_HOST_ID'),
20+
'url' => env(
21+
'ASANPARDAKHT_WALLET_URL',
22+
'https://thirdparty.dev.tasn.ir/exts/v1/'
23+
).env('ASANPARDAKHT_WALLET_HOST_ID').'/1',
24+
],
2525
];

src/Contracts/Factory.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
interface Factory
66
{
7-
8-
// /**
9-
// * @param $driver
10-
// * @return mixed
11-
// */
12-
// public function driver($driver = null): mixed;
7+
// /**
8+
// * @param $driver
9+
// * @return mixed
10+
// */
11+
// public function driver($driver = null): mixed;
1312
}

src/Contracts/Provider.php

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,88 +6,42 @@ interface Provider
66
{
77
/**
88
* Determines whether the provider supports reverse transaction
9-
*
10-
* @return bool
119
*/
1210
public function refundSupport(): bool;
1311

1412
/**
15-
* @param array $parameters operation parameters
16-
*
17-
* @return Provider
13+
* @param array $parameters operation parameters
1814
*/
1915
public function setParameters(array $parameters = []): Provider;
2016

2117
/**
22-
* @param string|null $key
23-
*
24-
* @param null $default
25-
*
26-
* @return mixed
18+
* @param null $default
2719
*/
2820
public function getParameters(string $key = null, $default = null): mixed;
2921

3022
/**
3123
* return rendered goto gate form
32-
*
33-
* @return string
3424
*/
3525
public function getForm(): string;
3626

37-
38-
/**
39-
* @return array
40-
*/
4127
public function getFormParameters(): array;
4228

43-
44-
/**
45-
* @return Transaction
46-
*/
4729
public function getTransaction(): Transaction;
4830

4931
/**
5032
* verify transaction
51-
*
52-
* @return bool
5333
*/
5434
public function verifyTransaction(): bool;
5535

56-
57-
/**
58-
* @return bool
59-
*/
6036
public function settleTransaction(): bool;
6137

62-
63-
/**
64-
* @return bool
65-
*/
6638
public function refundTransaction(): bool;
6739

68-
69-
/**
70-
* @return string
71-
*/
7240
public function getGatewayReferenceId(): string;
7341

74-
75-
/**
76-
* @param string $action
77-
* @return string
78-
*/
7942
public function getUrlFor(string $action): string;
8043

81-
82-
/**
83-
* @return bool
84-
*/
8544
public function canContinueWithCallbackParameters(): bool;
8645

87-
88-
/**
89-
* @param array $parameters
90-
* @return void
91-
*/
9246
public function checkRequiredActionParameters(array $parameters): void;
9347
}

src/Contracts/Transaction.php

Lines changed: 2 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,12 @@ interface Transaction
66
{
77
/**
88
* return the callback url of the transaction process
9-
*
10-
* @return string
119
*/
1210
public function getCallbackUrl(): string;
1311

1412
/**
1513
* set gateway token of transaction
1614
*
17-
* @param string $token
18-
* @param bool $save
1915
*
2016
* @return mixed
2117
*/
@@ -24,105 +20,38 @@ public function setGatewayToken(string $token, bool $save = true): bool;
2420
/**
2521
* set reference ID of transaction
2622
*
27-
* @param string $referenceId
28-
* @param bool $save
2923
*
3024
* @return mixed
3125
*/
3226
public function setReferenceId(string $referenceId, bool $save = true): bool;
3327

34-
35-
/**
36-
* @return int
37-
*/
3828
public function getGatewayOrderId(): int;
3929

40-
41-
/**
42-
* @return bool
43-
*/
4430
public function isReadyForTokenRequest(): bool;
4531

46-
47-
/**
48-
* @return bool
49-
*/
5032
public function isReadyForVerify(): bool;
5133

52-
53-
/**
54-
* @return bool
55-
*/
5634
public function isReadyForInquiry(): bool;
5735

58-
59-
/**
60-
* @return bool
61-
*/
6236
public function isReadyForSettle(): bool;
6337

64-
65-
/**
66-
* @return bool
67-
*/
6838
public function isReadyForRefund(): bool;
6939

70-
71-
/**
72-
* @param bool $save
73-
* @return bool
74-
*/
7540
public function setVerified(bool $save = true): bool;
7641

77-
78-
/**
79-
* @param bool $save
80-
* @return bool
81-
*/
8242
public function setSettled(bool $save = true): bool;
8343

84-
85-
/**
86-
* @param bool $save
87-
* @return bool
88-
*/
8944
public function setAccomplished(bool $save = true): bool;
9045

91-
92-
/**
93-
* @param bool $save
94-
* @return bool
95-
*/
9646
public function setRefunded(bool $save = true): bool;
9747

98-
99-
/**
100-
* @return int
101-
*/
10248
public function getPayableAmount(): int;
10349

104-
105-
/**
106-
* @param string $cardNumber
107-
* @param bool $save
108-
* @return bool
109-
*/
11050
public function setCardNumber(string $cardNumber, bool $save = false): bool;
11151

112-
113-
/**
114-
* @param array $parameters
115-
* @param bool $save
116-
* @return bool
117-
*/
11852
public function setCallBackParameters(array $parameters, bool $save = true): bool;
11953

120-
121-
/**
122-
* @param string $key
123-
* @param $value
124-
* @param bool $save
125-
* @return bool
126-
*/
12754
public function addExtra(string $key, $value, bool $save = true): bool;
55+
56+
public function getWalletTransactionId(): int;
12857
}

src/Enums/AsanpardakhtStatusEnum.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace PhpMonsters\LaraWallet\Enums;
44

5-
/**
6-
*
7-
*/
85
enum AsanpardakhtStatusEnum: int
96
{
107
//----------------------generate by Asanpardakht-------------------
@@ -31,7 +28,6 @@ enum AsanpardakhtStatusEnum: int
3128
case SettleRequestHop = 2002;
3229
case RefundRequestHop = 2003;
3330

34-
3531
//----------------------generate by code-------------------
3632
case SuccessResponse = 10001;
3733
case AccessDeniedResponse = 10000;

src/Exception.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace PhpMonsters\LaraWallet;
44

5-
/**
6-
*
7-
*/
85
class Exception extends \Exception
96
{
107
}

src/Facades/LaraWallet.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@
66
use PhpMonsters\LaraWallet\Contracts\Factory;
77

88
/**
9-
*
109
* @method static log(string $message, array $params, string $level)
1110
*/
1211
class LaraWallet extends Facade
1312
{
14-
/**
15-
* @return string
16-
*/
1713
public static function getFacadeAccessor(): string
1814
{
1915
return Factory::class;
2016
}
21-
2217
}

src/LaraWalletServiceProvider.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@
55
use Illuminate\Support\ServiceProvider;
66
use PhpMonsters\LaraWallet\Contracts\Factory;
77

8-
/**
9-
*
10-
*/
118
class LaraWalletServiceProvider extends ServiceProvider
129
{
1310
/**
1411
* Register services.
15-
*
16-
* @return void
1712
*/
1813
public function register(): void
1914
{
@@ -24,21 +19,16 @@ public function register(): void
2419

2520
/**
2621
* Bootstrap services.
27-
*
28-
* @return void
2922
*/
3023
public function boot(): void
3124
{
3225
$this->registerPublishing();
3326
}
3427

35-
/**
36-
* @return void
37-
*/
3828
protected function registerPublishing(): void
3929
{
4030
$this->publishes([
41-
__DIR__ . '/../config/wallet.php' => config_path('wallet.php')
31+
__DIR__.'/../config/wallet.php' => config_path('wallet.php'),
4232
], 'config');
4333
}
4434
}

0 commit comments

Comments
 (0)