diff --git a/src/Message/Checkout/PurchaseRequest.php b/src/Message/Checkout/PurchaseRequest.php index d3d2386d..1fb1749d 100644 --- a/src/Message/Checkout/PurchaseRequest.php +++ b/src/Message/Checkout/PurchaseRequest.php @@ -25,7 +25,6 @@ public function setSuccessUrl($value) { return $this->setParameter('success_url', $value); } - /** * Get the success url * @@ -35,6 +34,28 @@ public function getSuccessUrl() { return $this->getParameter('success_url'); } + + /** + * Get the Customer + * + * @return string + */ + public function getCustomer() + { + return $this->getParameter('customer'); + } + /** + * Set the Customer + * + * @param string $value + * + * @return \Omnipay\Common\Message\AbstractRequest|PurchaseRequest + */ + public function setCustomer($value) + { + return $this->setParameter('customer', $value); + } + /** * Set the cancel url * @@ -146,6 +167,16 @@ public function getClientReferenceId() } + public function getMetadata() + { + return $this->getParameter('metadata'); + } + + public function setMetadata($value) + { + return $this->setParameter('metadata', $value); + } + public function getData() { $data = array( @@ -153,9 +184,15 @@ public function getData() 'cancel_url' => $this->getCancelUrl(), 'payment_method_types' => $this->getPaymentMethodTypes(), 'mode' => $this->getMode(), - 'line_items' => $this->getLineItems() + 'line_items' => $this->getLineItems(), + 'customer' => $this->getCustomer(), + 'client_reference_id'=>$this->getClientReferenceId() ); + if ($this->getMetadata()) { + $data['metadata'] = $this->getMetadata(); + } + return $data; } diff --git a/src/Message/PaymentIntents/AuthorizeRequest.php b/src/Message/PaymentIntents/AuthorizeRequest.php index 4a0ec8ad..c6e65487 100644 --- a/src/Message/PaymentIntents/AuthorizeRequest.php +++ b/src/Message/PaymentIntents/AuthorizeRequest.php @@ -329,6 +329,28 @@ public function getOffSession() return $this->getParameter('off_session'); } + /** + * Set the setup_future_usage parameter. + * + * @param $value + * @return AbstractRequest provides a fluent interface. + */ + public function setPaymentMethodTypes($value) + { + return $this->setParameter('payment_method_types', $value); + } + + /** + * Get the success url + * + * @return string + */ + public function getPaymentMethodTypes() + { + return $this->getParameter('payment_method_types'); + } + + /** * @inheritdoc */ @@ -403,6 +425,7 @@ public function getData() } $data['off_session'] = $this->getOffSession() ? 'true' : 'false'; + $data['payment_method_types'] = $this->getPaymentMethodTypes(); return $data; } diff --git a/src/Message/UpdateCustomerRequest.php b/src/Message/UpdateCustomerRequest.php index d05cf8c9..07bc6852 100644 --- a/src/Message/UpdateCustomerRequest.php +++ b/src/Message/UpdateCustomerRequest.php @@ -66,7 +66,7 @@ public function getSource() { return $this->getParameter('source'); } - + /** * Sets the customer's source. * @@ -78,12 +78,35 @@ public function setSource($value) $this->setParameter('source', $value); } + /** + * Get the customer's def source. + * + * @return string + */ + public function getDefaultSource() + { + return $this->getParameter('default_source'); + } + + /** + * Sets the customer's def source. + * + * @param string $value + * @return CreateCustomerRequest provides a fluent interface. + */ + public function setDefaultSource($value) + { + $this->setParameter('default_source', $value); + } + public function getData() { $this->validate('customerReference'); $data = array(); $data['description'] = $this->getDescription(); + $data['default_source'] = $this->getDefaultSource(); + if ($this->getToken()) { $data['card'] = $this->getToken(); } elseif ($this->getCard()) { @@ -102,6 +125,7 @@ public function getData() $data['source'] = $this->getSource(); } + return $data; }