mirror of
https://github.com/bitinflow/accounts.git
synced 2026-03-14 14:05:52 +00:00
Add test implementation for charges, documents & payment intents
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace GhostZero\BitinflowAccounts\Traits;
|
||||
|
||||
use GhostZero\BitinflowAccounts\ApiOperations\Get;
|
||||
use GhostZero\BitinflowAccounts\ApiOperations\Post;
|
||||
use GhostZero\BitinflowAccounts\Result;
|
||||
|
||||
/**
|
||||
* @author René Preuß <rene@preuss.io>
|
||||
*/
|
||||
trait PaymentIntentsTrait
|
||||
{
|
||||
|
||||
use Get, Post;
|
||||
|
||||
/**
|
||||
* Get a Payment Intent object
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return Result Result object
|
||||
*/
|
||||
public function getPaymentIntent(string $id): Result
|
||||
{
|
||||
return $this->get("payment-intents/$id");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Payment Intent object
|
||||
*
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return Result
|
||||
*/
|
||||
public function createPaymentIntent(array $parameters): Result
|
||||
{
|
||||
return $this->post('payment-intents', $parameters);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user