-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PP-7001: Extend PHP SDK with possibility to send transaction confirma…
…tion mail to recipient
- Loading branch information
Showing
3 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
spl_autoload_register(function ($class) { | ||
$root = dirname(__DIR__); | ||
$classFile = $root . '/lib/' . str_replace('\\', '/', $class) . '.php'; | ||
if (file_exists($classFile)) { | ||
require_once $classFile; | ||
} | ||
}); | ||
|
||
// $instanceName is a part of the url where you access your payrexx installation. | ||
// https://{$instanceName}.payrexx.com | ||
$instanceName = 'YOUR_INSTANCE_NAME'; | ||
|
||
// $secret is the payrexx secret for the communication between the applications | ||
// if you think someone got your secret, just regenerate it in the payrexx administration | ||
$secret = 'YOUR_SECRET'; | ||
|
||
$payrexx = new \Payrexx\Payrexx($instanceName, $secret); | ||
|
||
$transaction = new \Payrexx\Models\Request\Transaction(); | ||
$transaction->setId(1); | ||
$transaction->setRecipient('recipient@gmail.com'); | ||
|
||
try { | ||
$response = $payrexx->receipt($transaction); | ||
var_dump($response); | ||
} catch (\Payrexx\PayrexxException $e) { | ||
print $e->getMessage(); | ||
} |
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