diff --git a/.travis.yml b/.travis.yml index f47fce1..5e7c982 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ before_script: - composer install --prefer-dist --ignore-platform-reqs script: - - phpunit test-runner.php . + - phpunit test-runner.php diff --git a/constants/Constants.php b/Constants.php similarity index 93% rename from constants/Constants.php rename to Constants.php index d1ce2da..9368ac4 100644 --- a/constants/Constants.php +++ b/Constants.php @@ -1,5 +1,4 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $creditCard = new AnetAPI\CreditCardType(); diff --git a/CustomerProfiles/create-customer-profile-from-transaction.php b/CustomerProfiles/create-customer-profile-from-transaction.php index 86683e6..55fd74f 100644 --- a/CustomerProfiles/create-customer-profile-from-transaction.php +++ b/CustomerProfiles/create-customer-profile-from-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $customerProfile = new AnetAPI\CustomerProfileBaseType(); $customerProfile->setMerchantCustomerId("123212"); diff --git a/CustomerProfiles/create-customer-profile-with-accept-nonce.php b/CustomerProfiles/create-customer-profile-with-accept-nonce.php index 41ab983..08de58a 100644 --- a/CustomerProfiles/create-customer-profile-with-accept-nonce.php +++ b/CustomerProfiles/create-customer-profile-with-accept-nonce.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for an accept token diff --git a/CustomerProfiles/create-customer-profile.php b/CustomerProfiles/create-customer-profile.php index ffaf655..31a7006 100644 --- a/CustomerProfiles/create-customer-profile.php +++ b/CustomerProfiles/create-customer-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card diff --git a/CustomerProfiles/create-customer-shipping-address.php b/CustomerProfiles/create-customer-shipping-address.php index 7ee5536..630b7e7 100644 --- a/CustomerProfiles/create-customer-shipping-address.php +++ b/CustomerProfiles/create-customer-shipping-address.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); // Use An existing customer profile id for this merchant name and transaction key diff --git a/CustomerProfiles/delete-customer-payment-profile.php b/CustomerProfiles/delete-customer-payment-profile.php index 8f9d309..7ef7b9a 100644 --- a/CustomerProfiles/delete-customer-payment-profile.php +++ b/CustomerProfiles/delete-customer-payment-profile.php @@ -1,5 +1,6 @@ ]setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); // Use an existing payment profile ID for this Merchant name and Transaction key diff --git a/CustomerProfiles/delete-customer-profile.php b/CustomerProfiles/delete-customer-profile.php index ea33cc7..7c50642 100644 --- a/CustomerProfiles/delete-customer-profile.php +++ b/CustomerProfiles/delete-customer-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Delete an existing customer profile diff --git a/CustomerProfiles/delete-customer-shipping-address.php b/CustomerProfiles/delete-customer-shipping-address.php index fedfac3..a475d4d 100644 --- a/CustomerProfiles/delete-customer-shipping-address.php +++ b/CustomerProfiles/delete-customer-shipping-address.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); // Use an existing customer profile and address id for this merchant name and transaction key // Delete an existing customer shipping address for an existing customer profile diff --git a/CustomerProfiles/get-accept-customer-profile-page.php b/CustomerProfiles/get-accept-customer-profile-page.php index a1450af..5169e08 100644 --- a/CustomerProfiles/get-accept-customer-profile-page.php +++ b/CustomerProfiles/get-accept-customer-profile-page.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); // Use an existing payment profile ID for this Merchant name and Transaction key diff --git a/CustomerProfiles/get-customer-payment-profile-list.php b/CustomerProfiles/get-customer-payment-profile-list.php index 1e337e9..ff5d203 100644 --- a/CustomerProfiles/get-customer-payment-profile-list.php +++ b/CustomerProfiles/get-customer-payment-profile-list.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); //Setting the paging diff --git a/CustomerProfiles/get-customer-payment-profile.php b/CustomerProfiles/get-customer-payment-profile.php index 9279a1b..7956d1a 100644 --- a/CustomerProfiles/get-customer-payment-profile.php +++ b/CustomerProfiles/get-customer-payment-profile.php @@ -1,6 +1,7 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); //request requires customerProfileId and customerPaymentProfileId diff --git a/CustomerProfiles/get-customer-profile-ids.php b/CustomerProfiles/get-customer-profile-ids.php index d1ac23d..28d0664 100644 --- a/CustomerProfiles/get-customer-profile-ids.php +++ b/CustomerProfiles/get-customer-profile-ids.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Get all existing customer profile ID's diff --git a/CustomerProfiles/get-customer-profile.php b/CustomerProfiles/get-customer-profile.php index 6af433a..b7bfe7e 100644 --- a/CustomerProfiles/get-customer-profile.php +++ b/CustomerProfiles/get-customer-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card diff --git a/CustomerProfiles/get-customer-shipping-address.php b/CustomerProfiles/get-customer-shipping-address.php index 53b9b66..19e121e 100644 --- a/CustomerProfiles/get-customer-shipping-address.php +++ b/CustomerProfiles/get-customer-shipping-address.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); // An existing customer profile id and shipping address id for this merchant name and transaction key $customerProfileId = $customerprofileid; diff --git a/CustomerProfiles/update-customer-payment-profile.php b/CustomerProfiles/update-customer-payment-profile.php index ecf034f..4988a11 100644 --- a/CustomerProfiles/update-customer-payment-profile.php +++ b/CustomerProfiles/update-customer-payment-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); //Set profile ids of profile to be updated diff --git a/CustomerProfiles/update-customer-profile.php b/CustomerProfiles/update-customer-profile.php index 87e61ac..720240a 100644 --- a/CustomerProfiles/update-customer-profile.php +++ b/CustomerProfiles/update-customer-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card diff --git a/CustomerProfiles/update-customer-shipping-address.php b/CustomerProfiles/update-customer-shipping-address.php index ea4b496..5ff6c2e 100644 --- a/CustomerProfiles/update-customer-shipping-address.php +++ b/CustomerProfiles/update-customer-shipping-address.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); // An existing customer profile id for this merchant name and transaction key $existingcustomerprofileid = $customerprofileid; diff --git a/CustomerProfiles/validate-customer-payment-profile.php b/CustomerProfiles/validate-customer-payment-profile.php index 565d03a..29552a3 100644 --- a/CustomerProfiles/validate-customer-payment-profile.php +++ b/CustomerProfiles/validate-customer-payment-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); // Use an existing payment profile ID for this Merchant name and Transaction key //validationmode tests , does not send an email receipt diff --git a/MobileInappTransactions/create-an-accept-transaction.php b/MobileInappTransactions/create-an-accept-transaction.php index 670dbe5..e999a0b 100644 --- a/MobileInappTransactions/create-an-accept-transaction.php +++ b/MobileInappTransactions/create-an-accept-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $op = new AnetAPI\OpaqueDataType(); @@ -34,7 +35,7 @@ function createAnAcceptTransaction(){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/MobileInappTransactions/create-an-android-pay-transaction.php b/MobileInappTransactions/create-an-android-pay-transaction.php index ebd0176..c1ee7a1 100644 --- a/MobileInappTransactions/create-an-android-pay-transaction.php +++ b/MobileInappTransactions/create-an-android-pay-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $op = new AnetAPI\OpaqueDataType(); @@ -34,7 +35,7 @@ function createAnAndroidPayTransaction(){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/MobileInappTransactions/create-an-apple-pay-transaction.php b/MobileInappTransactions/create-an-apple-pay-transaction.php index 387d33f..bd78a5a 100644 --- a/MobileInappTransactions/create-an-apple-pay-transaction.php +++ b/MobileInappTransactions/create-an-apple-pay-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $op = new AnetAPI\OpaqueDataType(); @@ -35,7 +36,7 @@ function createAnApplePayTransaction(){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/authorize-credit-card.php b/PaymentTransactions/authorize-credit-card.php index ea75b01..c0f733b 100644 --- a/PaymentTransactions/authorize-credit-card.php +++ b/PaymentTransactions/authorize-credit-card.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card @@ -37,7 +38,7 @@ function authorizeCreditCard($amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/capture-funds-authorized-through-another-channel.php b/PaymentTransactions/capture-funds-authorized-through-another-channel.php index 791cc60..53fd62e 100644 --- a/PaymentTransactions/capture-funds-authorized-through-another-channel.php +++ b/PaymentTransactions/capture-funds-authorized-through-another-channel.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $creditCard = new AnetAPI\CreditCardType(); @@ -36,7 +37,7 @@ function captureFundsAuthorizedThroughAnotherChannel($amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/capture-previously-authorized-amount.php b/PaymentTransactions/capture-previously-authorized-amount.php index 0221eb6..968b5c4 100644 --- a/PaymentTransactions/capture-previously-authorized-amount.php +++ b/PaymentTransactions/capture-previously-authorized-amount.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Now capture the previously authorized amount @@ -28,7 +29,7 @@ function capturePreviouslyAuthorizedAmount($transactionid){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/charge-credit-card.php b/PaymentTransactions/charge-credit-card.php index f80ee1d..72e0082 100644 --- a/PaymentTransactions/charge-credit-card.php +++ b/PaymentTransactions/charge-credit-card.php @@ -1,5 +1,7 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card @@ -41,7 +43,7 @@ function chargeCreditCard($amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); @@ -87,5 +89,5 @@ function chargeCreditCard($amount){ return $response; } if(!defined('DONT_RUN_SAMPLES')) - chargeCreditCard(\SampleCode\Constants::SAMPLE_AMOUNT); + chargeCreditCard(Constants::SAMPLE_AMOUNT); ?> diff --git a/PaymentTransactions/charge-customer-profile.php b/PaymentTransactions/charge-customer-profile.php index e90e41f..b3f9794 100644 --- a/PaymentTransactions/charge-customer-profile.php +++ b/PaymentTransactions/charge-customer-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $profileToCharge = new AnetAPI\CustomerProfilePaymentType(); @@ -32,7 +33,7 @@ function chargeCustomerProfile($profileid, $paymentprofileid, $amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/charge-tokenized-credit-card.php b/PaymentTransactions/charge-tokenized-credit-card.php index 72c4088..56df061 100644 --- a/PaymentTransactions/charge-tokenized-credit-card.php +++ b/PaymentTransactions/charge-tokenized-credit-card.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card @@ -38,7 +39,7 @@ function chargeTokenizedCreditCard($amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/credit-bank-account.php b/PaymentTransactions/credit-bank-account.php index 0ba4d07..0c2b407 100644 --- a/PaymentTransactions/credit-bank-account.php +++ b/PaymentTransactions/credit-bank-account.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a Bank Account $bankAccount = new AnetAPI\BankAccountType(); @@ -42,7 +43,7 @@ function creditBankAccount($amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/debit-bank-account.php b/PaymentTransactions/debit-bank-account.php index e2d0fc6..59535cb 100644 --- a/PaymentTransactions/debit-bank-account.php +++ b/PaymentTransactions/debit-bank-account.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a Bank Account @@ -41,7 +42,7 @@ function debitBankAccount($amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaymentTransactions/get-hosted-payment-page.php b/PaymentTransactions/get-hosted-payment-page.php index 9656a9f..9018e9f 100644 --- a/PaymentTransactions/get-hosted-payment-page.php +++ b/PaymentTransactions/get-hosted-payment-page.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card diff --git a/PaymentTransactions/refund-transaction.php b/PaymentTransactions/refund-transaction.php index 3de5edf..a6c7da1 100644 --- a/PaymentTransactions/refund-transaction.php +++ b/PaymentTransactions/refund-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card @@ -34,7 +35,7 @@ function refundTransaction($amount){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); @@ -79,5 +80,5 @@ function refundTransaction($amount){ return $response; } if(!defined('DONT_RUN_SAMPLES')) - refundTransaction( \SampleCode\Constants::SAMPLE_AMOUNT_REFUND); + refundTransaction( Constants::SAMPLE_AMOUNT_REFUND); ?> \ No newline at end of file diff --git a/PaymentTransactions/update-held-transaction.php b/PaymentTransactions/update-held-transaction.php index 3d541c5..3d56e03 100644 --- a/PaymentTransactions/update-held-transaction.php +++ b/PaymentTransactions/update-held-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a credit card diff --git a/PaymentTransactions/update-split-tender-group.php b/PaymentTransactions/update-split-tender-group.php index 2805bf6..b4c5e00 100644 --- a/PaymentTransactions/update-split-tender-group.php +++ b/PaymentTransactions/update-split-tender-group.php @@ -1,5 +1,6 @@ setName( \SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName( Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $request = new AnetAPI\UpdateSplitTenderGroupRequest(); diff --git a/PaymentTransactions/void-transaction.php b/PaymentTransactions/void-transaction.php index 82af5ae..7d5d280 100644 --- a/PaymentTransactions/void-transaction.php +++ b/PaymentTransactions/void-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); //create a transaction @@ -26,7 +27,7 @@ function voidTransaction($transactionid){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/authorization-and-capture-continue.php b/PaypalExpressCheckout/authorization-and-capture-continue.php index aff5f46..4dbf577 100644 --- a/PaypalExpressCheckout/authorization-and-capture-continue.php +++ b/PaypalExpressCheckout/authorization-and-capture-continue.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $payPalType=new AnetAPI\PayPalType(); $payPalType->setPayerID($payerID); @@ -32,7 +33,7 @@ function payPalAuthorizeCaptureContinue($refTransId, $payerID) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/authorization-and-capture.php b/PaypalExpressCheckout/authorization-and-capture.php index 562bfeb..7c29664 100644 --- a/PaypalExpressCheckout/authorization-and-capture.php +++ b/PaypalExpressCheckout/authorization-and-capture.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $payPalType=new AnetAPI\PayPalType(); $payPalType->setCancelUrl("http://www.merchanteCommerceSite.com/Success/TC25262"); @@ -33,7 +34,7 @@ function payPalAuthorizeCapture($amount) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/authorization-only-continued.php b/PaypalExpressCheckout/authorization-only-continued.php index 0664290..31510c7 100644 --- a/PaypalExpressCheckout/authorization-only-continued.php +++ b/PaypalExpressCheckout/authorization-only-continued.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $paypal_type = new AnetAPI\PayPalType(); @@ -41,7 +42,7 @@ function payPalAuthorizeOnlyContinue($transactionId, $payerId) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/authorization-only.php b/PaypalExpressCheckout/authorization-only.php index f95f47f..78ff4cc 100644 --- a/PaypalExpressCheckout/authorization-only.php +++ b/PaypalExpressCheckout/authorization-only.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data for a paypal account @@ -36,7 +37,7 @@ function payPalAuthorizeOnly($amount) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/credit.php b/PaypalExpressCheckout/credit.php index 0a19fa8..25618a2 100644 --- a/PaypalExpressCheckout/credit.php +++ b/PaypalExpressCheckout/credit.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); //use transaction of already settled paypal checkout transaction @@ -42,7 +43,7 @@ function payPalCredit($transactionId) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/get-details.php b/PaypalExpressCheckout/get-details.php index 683f774..ca2a699 100644 --- a/PaypalExpressCheckout/get-details.php +++ b/PaypalExpressCheckout/get-details.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); @@ -46,7 +47,7 @@ function payPalGetDetails($transactionId) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/prior-authorization-capture.php b/PaypalExpressCheckout/prior-authorization-capture.php index 679af87..5a4bd48 100644 --- a/PaypalExpressCheckout/prior-authorization-capture.php +++ b/PaypalExpressCheckout/prior-authorization-capture.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $payPalType = new AnetAPI\PayPalType(); @@ -37,7 +38,7 @@ function payPalPriorAuthorizationCapture($transactionId) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/PaypalExpressCheckout/void.php b/PaypalExpressCheckout/void.php index bd3c67c..74ed52e 100644 --- a/PaypalExpressCheckout/void.php +++ b/PaypalExpressCheckout/void.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $payPalType = new AnetAPI\PayPalType(); @@ -36,7 +37,7 @@ function payPalVoid($transactionId) { if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); diff --git a/RecurringBilling/cancel-subscription.php b/RecurringBilling/cancel-subscription.php index bfe1adb..6b8dc57 100644 --- a/RecurringBilling/cancel-subscription.php +++ b/RecurringBilling/cancel-subscription.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); $request = new AnetAPI\ARBCancelSubscriptionRequest(); diff --git a/RecurringBilling/create-subscription-from-customer-profile.php b/RecurringBilling/create-subscription-from-customer-profile.php index 33c7419..f8750c5 100644 --- a/RecurringBilling/create-subscription-from-customer-profile.php +++ b/RecurringBilling/create-subscription-from-customer-profile.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); @@ -63,6 +64,6 @@ function createSubscriptionFromCustomerProfile($intervalLength, $customerProfile } if(!defined('DONT_RUN_SAMPLES')) - createSubscriptionFromCustomerProfile( \SampleCode\Constants::SUBSCRIPTION_INTERVAL_DAYS, "247150", "215472", "189691"); + createSubscriptionFromCustomerProfile( Constants::SUBSCRIPTION_INTERVAL_DAYS, "247150", "215472", "189691"); ?> diff --git a/RecurringBilling/create-subscription.php b/RecurringBilling/create-subscription.php index e635f9a..72d6449 100644 --- a/RecurringBilling/create-subscription.php +++ b/RecurringBilling/create-subscription.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/RecurringBilling/get-list-of-subscriptions.php b/RecurringBilling/get-list-of-subscriptions.php index 74fdab8..81468c5 100644 --- a/RecurringBilling/get-list-of-subscriptions.php +++ b/RecurringBilling/get-list-of-subscriptions.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/RecurringBilling/get-subscription-status.php b/RecurringBilling/get-subscription-status.php index 4b8d7fa..8b7f9aa 100644 --- a/RecurringBilling/get-subscription-status.php +++ b/RecurringBilling/get-subscription-status.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/RecurringBilling/get-subscription.php b/RecurringBilling/get-subscription.php index 35dcb11..d6df1b0 100644 --- a/RecurringBilling/get-subscription.php +++ b/RecurringBilling/get-subscription.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/RecurringBilling/update-subscription.php b/RecurringBilling/update-subscription.php index 703b369..73f99fb 100644 --- a/RecurringBilling/update-subscription.php +++ b/RecurringBilling/update-subscription.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/TransactionReporting/get-batch-statistics.php b/TransactionReporting/get-batch-statistics.php index def63e8..cf7bfef 100644 --- a/TransactionReporting/get-batch-statistics.php +++ b/TransactionReporting/get-batch-statistics.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); //Setting a valid batch Id for the Merchant diff --git a/TransactionReporting/get-merchant-details.php b/TransactionReporting/get-merchant-details.php index 1ec4714..4a217b9 100644 --- a/TransactionReporting/get-merchant-details.php +++ b/TransactionReporting/get-merchant-details.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/TransactionReporting/get-settled-batch-list.php b/TransactionReporting/get-settled-batch-list.php index 150512b..5ff7ef7 100644 --- a/TransactionReporting/get-settled-batch-list.php +++ b/TransactionReporting/get-settled-batch-list.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $request = new AnetAPI\GetSettledBatchListRequest(); $request->setMerchantAuthentication($merchantAuthentication); diff --git a/TransactionReporting/get-transaction-details.php b/TransactionReporting/get-transaction-details.php index 89ef217..4971589 100644 --- a/TransactionReporting/get-transaction-details.php +++ b/TransactionReporting/get-transaction-details.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/TransactionReporting/get-transaction-list.php b/TransactionReporting/get-transaction-list.php index db83004..7ce4ce2 100644 --- a/TransactionReporting/get-transaction-list.php +++ b/TransactionReporting/get-transaction-list.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/TransactionReporting/get-unsettled-transaction-list.php b/TransactionReporting/get-unsettled-transaction-list.php index 2793fd8..1d5d5c5 100644 --- a/TransactionReporting/get-unsettled-transaction-list.php +++ b/TransactionReporting/get-unsettled-transaction-list.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); diff --git a/VisaCheckout/create-visa-checkout-transaction.php b/VisaCheckout/create-visa-checkout-transaction.php index f9debcf..e374130 100644 --- a/VisaCheckout/create-visa-checkout-transaction.php +++ b/VisaCheckout/create-visa-checkout-transaction.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data from a Visa Checkout blob @@ -38,7 +39,7 @@ function createVisaCheckoutTransaction(){ if ($response != null) { - if($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) + if($response->getMessages()->getResultCode() == Constants::RESPONSE_OK) { $tresponse = $response->getTransactionResponse(); if ($tresponse != null && $tresponse->getMessages() != null) diff --git a/VisaCheckout/decrypt-visa-checkout-data.php b/VisaCheckout/decrypt-visa-checkout-data.php index 0f9b633..74671e8 100644 --- a/VisaCheckout/decrypt-visa-checkout-data.php +++ b/VisaCheckout/decrypt-visa-checkout-data.php @@ -1,5 +1,6 @@ setName(\SampleCode\Constants::MERCHANT_LOGIN_ID); - $merchantAuthentication->setTransactionKey(\SampleCode\Constants::MERCHANT_TRANSACTION_KEY); + $merchantAuthentication->setName(Constants::MERCHANT_LOGIN_ID); + $merchantAuthentication->setTransactionKey(Constants::MERCHANT_TRANSACTION_KEY); $refId = 'ref' . time(); // Create the payment data from a Visa Checkout blob diff --git a/composer.json b/composer.json index a0188d1..6a0aff7 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,5 @@ "ext-curl": "*", "phpunit/phpunit": "~4.0", "authorizenet/authorizenet": "1.9.2" - }, - "autoload": { - "classmap": ["constants"] } } diff --git a/test-runner.php b/test-runner.php index e5ad2e5..d6be6f2 100644 --- a/test-runner.php +++ b/test-runner.php @@ -3,13 +3,17 @@ define("SAMPLE_CODE_NAME_HEADING", "SampleCodeName"); require 'vendor/autoload.php'; -if ( $_SERVER['argc'] != 3 ) { - die('\n Usage: phpunit test-runner.php '); +if ($_SERVER['argc'] == 3) { + $dirPath = $_SERVER['argv'][2]; + if(substr($dirPath, -1) != "/") + $dirPath = $dirPath."/"; } -$dirPath = $_SERVER['argv'][2]; -echo $dirPath; -if(substr($dirPath, -1) != "/") - $dirPath = $dirPath."/"; +else if ($_SERVER['argc'] == 2) { + $dirPath = "./"; +} +else{ + echo "Invalid number of arguements to test-runner: " . $_SERVER['argc'].".\n Usage: vendor/phpunit/phpunit/phpunit test-runner.php"; +} $directories = array( 'CustomerProfiles/',