/** * This creates a customer, and returns the generated id. * * @return string */ protected function createCustomer() { try { $result = $this->getDispatcher()->customerCreate($this->getAccessKey(), $this->getTestMode()); return $result['customerId']; } catch (Exception $e) { throw jmsPaymentException::fromException($e); } }
public function deposit(jmsPaymentMethodData $data, $retry = false) { try { $result = $this->getDispatcher()->sessionApprove($this->getAccessKey(), $this->getTestMode(), $data['external_reference_number']); $data->setResponseCode($result['status']); if ($result['status'] === 'APPROVED') { $data->setProcessedAmount($data->getAmount()); } } catch (Exception $e) { $data->setReasonCode($e->getMessage()); $e = jmsPaymentException::fromException($e); $e->setPaymentMethodData($data); throw $e; } }