Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
Cashin: Fix existing account checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
vhpoet committed Jan 7, 2014
1 parent 30cd381 commit d5d1615
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zipzap/request.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ function request($params)
$responseObj = json_decode($response);

// Account already exists, get and return it.

if ($responseObj->Code && '40901' == $responseObj->Code) {
$params['verb'] = 'GET';
$params['URI'] = '/v1/accounts/MerchantCustomerID/' . $_POST['MerchantCustomerID'];
$params['URI'] = '/v1/accounts/MerchantCustomerID/' . $responseObj->Account->MerchantCustomerID;

$account = request($params);
$accountObj = json_decode($account);

if ($responseObj->Phone == $accountObj->Phone
&& $responseObj->Email == $accountObj->Email) {
if ($responseObj->Account->Phone == $accountObj->Phone
&& $responseObj->Account->Email == $accountObj->Email) {
echo $account;
} else {
echo $response;
Expand Down

0 comments on commit d5d1615

Please sign in to comment.