mirror of
https://github.com/bitinflow/accounts.git
synced 2026-03-13 13:35:52 +00:00
35 lines
821 B
PHP
35 lines
821 B
PHP
<?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', 'wallet');
|
|
}
|
|
|
|
/**
|
|
* Set default wallet to given wallet token.
|
|
*
|
|
* @param string $token default payment method token
|
|
*/
|
|
public function setDefaultWallet(string $token): Result
|
|
{
|
|
return $this->query('PUT', 'wallet/default', [], null, [
|
|
'token' => $token
|
|
]);
|
|
}
|
|
|
|
public function getWalletSetupIntent(string $successUrl): string
|
|
{
|
|
return sprintf('%swallet/?continue_url=%s', config('bitinflow-accounts.payments.dashboard_url'), urlencode($successUrl));
|
|
}
|
|
}
|