Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update customer with Direct method #1

Closed
marekfri opened this issue Oct 27, 2015 · 1 comment
Closed

Update customer with Direct method #1

marekfri opened this issue Oct 27, 2015 · 1 comment

Comments

@marekfri
Copy link

Hi developers,
There is a method createCustomer() in the \Eway\Rapid\Client class, but I'm missing one similar - updateCustomer(), which would use UPDATE_TOKEN_CUSTOMER payment method.

How can I possibly update customer information without recording a payment? createTransaction() method doesn't allow me to do this as the payment method is overridden there for the direct access to one of PROCESS_PAYMENT / AUTHORISE.

At the moment I must implement this method elsewhere, which is not a good way as I cannot use other methods which are private in the Client class.

Thanks for the response.

@incarnate
Copy link
Member

Hi Marek,

Thanks for posting about the lack of update customer in the eWAY PHP SDK - we did manage to miss that function in the initial release.

We've just pushed version 1.1.1 live which includes the update token customer function, you should be able to update your project by running composer update if you installed the SDK with composer.

We'll update our documentation soon, in the meantime the updateCustomer function can be used like this:

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$customer = [
    'TokenCustomerID' => 917758625852,
    'Title' => 'Ms.',
    'FirstName' => 'Jane',
    'LastName' => 'Smith',
    'Country' => 'au',
    'CardDetails' => [
        'Name' => 'Jane Smith',
        'Number' => '4444333322221111',
        'ExpiryMonth' => '12',
        'ExpiryYear' => '25',
        'CVN' => '123',
    ]
];

$response = $client->updateCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $customer);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants