Skip to content

Commit 678ae9c

Browse files
authored
Null check for transactions
1 parent 3f30574 commit 678ae9c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

RecurringBilling/get-subscription.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ function getSubscription($subscriptionId)
4343
echo "Customer Profile ID: " . $response->getSubscription()->getProfile()->getCustomerProfileId() . "\n";
4444
echo "Customer payment Profile ID: ". $response->getSubscription()->getProfile()->getPaymentProfile()->getCustomerPaymentProfileId() . "\n";
4545
$transactions = $response->getSubscription()->getArbTransactions();
46-
foreach ($transactions as $transaction) {
47-
echo "Transaction ID : ".$transaction->getTransId()." -- ".$transaction->getResponse()." -- Pay Number : ".$transaction->getPayNum()."\n";
48-
}
46+
if($transactions != null){
47+
foreach ($transactions as $transaction) {
48+
echo "Transaction ID : ".$transaction->getTransId()." -- ".$transaction->getResponse()." -- Pay Number : ".$transaction->getPayNum()."\n";
49+
}
50+
}
4951
}
5052
else
5153
{

0 commit comments

Comments
 (0)