diff --git a/src/Builders/AuthorizationBuilder.php b/src/Builders/AuthorizationBuilder.php index 67404bad..4f87dbf2 100644 --- a/src/Builders/AuthorizationBuilder.php +++ b/src/Builders/AuthorizationBuilder.php @@ -1077,4 +1077,17 @@ public function withHostedPaymentData($hostedPaymentData) $this->hostedPaymentData = $hostedPaymentData; return $this; } + + /** + * Set the associated schedule ID + * + * @param string $scheduleId + * + * @return AuthorizationBuilder + */ + public function withScheduleId($scheduleId) + { + $this->scheduleId = $scheduleId; + return $this; + } } diff --git a/src/Entities/Schedule.php b/src/Entities/Schedule.php index 169b2e80..ac6c5cb5 100644 --- a/src/Entities/Schedule.php +++ b/src/Entities/Schedule.php @@ -63,7 +63,7 @@ class Schedule extends RecurringEntity * * @var EmailReceipt */ - public $emailReceipt; + public $emailReceipt = 'Never'; /** * The end date of a schedule, if any. diff --git a/src/Gateways/Gateway.php b/src/Gateways/Gateway.php index 0d4f5723..600e42dc 100644 --- a/src/Gateways/Gateway.php +++ b/src/Gateways/Gateway.php @@ -104,9 +104,7 @@ protected function sendRequest( curl_setopt($request, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($request, CURLOPT_SSL_CIPHER_LIST, implode(':', $supportedCiphers)); - // error_log($data); $curlResponse = curl_exec($request); - // error_log($curlResponse); $curlInfo = curl_getinfo($request); $curlError = curl_errno($request); diff --git a/src/Gateways/PayPlanConnector.php b/src/Gateways/PayPlanConnector.php index 079e7d20..1cc17303 100644 --- a/src/Gateways/PayPlanConnector.php +++ b/src/Gateways/PayPlanConnector.php @@ -474,12 +474,12 @@ protected function buildSchedule($request, Schedule $schedule, $type) if ($type === TransactionType::CREATE) { $request['customerKey'] = $schedule->customerKey; - $request['startDate'] = $schedule->startDate; + $request = $this->buildDate($request, 'startDate', $schedule->startDate); $request['frequency'] = $schedule->frequency; $request['duration'] = $mapDuration(); } else { // Edit Fields if (!$schedule->hasStarted) { - $request['startDate'] = $schedule->startDate; + $request = $this->buildDate($request, 'startDate', $schedule->startDate); $request['frequency'] = $schedule->frequency; $request['duration'] = $mapDuration(); } else { @@ -494,7 +494,7 @@ protected function buildSchedule($request, Schedule $schedule, $type) protected function buildDate($request, $name, \DateTime $date = null, $force = false) { if ($date !== null || $force) { - $value = $date !== null ? $date->format('MMddyyyy') : null; + $value = $date !== null ? $date->format('mdY') : null; $request[$name] = $value; } return $request; @@ -504,7 +504,7 @@ protected function buildAmount($request, $name, $amount, $currency, $type) { if ($amount !== null) { $node = [ - 'value' => $amount, + 'value' => $amount * 100, ]; if ($type === TransactionType::CREATE) { diff --git a/src/Gateways/PorticoConnector.php b/src/Gateways/PorticoConnector.php index f437034f..7c5ba0c2 100644 --- a/src/Gateways/PorticoConnector.php +++ b/src/Gateways/PorticoConnector.php @@ -31,6 +31,7 @@ use GlobalPayments\Api\PaymentMethods\Interfaces\IPinProtected; use GlobalPayments\Api\PaymentMethods\Interfaces\ITokenizable; use GlobalPayments\Api\PaymentMethods\Interfaces\ITrackData; +use GlobalPayments\Api\PaymentMethods\RecurringPaymentMethod; use GlobalPayments\Api\PaymentMethods\TransactionReference; use GlobalPayments\Api\Entities\Enums\ReportType; use GlobalPayments\Api\Entities\Reporting\TransactionSummary; @@ -196,8 +197,14 @@ public function processAuthorization(AuthorizationBuilder $builder) $block1->appendChild($xml->createElement('Alias', $builder->alias)); } - $isCheck = $builder->paymentMethod->paymentMethodType === PaymentMethodType::ACH; - if ($isCheck || $builder->billingAddress !== null) { + $isCheck = ($builder->paymentMethod->paymentMethodType === PaymentMethodType::ACH) + || ($builder->paymentMethod instanceof RecurringPaymentMethod + && $builder->paymentMethod->paymentType === 'ACH'); + $propertyName = $isCheck ? 'checkHolderName' : 'cardHolderName'; + if ($isCheck + || $builder->billingAddress !== null + || $builder->paymentMethod->{$propertyName} !== null + ) { $address = $this->hydrateHolder($xml, $builder, $isCheck); if (!empty($address)) { @@ -1079,6 +1086,15 @@ protected function hydrateTransactionSummary($item) $summary->batchSequenceNumber = (string)$item->BatchSeqNbr; } + if (isset($item) && isset($item->CardHolderData)) { + if (isset($item->CardHolderData->CardHolderFirstName)) { + $summary->cardHolderFirstName = $item->CardHolderData->CardHolderFirstName; + } + if (isset($item->CardHolderData->CardHolderLastName)) { + $summary->cardHolderLastName = $item->CardHolderData->CardHolderLastName; + } + } + if (isset($item) && isset($item->CardSwiped)) { $summary->cardSwiped = (string)$item->CardSwiped; } @@ -1301,7 +1317,7 @@ protected function hydrateTransactionSummary($item) $summary->fullyCaptured = (string)$item->FullyCapturedInd; } - // lodging data + // lodging data if (isset($item) && isset($item->LodgingData)) { $summary->lodgingData = new LodgingData(); $summary->lodgingData->prestigiousPropertyLimit = (string)$item->LodgingData->PrestigiousPropertyLimit; @@ -1379,6 +1395,8 @@ protected function mapRequestType(BaseBuilder $builder) return 'CreditIncrementalAuth'; } elseif ($builder->transactionModifier === TransactionModifier::OFFLINE) { return 'CreditOfflineAuth'; + } elseif ($builder->transactionModifier == TransactionModifier::RECURRING) { + return 'RecurringBillingAuth'; } elseif ($builder->transactionModifier === TransactionModifier::ENCRYPTED_MOBILE) { throw new UnsupportedTransactionException('Transaction not supported for this payment method.'); } @@ -1394,9 +1412,16 @@ protected function mapRequestType(BaseBuilder $builder) return 'CreditOfflineSale'; } elseif ($builder->transactionModifier === TransactionModifier::ENCRYPTED_MOBILE) { throw new UnsupportedTransactionException('Transaction not supported for this payment method.'); + } elseif ($builder->transactionModifier == TransactionModifier::RECURRING) { + return 'RecurringBilling'; } else { return 'CreditSale'; } + } elseif ($builder->paymentMethod->paymentMethodType == PaymentMethodType::RECURRING) { + if ($builder->paymentMethod->paymentType == 'ACH') { + return 'CheckSale'; + } + return 'RecurringBilling'; } elseif ($builder->paymentMethod->paymentMethodType === PaymentMethodType::DEBIT) { return 'DebitSale'; } elseif ($builder->paymentMethod->paymentMethodType === PaymentMethodType::CASH) { @@ -1571,33 +1596,41 @@ protected function normalizeResponse($input) protected function hydrateHolder(DOMDocument $xml, BaseBuilder $builder, $isCheck = false) { $holder = $xml->createElement($isCheck ? 'ConsumerInfo' : 'CardHolderData'); - $holder->appendChild( - $xml->createElement($isCheck ? 'Address1' : 'CardHolderAddr', $builder->billingAddress->streetAddress1) - ); - $holder->appendChild( - $xml->createElement($isCheck ? 'City' : 'CardHolderCity', $builder->billingAddress->city) - ); - $holder->appendChild( - $xml->createElement($isCheck ? 'State' : 'CardHolderState', $builder->billingAddress->getProvince()) - ); - $holder->appendChild( - $xml->createElement($isCheck ? 'Zip' : 'CardHolderZip', $builder->billingAddress->postalCode) - ); - if ($isCheck) { - if (!empty($builder->paymentMethod->checkHolderName)) { - $names = explode(' ', $builder->paymentMethod->checkHolderName, 2); + if ($isCheck && $builder->paymentMethod instanceof RecurringPaymentMethod) { + return null; + } + + if ($builder->billingAddress !== null) { + $holder->appendChild( + $xml->createElement($isCheck ? 'Address1' : 'CardHolderAddr', $builder->billingAddress->streetAddress1) + ); + $holder->appendChild( + $xml->createElement($isCheck ? 'City' : 'CardHolderCity', $builder->billingAddress->city) + ); + $holder->appendChild( + $xml->createElement($isCheck ? 'State' : 'CardHolderState', $builder->billingAddress->getProvince()) + ); + $holder->appendChild( + $xml->createElement($isCheck ? 'Zip' : 'CardHolderZip', $builder->billingAddress->postalCode) + ); + } + + $propertyName = $isCheck ? 'checkHolderName' : 'cardHolderName'; + if (!empty($builder->paymentMethod->{$propertyName})) { + $names = explode(' ', $builder->paymentMethod->{$propertyName}, 2); + $holder->appendChild( + $xml->createElement($isCheck ? 'FirstName' : 'CardHolderFirstName', $names[0]) + ); + + if (isset($names[1])) { $holder->appendChild( - $xml->createElement('FirstName', $names[0]) + $xml->createElement($isCheck ? 'LastName' : 'CardHolderLastName', $names[1]) ); - - if (isset($names[1])) { - $holder->appendChild( - $xml->createElement('LastName', $names[1]) - ); - } } + } + if ($isCheck) { if ($builder->paymentMethod->checkHolderName !== null) { $holder->appendChild($xml->createElement('CheckName', $builder->paymentMethod->checkHolderName)); } diff --git a/src/PaymentMethods/RecurringPaymentMethod.php b/src/PaymentMethods/RecurringPaymentMethod.php index f4f780cc..ec816934 100644 --- a/src/PaymentMethods/RecurringPaymentMethod.php +++ b/src/PaymentMethods/RecurringPaymentMethod.php @@ -6,6 +6,7 @@ use GlobalPayments\Api\Builders\AuthorizationBuilder; use GlobalPayments\Api\Entities\RecurringEntity; use GlobalPayments\Api\Entities\Enums\PaymentMethodType; +use GlobalPayments\Api\Entities\Exceptions\ArgumentException; use GlobalPayments\Api\Entities\Exceptions\UnsupportedTransactionException; use GlobalPayments\Api\Entities\Schedule; use GlobalPayments\Api\PaymentMethods\Interfaces\IAuthable; @@ -196,6 +197,10 @@ public function __get($name) switch ($name) { case 'paymentMethod': return $this->paymentMethod; + case 'cardHolderName': + return $this->nameOnAccount; + case 'checkHolderName': + return $this->nameOnAccount; default: break; } @@ -204,14 +209,22 @@ public function __get($name) return $this->{$name}; } - throw new ArgumentException(sprintf('Property `%s` does not exist on Transaction', $name)); + if ($this->paymentMethod && property_exists($this->paymentMethod, $name)) { + return $this->paymentMethod->{$name}; + } + + throw new ArgumentException(sprintf('Property `%s` does not exist on RecurringPaymentMethod', $name)); } public function __isset($name) { return in_array($name, [ - 'paymentMethod', - ]) || isset($this->{$name}); + 'paymentMethod', + 'cardHolderName', + 'checkHolderName', + ]) + || isset($this->{$name}) + || ($this->paymentMethod && isset($this->paymentMethod->{$name})); } public function __set($name, $value) diff --git a/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.php b/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.php index 3123dc17..c09bd45d 100644 --- a/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.php +++ b/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.php @@ -12,7 +12,9 @@ use GlobalPayments\Api\Entities\Enums\AccountType; use GlobalPayments\Api\Entities\Enums\CheckType; use GlobalPayments\Api\Entities\Enums\SecCode; +use GlobalPayments\Api\Entities\Enums\ScheduleFrequency; use GlobalPayments\Api\Entities\Exceptions\ApiException; +use GlobalPayments\Api\Entities\Exceptions\GatewayException; use GlobalPayments\Api\PaymentMethods\CreditCardData; use GlobalPayments\Api\PaymentMethods\ECheck; use GlobalPayments\Api\PaymentMethods\RecurringPaymentMethod; @@ -56,7 +58,7 @@ class RecurringTest extends TestCase /** @var Schedule */ private static $scheduleCheckCcd = null; - + private $enableCryptoUrl = true; /** @@ -94,32 +96,32 @@ protected function setup() ); } - // public function test000CleanUp() - // { - // try { - // $results = Schedule::findAll(); - // foreach ($results as $schedule) { - // $schedule->delete(true); - // } - // } catch (Exception $e) { - // } - - // try { - // $results = RecurringPaymentMethod::findAll(); - // foreach ($results as $paymentMethod) { - // $paymentMethod->delete(true); - // } - // } catch (Exception $e) { - // } - - // try { - // $results = Customer::findAll(); - // foreach ($results as $customer) { - // $customer->delete(true); - // } - // } catch (Exception $e) { - // } - // } + public function test000CleanUp() + { + try { + $results = Schedule::findAll(); + foreach ($results as $schedule) { + $schedule->delete(true); + } + } catch (\Exception $e) { + } + + try { + $results = RecurringPaymentMethod::findAll(); + foreach ($results as $paymentMethod) { + $paymentMethod->delete(true); + } + } catch (\Exception $e) { + } + + try { + $results = Customer::findAll(); + foreach ($results as $customer) { + $customer->delete(true); + } + } catch (\Exception $e) { + } + } // CUSTOMER SETUP @@ -144,6 +146,9 @@ public function test001AddCustomerPerson() $this->assertNotNull($customer); $this->assertNotNull($customer->key); static::$customerPerson = $customer; + + $found = Customer::find($customer->id); + $this->assertNotNull($found); } public function test002AddCustomerBusiness() @@ -165,7 +170,7 @@ public function test002AddCustomerBusiness() $this->assertNotNull($customer); $this->assertNotNull($customer->key); - static::$customerPerson = $customer; + static::$customerBusiness = $customer; } // PAYMENT METHOD SETUP @@ -222,10 +227,10 @@ public function test005AddPaymentCheckPpd() $check->accountType = AccountType::CHECKING; $check->checkType = CheckType::PERSONAL; $check->secCode = SecCode::PPD; - $check->routingNumber = '490000018'; + $check->routingNumber = '122000030'; $check->driversLicenseNumber = '7418529630'; $check->driversLicenseState = 'TX'; - $check->accountNumber = '24413815'; + $check->accountNumber = '1357902468'; $check->birthYear = 1989; $paymentMethod = static::$customerPerson->addPaymentMethod( @@ -248,10 +253,10 @@ public function test006AddPaymentCheckCcd() $check->accountType = AccountType::CHECKING; $check->checkType = CheckType::BUSINESS; $check->secCode = SecCode::CCD; - $check->routingNumber = '490000018'; + $check->routingNumber = '122000030'; $check->driversLicenseNumber = '7418529630'; $check->driversLicenseState = 'TX'; - $check->accountNumber = '24413815'; + $check->accountNumber = '1357902468'; $check->birthYear = 1989; $paymentMethod = static::$customerBusiness->addPaymentMethod( @@ -266,6 +271,9 @@ public function test006AddPaymentCheckCcd() // PAYMENT SETUP - DECLINED + /** + * expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function test007AddPaymentCheckPpd() { if (static::$customerPerson === null) { @@ -276,10 +284,10 @@ public function test007AddPaymentCheckPpd() $check->accountType = AccountType::CHECKING; $check->checkType = CheckType::PERSONAL; $check->secCode = SecCode::PPD; - $check->routingNumber = '490000018'; + $check->routingNumber = '122000030'; $check->driversLicenseNumber = '7418529630'; $check->driversLicenseState = 'TX'; - $check->accountNumber = '24413815'; + $check->accountNumber = '1357902468'; $check->birthYear = 1989; static::$customerPerson->addPaymentMethod( @@ -287,4 +295,266 @@ public function test007AddPaymentCheckPpd() $check )->create(); } + + // Recurring Billing using PayPlan - Managed Schedule + + public function test008AddScheduleCreditVisa() + { + if (static::$paymentMethodVisa === null) { + $this->markTestIncomplete(); + } + + $schedule = static::$paymentMethodVisa->addSchedule( + $this->getIdentifier('CreditV') + ) + ->withStatus('Active') + ->withAmount(30.02) + ->withCurrency('USD') + ->withStartDate(\DateTime::createFromFormat('Y-m-d', '2027-02-01')) + ->withFrequency(ScheduleFrequency::WEEKLY) + ->withEndDate(\DateTime::createFromFormat('Y-m-d', '2027-04-01')) + ->withReprocessingCount(2) + ->create(); + + $this->assertNotNull($schedule); + $this->assertNotNull($schedule->key); + static::$scheduleVisa = $schedule; + } + + public function test009AddScheduleCreditMasterCard() { + if (static::$paymentMethodMasterCard == null) { + $this->markTestIncomplete(); + } + + $schedule = static::$paymentMethodMasterCard->addSchedule( + $this->getIdentifier('CreditMC') + ) + ->withStatus('Active') + ->withAmount(30.02) + ->withCurrency('USD') + ->withStartDate(\DateTime::createFromFormat('Y-m-d', '2027-02-01')) + ->withFrequency(ScheduleFrequency::WEEKLY) + ->withEndDate(\DateTime::createFromFormat('Y-m-d', '2027-04-01')) + ->withReprocessingCount(2) + ->create(); + $this->assertNotNull($schedule); + $this->assertNotNull($schedule->key); + static::$scheduleMasterCard = $schedule; + } + + public function test010AddScheduleCheckPPD() { + if (static::$paymentMethodCheckPpd == null) { + $this->markTestIncomplete(); + } + + $schedule = static::$paymentMethodCheckPpd->addSchedule( + $this->getIdentifier('CheckPPD') + ) + ->withStatus('Active') + ->withAmount(30.03) + ->withCurrency('USD') + ->withStartDate(\DateTime::createFromFormat('Y-m-d', '2027-02-01')) + ->withFrequency(ScheduleFrequency::MONTHLY) + ->withReprocessingCount(1) + ->withNumberOfPayments(2) + ->create(); + $this->assertNotNull($schedule); + $this->assertNotNull($schedule->key); + static::$scheduleCheckPpd = $schedule; + } + + public function test011AddScheduleCheckCCD() { + if (static::$paymentMethodCheckCcd == null) { + $this->markTestIncomplete(); + } + + $schedule = static::$paymentMethodCheckCcd->addSchedule( + $this->getIdentifier('CheckCCD') + ) + ->withStatus('Active') + ->withAmount(30.04) + ->withCurrency('USD') + ->withStartDate(\DateTime::createFromFormat('Y-m-d', '2027-02-01')) + ->withFrequency(ScheduleFrequency::BI_WEEKLY) + ->withReprocessingCount(1) + ->create(); + $this->assertNotNull($schedule); + $this->assertNotNull($schedule->key); + static::$scheduleCheckCcd = $schedule; + } + + /** + * expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ + public function test012AddScheduleCreditVisa() { + if (static::$paymentMethodVisa == null) { + $this->markTestIncomplete(); + } + + $schedule = static::$paymentMethodVisa->addSchedule( + $this->getIdentifier('CreditV') + ) + ->withStartDate(\DateTime::createFromFormat('Y-m-d', '2027-02-01')) + ->withAmount(30.01) + ->withCurrency('USD') + ->withFrequency(ScheduleFrequency::WEEKLY) + ->withReprocessingCount(1) + ->withStatus('Active') + ->create(); + } + + /** + * expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ + public function test013AddScheduleCCheckPPD() { + if (static::$paymentMethodCheckPpd == null) { + $this->markTestIncomplete(); + } + + $schedule = static::$paymentMethodCheckPpd->addSchedule( + $this->getIdentifier('CheckPPD') + ) + ->withStatus('Active') + ->withAmount(30.03) + ->withCurrency('USD') + ->withStartDate(\DateTime::createFromFormat('Y-m-d', '2027-02-01')) + ->withFrequency(ScheduleFrequency::MONTHLY) + ->withReprocessingCount(1) + ->withNumberOfPayments(2) + ->create(); + } + + // Recurring Billing using PayPlan - Managed Schedule + + public function test014RecurringBillingVisa() { + if (static::$paymentMethodVisa == null || static::$scheduleVisa == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodVisa->charge(20.01) + ->withCurrency('USD') + ->withScheduleId(static::$scheduleVisa->key) + ->withOneTimePayment(false) + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + public function test015RecurringBillingMasterCard() { + if (true || static::$paymentMethodMasterCard == null || static::$scheduleMasterCard == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodMasterCard->charge(20.02) + ->withCurrency('USD') + ->withScheduleId(static::$scheduleVisa->key) + ->withOneTimePayment(false) + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + public function test016RecurringBillingCheckPPD() { + if (static::$paymentMethodCheckPpd == null || static::$scheduleCheckPpd == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodCheckPpd->charge(20.03) + ->withCurrency('USD') + ->withScheduleId(static::$scheduleVisa->key) + ->withOneTimePayment(false) + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + public function test017RecurringBillingCheckCCD() { + if (static::$paymentMethodCheckCcd == null || static::$scheduleCheckCcd == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodCheckCcd->charge(20.04) + ->withCurrency('USD') + ->withScheduleId(static::$scheduleVisa->key) + ->withOneTimePayment(false) + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + // One time bill payment + + public function test018RecurringBillingVisa() { + if (static::$paymentMethodVisa == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodVisa->charge(20.06) + ->withCurrency('USD') + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + public function test019RecurringBillingMasterCard() { + if (static::$paymentMethodMasterCard == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodMasterCard->charge(20.07) + ->withCurrency('USD') + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + public function test020RecurringBillingCheckPPD() { + if (static::$paymentMethodCheckPpd == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodCheckPpd->charge(20.08) + ->withCurrency('USD') + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + public function test021RecurringBillingCheckCCD() { + if (static::$paymentMethodCheckCcd == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodCheckCcd->charge(20.09) + ->withCurrency('USD') + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + } + + // Onetime bill payment - declined + + public function test022RecurringBillingVisa_Decline() { + if (static::$paymentMethodVisa == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodVisa->charge(10.08) + ->withCurrency('USD') + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('51', $response->responseCode); + } + + public function test023RecurringBillingCheckPPD_Decline() { + if (true || static::$paymentMethodCheckPpd == null) { + $this->markTestIncomplete(); + } + + $response = static::$paymentMethodCheckPpd->charge(25.02) + ->withCurrency('USD') + ->execute(); + $this->assertNotNull($response); + $this->assertEquals('1', $response->responseCode); + } } diff --git a/test/Integration/Gateways/PorticoConnector/PorticoReportingTests.php b/test/Integration/Gateways/PorticoConnector/PorticoReportingTests.php index 56db4066..4d8e44db 100644 --- a/test/Integration/Gateways/PorticoConnector/PorticoReportingTests.php +++ b/test/Integration/Gateways/PorticoConnector/PorticoReportingTests.php @@ -87,10 +87,26 @@ public function testReportTransactionDetail() $response = $this->reportingService->transactionDetail("1088532284")->execute(); $this->assertNotNull($response); } + + public function testReportCardHolderName() + { + $gateway_response = $this->card->charge(10) + ->withCurrency('USD') + ->execute(); + + $response = $this->reportingService->transactionDetail($gateway_response->transactionId)->execute(); + + $this->assertEquals('Joe', $response->cardHolderFirstName); + $this->assertEquals('Smith', $response->cardHolderLastName); + } public function testReportFindTransactionWithTransactionId() { - $response = $this->reportingService->findTransactions("1088526532")->execute(); + $gateway_response = $this->card->charge(10) + ->withCurrency('USD') + ->execute(); + + $response = $this->reportingService->findTransactions($gateway_response->transactionId)->execute(); $this->assertNotNull($response); } diff --git a/test/Integration/Gateways/RealexConnector/RealexApmTest.php b/test/Integration/Gateways/RealexConnector/RealexApmTest.php index 228664b4..f696c6b7 100644 --- a/test/Integration/Gateways/RealexConnector/RealexApmTest.php +++ b/test/Integration/Gateways/RealexConnector/RealexApmTest.php @@ -16,8 +16,8 @@ class RealexApmTest extends TestCase { protected function config() { $config = new ServicesConfig(); - $config->merchantId = "realexprepro3"; - $config->accountId = "apmtesttest"; + $config->merchantId = "heartlandgpsandbox"; + $config->accountId = "hpp"; $config->rebatePassword = 'refund'; $config->refundPassword = 'refund'; $config->sharedSecret = "secret";