Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions src/Message/SetupIntents/CreateSetupIntentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,48 @@
*/
class CreateSetupIntentRequest extends AbstractRequest
{
/**
* @param bool $value
*
* @return AbstractRequest provides a fluent interface.
*/
public function setConfirm($value)
{
return $this->setParameter('confirm', $value);
}

/**
* @return mixed
*/
public function getConfirm()
{
if (is_null($this->getParameter('confirm'))) {
return 'false';
}
return $this->getParameter('confirm');
}

/**
* @param bool $value
*
* @return AbstractRequest provides a fluent interface.
*/
public function setUsage($value)
{
return $this->setParameter('usage', $value);
}

/**
* @return mixed
*/
public function getUsage()
{
if (is_null($this->getParameter('usage'))) {
return 'off_session';
}
return $this->getParameter('usage');
}

/**
* @inheritdoc
*/
Expand All @@ -37,13 +79,15 @@ public function getData()
}

if ($this->getMetadata()) {
$this['metadata'] = $this->getMetadata();
$data['metadata'] = $this->getMetadata();
}
if ($this->getPaymentMethod()) {
$this['payment_method'] = $this->getPaymentMethod();
$data['payment_method'] = $this->getPaymentMethod();
}

$data['usage'] = 'off_session';
$data['confirm'] = $this->getConfirm();

$data['usage'] = $this->getUsage();
$data['payment_method_types'][] = 'card';

return $data;
Expand Down