Skip to content

Commit

Permalink
Adds some methods to get registration information
Browse files Browse the repository at this point in the history
  • Loading branch information
bryangruneberg committed Feb 4, 2019
1 parent a4538f9 commit 7af214c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Traits/InteractsWithCheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ public function isPrepareCheckoutSuccess(OPPWAResponse $response)
{
return $response->getResultCode() === OPPWAResponseCode::CREATED_CHECKOUT;
}

public function getCheckoutRegistration($checkoutId)
{
$url = OPPWA::URL_CHECKOUTS . '/' . $checkoutId . '/registration';
$response = $this->getClient()->doGet($url);
return $response;
}
}
2 changes: 2 additions & 0 deletions tests/OPPWAIntegration/InteractsWithCheckoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ public function testPrepareCheckoutForRecurringReturnsValidResponse()
$checkoutResponse = $api->prepareCheckout(10, 'ZAR', OPPWA::PAYMENT_TYPE_DEBIT, $recurringOptions);
$this->assertTrue($api->isPrepareCheckoutSuccess($checkoutResponse), 'The checkout returned ' . $checkoutResponse->getResultCode() . ' instead of ' . OPPWAResponseCode::CREATED_CHECKOUT);
$this->assertGreaterThanOrEqual(1, strlen($checkoutResponse->getId()));

$registerResponse = $api->getCheckoutRegistration($checkoutResponse->getId());
}
}

0 comments on commit 7af214c

Please sign in to comment.