-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c01312
commit 7709729
Showing
38 changed files
with
384 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
require_once('../../../autoload_standalone.php'); | ||
|
||
use GlobalPayments\Api\ServiceConfigs\Gateways\GpEcomConfig; | ||
use GlobalPayments\Api\Services\HostedService; | ||
use GlobalPayments\Api\Entities\Exceptions\ApiException; | ||
|
||
// configure client settings | ||
$config = new GpEcomConfig(); | ||
$config->merchantId = "heartlandgpsandbox"; | ||
$config->accountId = "hpp"; | ||
$config->sharedSecret = "secret"; | ||
$config->serviceUrl = "https://pay.sandbox.realexpayments.com/pay"; | ||
|
||
$service = new HostedService($config); | ||
|
||
/* | ||
* Response JSON comes from Global Payments | ||
* sample response JSON (values will be Base64 encoded): | ||
* $responseJson ='{"MERCHANT_ID":"MerchantId","ACCOUNT":"internet","ORDER_ID":"GTI5Yxb0SumL_TkDMCAxQA","AMOUNT":"1999",' . | ||
* '"TIMESTAMP":"20170725154824","SHA1HASH":"843680654f377bfa845387fdbace35acc9d95778","RESULT":"00","AUTHCODE":"12345",' . | ||
* '"CARD_PAYMENT_BUTTON":"Place Order","AVSADDRESSRESULT":"M","AVSPOSTCODERESULT":"M","BATCHID":"445196",' . | ||
* '"MESSAGE":"[ test system ] Authorised","PASREF":"15011597872195765","CVNRESULT":"M","HPP_FRAUDFILTER_RESULT":"PASS"}"; | ||
*/ | ||
$responseJson = json_encode($_REQUEST); | ||
|
||
try { | ||
// create the response object from the response JSON | ||
$parsedResponse = $service->parseResponse($responseJson); | ||
|
||
$orderId = $parsedResponse->orderId; // GTI5Yxb0SumL_TkDMCAxQA | ||
$responseCode = $parsedResponse->responseCode; // 00 | ||
$responseMessage = $parsedResponse->responseMessage; // [ test system ] Authorised | ||
$responseValues = $parsedResponse->responseValues; // get values accessible by key | ||
echo "<pre>"; | ||
echo "Response Code : " . !empty($responseCode) ? $responseCode : ""; | ||
echo "\n Response Message : " . !empty($responseMessage) ? $responseMessage : ""; | ||
echo "\n Response Values : "; | ||
if (!empty($responseValues)) | ||
print_r($responseValues); | ||
} catch (ApiException $e) { | ||
print_r($e); | ||
// For example if the SHA1HASH doesn't match what is expected | ||
// TODO: add your error handling here | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<xml> | ||
<releaseNumber>10.0.1</releaseNumber> | ||
<releaseNumber>10.0.2</releaseNumber> | ||
</xml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.