diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..1edf000 Binary files /dev/null and b/.DS_Store differ diff --git a/CustomerProfiles/GetCustomerPaymentProfile.php b/CustomerProfiles/GetCustomerPaymentProfile.php new file mode 100644 index 0000000..d29e49a --- /dev/null +++ b/CustomerProfiles/GetCustomerPaymentProfile.php @@ -0,0 +1,30 @@ +setName( "556KThWQ6vf2"); + $merchantAuthentication->setTransactionKey("9ac2932kQ7kN2Wzq"); + + $request = new AnetAPI\GetCustomerPaymentProfileRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setCustomerProfileId("10000"); + $request->setCustomerPaymentProfileId("20000"); + + $controller = new AnetController\GetCustomerPaymentProfileController($request); + + $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); + + if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") ) + { + echo "SUCCESS: " . " " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n"; + } + else + { + echo "ERROR : Invalid response\n"; + echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n"; + } + ?> \ No newline at end of file diff --git a/CustomerProfiles/GetCustomerShippingAddress.php b/CustomerProfiles/GetCustomerShippingAddress.php new file mode 100644 index 0000000..76caf1c --- /dev/null +++ b/CustomerProfiles/GetCustomerShippingAddress.php @@ -0,0 +1,30 @@ +setName( "556KThWQ6vf2"); + $merchantAuthentication->setTransactionKey("9ac2932kQ7kN2Wzq"); + + $request = new AnetAPI\GetCustomerShippingAddressRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setCustomerProfileId("10000"); + $request->setCustomerAddressId("20000"); + + $controller = new AnetController\GetCustomerShippingAddressController($request); + + $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); + + if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") ) + { + echo "SUCCESS: " . " " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n"; + } + else + { + echo "ERROR : Invalid response\n"; + echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n"; + } + ?> \ No newline at end of file diff --git a/CustomerProfiles/GetHostedProfilePage.php b/CustomerProfiles/GetHostedProfilePage.php new file mode 100644 index 0000000..d6d793c --- /dev/null +++ b/CustomerProfiles/GetHostedProfilePage.php @@ -0,0 +1,44 @@ +setName( "556KThWQ6vf2"); + $merchantAuthentication->setTransactionKey("9ac2932kQ7kN2Wzq"); + + $hostedProfileSettings1 = new AnetAPI\SettingType(); + $hostedProfileSettings1->setSettingName("hostedProfileReturnUrl"); + $hostedProfileSettings1->setSettingValue("https://returnurl.com/return/"); + + $hostedProfileSettings2 = new AnetAPI\SettingType(); + $hostedProfileSettings2->setSettingName("hostedProfileReturnUrlText"); + $hostedProfileSettings2->setSettingValue("Continue to confirmation page."); + + $hostedProfileSettings3 = new AnetAPI\SettingType(); + $hostedProfileSettings3->setSettingName("hostedProfilePageBorderVisible"); + $hostedProfileSettings3->setSettingValue("true"); + + $hostedProfileSettings = [$hostedProfileSettings1, $hostedProfileSettings2, $hostedProfileSettings3]; + + $request = new AnetAPI\GetHostedProfilePageRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setCustomerProfileId("YourProfileID"); + $request->setHostedProfileSettings($hostedProfileSettings); + + $controller = new AnetController\GetHostedProfilePageController($request); + + $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); + + if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") ) + { + echo "SUCCESS: " . $response->getToken() . "\n"; + } + else + { + echo "ERROR : Invalid response\n"; + echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n"; + } + ?> \ No newline at end of file diff --git a/CustomerProfiles/ValidateCustomerPaymentProfile.php b/CustomerProfiles/ValidateCustomerPaymentProfile.php new file mode 100644 index 0000000..9a6ee8d --- /dev/null +++ b/CustomerProfiles/ValidateCustomerPaymentProfile.php @@ -0,0 +1,31 @@ +setName( "556KThWQ6vf2"); + $merchantAuthentication->setTransactionKey("9ac2932kQ7kN2Wzq"); + + $request = new AnetAPI\ValidateCustomerPaymentProfileRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setCustomerProfileId("10000"); + $request->setCustomerPaymentProfileId("20000"); + $request->setvalidationMode("liveMode"); + + $controller = new AnetController\ValidateCustomerPaymentProfileController($request); + + $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); + + if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") ) + { + echo "SUCCESS: " . " " . $response->getDirectResponse() . "\n"; + } + else + { + echo "ERROR : Invalid response\n"; + echo "Response : " . $response->getMessages()->getMessage()[0]->getCode() . " " .$response->getMessages()->getMessage()[0]->getText() . "\n"; + } + ?> \ No newline at end of file