/**
  * @test
  */
 public function createWithAllValues()
 {
     $data = '{"id":"543477161-91de-012f-e284-1e0030c7f3123","short_reference":"140416-GGJBNQ001","beneficiary_id":"543477161-91de-012f-e284-1e0030c7f352","conversion_id":"049bab6d-fe2a-42e1-be0f-531c59f838ea","amount":"1250000.00","currency":"GBP","status":"ready_to_send","payment_type":"regular","reference":"INVOICE 9876","reason":"Salary for March","payment_date":"2014-01-12T00:00:00+00:00","transferred_at":"2014-01-12T13:00:00+00:00","authorisation_steps_required":"0","creator_contact_id":"ab3477161-91de-012f-e284-1e0030c7f35c","last_updater_contact_id":"ab3477161-91de-012f-e284-1e0030c7f35c","failure_reason":"","payer_id":"","payer_details_source":"","created_at":"2014-01-12T12:24:19+00:00","updated_at":"2014-01-12T12:24:19+00:00"}';
     $paymentDate = new DateTime();
     $dateOfBirth = new DateTime();
     $payment = Payment::create('A', 'B', 'C', 'D', 'E')->setConversionId('F')->setPaymentType('G')->setPaymentDate($paymentDate);
     $payer = new Payer();
     $payer->setLegalEntityType('I')->setCompanyName('J')->setFirstName('K')->setLastName('L')->setCity('M')->setAddress(['N', 'Z'])->setPostcode('O')->setStateOrProvince('P')->setCountry('R')->setDateOfBirth($dateOfBirth)->setIdentificationType('T')->setIdentificationValue('U');
     $entryPoint = new PaymentsEntryPoint(new SimpleEntityManager(), $this->getMockedClient(json_decode($data), 'POST', 'payments/create', [], ['currency' => 'A', 'beneficiary_id' => 'B', 'amount' => 'C', 'reason' => 'D', 'reference' => 'E', 'conversion_id' => 'F', 'payment_type' => 'G', 'payment_date' => $paymentDate->format(DateTime::RFC3339), 'payer_entity_type' => 'I', 'payer_company_name' => 'J', 'payer_first_name' => 'K', 'payer_last_name' => 'L', 'payer_city' => 'M', 'payer_address' => 'N Z', 'payer_postcode' => 'O', 'payer_state_or_province' => 'P', 'payer_country' => 'R', 'payer_date_of_birth' => $dateOfBirth->format('Y-m-d'), 'payer_identification_type' => 'T', 'payer_identification_value' => 'U', 'on_behalf_of' => 'V']));
     $item = $entryPoint->create($payment, $payer, 'V');
     $this->validateObjectStrictName($item, json_decode($data, true));
 }
 /**
  * @param Payer $payer
  *
  * @return array
  */
 protected function convertPayerToRequest(Payer $payer)
 {
     $payerDateOfBirth = $payer->getDateOfBirth();
     return ['payer_entity_type' => $payer->getLegalEntityType(), 'payer_company_name' => $payer->getCompanyName(), 'payer_first_name' => $payer->getFirstName(), 'payer_last_name' => $payer->getLastName(), 'payer_city' => $payer->getCity(), 'payer_address' => null === $payer->getAddress() ? null : implode(' ', $payer->getAddress()), 'payer_postcode' => $payer->getPostcode(), 'payer_state_or_province' => $payer->getStateOrProvince(), 'payer_country' => $payer->getCountry(), 'payer_date_of_birth' => null === $payerDateOfBirth ? $payerDateOfBirth : $payerDateOfBirth->format('Y-m-d'), 'payer_identification_type' => $payer->getIdentificationType(), 'payer_identification_value' => $payer->getIdentificationValue()];
 }