public function connect($profileId = '', $profileIdType = '', $apiToken = '', $apiKey = '', $endpointUrl = '', $portNumber = '') { $this->lastResponse = parent::connect($apiToken, $apiKey, $endpointUrl, $portNumber); if (!$this->lastResponse->success) { var_dump($this->lastResponse); throw new Exception($this->lastResponse->error); } else { if ($this->debugLevel >= 1) { echo "Connected: " + var_dump($this->lastResponse); } } if ($profileId) { $this->setPaymentProfileId($profileId, $profileIdType); } return $this->lastResponse; }
<?php /********************************************************************************* * OpenACH is an ACH payment processing platform * Copyright (C) 2011 Steven Brendtro, ALL RIGHTS RESERVED * * Refer to /legal/license.txt for license information, or view the full license * online at http://openach.com/community/license.txt ********************************************************************************/ // API Test for OpenACH // Load the OpenACH SDK require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'OpenACHSdk.php'; $client = new OAClient(); $response = $client->connect('XHwcsHLOvx45mVDF82aMB4g83gvQu5Jap2cJ6ykHjan', 'Y0wQqlAEOBJ2TKsf5geHgYs7L97kdWiGc6xlc3qIJIG', 'http://dev.openach.com/api/'); // Make sure the endpoint is the server your account is on /* $response = $client->connect( 'X4vFUA3CU7EC0NGGBvD8FNikflnUdIUhe0PBWdTtaLn', // Api Token '4L6CRThHyx9LiNC0EhQzkvtBqFZ2Xhdh3bFkBNdk5Kc', // Api Key 'http://test.openach.com/api/' ); // Make sure the endpoint is the server your account is on */ if (!$response->success) { echo $response->error . PHP_EOL; exit; } $externalAccountsReq = new OAGetExternalAccountsRequest(); $paymentProfileReq = new OAGetPaymentProfileRequest(); $paymentProfileExtIdReq = new OAGetPaymentProfileByExtIdRequest(); $paymentSchedulesReq = new OAGetPaymentSchedulesRequest(); // Load payment profile using external id ( OAGetPaymentProfileByExtIdRequest )