Skip to content

Commit 9471da7

Browse files
author
brianmc
committed
Removed all the 5.4 dependencies
1 parent 5ae1d8c commit 9471da7

35 files changed

Lines changed: 92 additions & 66 deletions

ApplePayTransactions/create-an-apple-pay-transaction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function createAnApplePayTransaction(){
4444
else
4545
{
4646
echo "ERROR : Invalid response\n";
47-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
47+
$errorMessages = $response->getMessages()->getMessage();
48+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
4849
}
4950
}
5051
else

CustomerProfiles/create-customer-profile-from-transaction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ function createCustomerProfileFromTransaction($transId= \SampleCode\Constants::T
3737
else
3838
{
3939
echo "ERROR : Invalid response\n";
40-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
40+
$errorMessages = $response->getMessages()->getMessage();
41+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
4142
}
4243
return $response;
4344
}

CustomerProfiles/create-customer-profile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ function createCustomerProfile($email){
6464
else
6565
{
6666
echo "ERROR : Invalid response\n";
67-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
68-
67+
$errorMessages = $response->getMessages()->getMessage();
68+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
6969
}
7070
return $response;
7171
}

CustomerProfiles/create-customer-shipping-address.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ function createCustomerShippingAddress($existingcustomerprofileid = \SampleCode\
4343
else
4444
{
4545
echo "Create Customer Shipping Address ERROR : Invalid response\n";
46-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
46+
$errorMessages = $response->getMessages()->getMessage();
47+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
4748
}
4849
return $response;
4950
}

CustomerProfiles/delete-customer-payment-profile.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ function deleteCustomerPaymentProfile($customerProfileId= \SampleCode\Constants:
2828
else
2929
{
3030
echo "ERROR : Delete Customer Payment Profile: Invalid response\n";
31-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
31+
$errorMessages = $response->getMessages()->getMessage();
32+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
3233
}
3334
return $response;
3435
}

CustomerProfiles/delete-customer-profile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function deleteCustomerProfile($customerProfileId)
2727
else
2828
{
2929
echo "ERROR : DeleteCustomerProfile: Invalid response\n";
30-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
31-
30+
$errorMessages = $response->getMessages()->getMessage();
31+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
3232
}
3333

3434
return $response;

CustomerProfiles/delete-customer-shipping-address.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ function deleteCustomerShippingAddress($customerprofileid = \SampleCode\Constant
2929
else
3030
{
3131
echo "Delete Customer Shipping Address ERROR : Invalid response\n";
32-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
32+
$errorMessages = $response->getMessages()->getMessage();
33+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
3334
}
3435
return $response;
3536
}

CustomerProfiles/get-customer-payment-profile-list.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function getCustomerPaymentProfileList()
4444
{
4545
// Success
4646
echo "GetCustomerPaymentProfileList SUCCESS: " . "\n";
47-
echo "Message Code: " . $response->getMessages()->getMessage()[0]->getCode() . "\n";
48-
echo "Message Text: " . $response->getMessages()->getMessage()[0]->getText() . "\n";
47+
$errorMessages = $response->getMessages()->getMessage();
48+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
4949
echo "Total number of Results in the result set" . $response->getTotalNumInResultSet() . "\n";
5050
// Displaying the customer payment profile list
5151
foreach($response->getPaymentProfiles() as $paymentProfile )
@@ -61,7 +61,8 @@ function getCustomerPaymentProfileList()
6161
{
6262
// Error
6363
echo "GetCustomerPaymentProfileList ERROR : Invalid response\n";
64-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
64+
$errorMessages = $response->getMessages()->getMessage();
65+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
6566
}
6667
}
6768
else

CustomerProfiles/get-customer-payment-profile.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function getCustomerPaymentProfile($customerProfileId=\SampleCode\Constants::CUS
4848
else
4949
{
5050
echo "GetCustomerPaymentProfile ERROR : Invalid response\n";
51-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
51+
$errorMessages = $response->getMessages()->getMessage();
52+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
5253
}
5354
}
5455
else{

CustomerProfiles/get-customer-profile-ids.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ function getCustomerProfileIds()
2727
else
2828
{
2929
echo "GetCustomerProfileId's ERROR : Invalid response\n";
30-
echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n";
30+
$errorMessages = $response->getMessages()->getMessage();
31+
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
3132
}
3233
return $response;
3334
}

0 commit comments

Comments
 (0)