diff --git a/src/Api/Factory/PaymentScheme.php b/src/Api/Factory/PaymentScheme.php index 92fd147..4bc3d6a 100644 --- a/src/Api/Factory/PaymentScheme.php +++ b/src/Api/Factory/PaymentScheme.php @@ -24,7 +24,7 @@ abstract class PaymentScheme public function __construct(Setting $settings) { - + $this->settings = $settings; $this->client = new Client([ 'base_uri' => $this->getApiUri(), @@ -40,7 +40,7 @@ public function __construct(Setting $settings) //abstract protected function registerCardDuringPayment(CardBuilder $card); - abstract protected function repeatedPayment(PaymentCard $card, object $owner, int $amount, string $type); + abstract protected function repeatedPayment(PaymentCard $card, object $owner, int $amount, string $customerName, $invoiceId, string $type); abstract protected function oneClickPayment(PaymentCard $card, int $amount); diff --git a/src/Api/PaymentMethods/CopyAndPay.php b/src/Api/PaymentMethods/CopyAndPay.php index 96c1359..01e9de7 100644 --- a/src/Api/PaymentMethods/CopyAndPay.php +++ b/src/Api/PaymentMethods/CopyAndPay.php @@ -151,11 +151,13 @@ public function registerCardDuringPayment(int $amount, $preAuth = false) * @param PaymentCard $card * @param $owner * @param int $amount + * @param string $customerName + * @param string $invoiceId * @param string $type * * @return mixed|\Psr\Http\Message\ResponseInterface */ - public function repeatedPayment(PaymentCard $card, $owner, int $amount, string $type = PaymentScheme::REPEATED_PAYMENT) + public function repeatedPayment(PaymentCard $card, $owner, int $amount, string $customerName = null, $invoiceId = null, string $type = PaymentScheme::REPEATED_PAYMENT) { try { return $this->client->request( diff --git a/src/Api/PaymentMethods/ServerToServer.php b/src/Api/PaymentMethods/ServerToServer.php index f2806b8..b6e4370 100644 --- a/src/Api/PaymentMethods/ServerToServer.php +++ b/src/Api/PaymentMethods/ServerToServer.php @@ -89,10 +89,12 @@ public function registerCardDuringPayment(CardBuilder $card, int $amount) * @param $owner * @param int $amount * @param string $type + * @param string $customerName + * @param string $invoiceId * * @return mixed|\Psr\Http\Message\ResponseInterface */ - public function repeatedPayment(PaymentCard $card, $owner, int $amount, string $type = PaymentScheme::REPEATED_PAYMENT) + public function repeatedPayment(PaymentCard $card, $owner, int $amount, string $customerName = null, $invoiceId = null, string $type = PaymentScheme::REPEATED_PAYMENT) { try { $response = $this->client->request( @@ -106,6 +108,8 @@ public function repeatedPayment(PaymentCard $card, $owner, int $amount, string $ 'paymentType' => self::DEBIT, 'recurringType' => $type, 'merchantTransactionId' => class_basename($owner) . '-' . $owner->id, + 'customer.givenName' => $customerName, + 'merchantInvoiceId' => $invoiceId ], ] )->getBody()->getContents();