/** * @param Helper\CreditCard $creditCard */ public function saveCard(Helper\CreditCard $creditCard) { $this->api('/profiles', Enum\HttpMethod::POST, ['card' => ['complete' => true, 'name' => $creditCard->getName(), 'number' => $creditCard->getCardNumber(), 'expiry_month' => $creditCard->getCardExpiry()->format('m'), 'expiry_year' => $creditCard->getCardExpiry()->format('y'), 'cvd' => $creditCard->getCardCVV()], 'billing' => ['name' => $creditCard->getName(), 'address_line1' => $creditCard->getAddress1(), 'address_line2' => $creditCard->getAddress2(), 'city' => $creditCard->getCity(), 'province' => $creditCard->getState(), 'country' => $creditCard->getCountry(), 'postal_code' => $creditCard->getZipCode(), 'phone_number' => $creditCard->getPhoneNumber(), 'email_address' => $creditCard->getEmailAddress()]]); if ($this->getLastHttpStatusCode() === 200) { $this->getLastResponse()['expiry'] = $creditCard->getCardExpiry(); } }