/** * @param PaymentRequestNeeds $needs * @return array * @throws InvalidPaymentNeedsException */ protected function serializePaymentRequest(PaymentRequestNeeds $needs) { if ($needs->hasAll('amount', 'return_url', 'description') === false) { throw new InvalidPaymentNeedsException(); } return ['MerchantID' => $this->getProviderConfig('api_key'), 'Amount' => $this->calculateAmount($needs->getAmount()), 'CallbackURL' => $needs->getReturnUrl(), 'Description' => $needs->get('description'), 'Email' => $needs->get('email'), 'Mobile' => $needs->get('mobile')]; }