From 7d4e24fab39f2ffc07b10d614f6a7805b068dd93 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 9 Feb 2022 16:34:56 +1100 Subject: [PATCH] Stub methods for harvesting payment profiles from Auth.net --- .../Authorize/AuthorizeCreateCustomer.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/PaymentDrivers/Authorize/AuthorizeCreateCustomer.php b/app/PaymentDrivers/Authorize/AuthorizeCreateCustomer.php index e170a5042968..09826f7bb05a 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeCreateCustomer.php +++ b/app/PaymentDrivers/Authorize/AuthorizeCreateCustomer.php @@ -119,4 +119,30 @@ class AuthorizeCreateCustomer return $response; } + + + +// This is how we can harvest client profiles and attach them within Invoice Ninja +// $request = new net\authorize\api\contract\v1\GetCustomerProfileRequest(); +// $request->setMerchantAuthentication($driver->merchant_authentication); +// $request->setCustomerProfileId($gateway_customer_reference); +// $controller = new net\authorize\api\controller\GetCustomerProfileController($request); +// $response = $controller->executeWithApiResponse($driver->mode()); + +// if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") ) +// { +// echo "GetCustomerProfile SUCCESS : " . "\n"; +// $profileSelected = $response->getProfile(); +// $paymentProfilesSelected = $profileSelected->getPaymentProfiles(); +// echo "Profile Has " . count($paymentProfilesSelected). " Payment Profiles" . "\n"; + +// foreach ($profileSelected->getPaymentProfiles() as $paymentProfile) { +// echo "\nCustomer Profile ID: " . $paymentProfile->getCustomerProfileId() . "\n"; +// echo "Payment profile ID: " . $paymentProfile->getCustomerPaymentProfileId() . "\n"; +// echo "Credit Card Number: " . $paymentProfile->getPayment()->getCreditCard()->getCardNumber() . "\n"; +// if ($paymentProfile->getBillTo() != null) { +// echo "First Name in Billing Address: " . $paymentProfile->getBillTo()->getFirstName() . "\n"; +// } +// } + }