mirror of
https://github.com/bitinflow/accounts.git
synced 2026-11-01 05:09:07 +00:00
Refactoring
This commit is contained in:
1 parent
7ba3cdffb0
commit
a2405875ad
26 files changed
+569
-391
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Bitinflow\Payments\Traits;
|
||||
|
||||
use Bitinflow\Payments\Result;
|
||||
use Bitinflow\Payments\BitinflowPayments;
|
||||
|
||||
trait Wallets
|
||||
{
|
||||
/**
|
||||
* Get all wallets that belong to the user.
|
||||
*/
|
||||
public function getWallets(): Result
|
||||
{
|
||||
return $this->query('GET', 'wallets');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set default wallet to given wallet token.
|
||||
*
|
||||
* @param string $token default payment method token
|
||||
*/
|
||||
public function setDefaultWallet(string $token): Result
|
||||
{
|
||||
return $this->query('PUT', 'wallets/default', [], null, [
|
||||
'token' => $token
|
||||
]);
|
||||
}
|
||||
|
||||
public function getWalletSetupIntent(string $successUrl): string
|
||||
{
|
||||
return sprintf('%swallet/?continue_url=%s', config('bitinflow-accounts.payments.dashboard_url'), urlencode($successUrl));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user