Skip to content

Commit

Permalink
Merge pull request #4 from payrexx/gateway
Browse files Browse the repository at this point in the history
express checkout renamed to (payrexx) gateway
  • Loading branch information
ukramer authored Oct 18, 2016
2 parents fc7ec9e + d6e52cb commit bc83be9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
40 changes: 20 additions & 20 deletions examples/ExpressCheckoutCreate.php → examples/GatewayCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,46 @@

$payrexx = new \Payrexx\Payrexx($instanceName, $secret);

$expressCheckout = new \Payrexx\Models\Request\ExpressCheckout();
$gateway = new \Payrexx\Models\Request\Gateway();

// amount multiplied by 100
$expressCheckout->setAmount(89.25 * 100);
$gateway->setAmount(89.25 * 100);

// currency ISO code
$expressCheckout->setCurrency('CHF');
$gateway->setCurrency('CHF');

//success and failed url in case that merchant redirects to payment site instead of using the modal view
$expressCheckout->setSuccessRedirectUrl('https://www.merchant-website.com/success');
$expressCheckout->setFailedRedirectUrl('https://www.merchant-website.com/failed');
$gateway->setSuccessRedirectUrl('https://www.merchant-website.com/success');
$gateway->setFailedRedirectUrl('https://www.merchant-website.com/failed');

// optional: payment service provider(s) to use (see http://developers.payrexx.com/docs/miscellaneous)
// empty array = all available psps
$expressCheckout->setPsp(array());
$gateway->setPsp(array());

// optional: reference id of merchant (e. g. order number)
$expressCheckout->setReferenceId(975382);
$gateway->setReferenceId(975382);

// optional: add contact information which should be stored along with payment
$expressCheckout->addField($type = 'title', $value = 'mister');
$expressCheckout->addField($type = 'forename', $value = 'Maximilian');
$expressCheckout->addField($type = 'surname', $value = 'Pichler');
$expressCheckout->addField($type = 'company', $value = 'Pichler Solutions');
$expressCheckout->addField($type = 'street', $value = 'Seeweg 123');
$expressCheckout->addField($type = 'postcode', $value = '1234');
$expressCheckout->addField($type = 'place', $value = 'Englach');
$expressCheckout->addField($type = 'country', $value = 'AT');
$expressCheckout->addField($type = 'phone', $value = '+43123456789');
$expressCheckout->addField($type = 'email', $value = 'info@pichler-solutions.com');
$expressCheckout->addField($type = 'date_of_birth', $value = '03.06.1985');
$expressCheckout->addField($type = 'custom_field_1', $value = '123456789', $name = array(
$gateway->addField($type = 'title', $value = 'mister');
$gateway->addField($type = 'forename', $value = 'Maximilian');
$gateway->addField($type = 'surname', $value = 'Pichler');
$gateway->addField($type = 'company', $value = 'Pichler Solutions');
$gateway->addField($type = 'street', $value = 'Seeweg 123');
$gateway->addField($type = 'postcode', $value = '1234');
$gateway->addField($type = 'place', $value = 'Englach');
$gateway->addField($type = 'country', $value = 'AT');
$gateway->addField($type = 'phone', $value = '+43123456789');
$gateway->addField($type = 'email', $value = 'info@pichler-solutions.com');
$gateway->addField($type = 'date_of_birth', $value = '03.06.1985');
$gateway->addField($type = 'custom_field_1', $value = '123456789', $name = array(
1 => 'Benutzerdefiniertes Feld (DE)',
2 => 'Benutzerdefiniertes Feld (EN)',
3 => 'Benutzerdefiniertes Feld (FR)',
4 => 'Benutzerdefiniertes Feld (IT)',
));

try {
$response = $payrexx->create($expressCheckout);
$response = $payrexx->create($gateway);
var_dump($response);
} catch (\Payrexx\PayrexxException $e) {
print $e->getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

$payrexx = new \Payrexx\Payrexx($instanceName, $secret);

$expressCheckout = new \Payrexx\Models\Request\ExpressCheckout();
$expressCheckout->setId(1);
$gateway = new \Payrexx\Models\Request\Gateway();
$gateway->setId(1);

try {
$response = $payrexx->delete($expressCheckout);
$response = $payrexx->delete($gateway);
var_dump($response);
} catch (\Payrexx\PayrexxException $e) {
print $e->getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

$payrexx = new \Payrexx\Payrexx($instanceName, $secret);

$expressCheckout = new \Payrexx\Models\Request\ExpressCheckout();
$expressCheckout->setId(1);
$gateway = new \Payrexx\Models\Request\Gateway();
$gateway->setId(1);

try {
$response = $payrexx->getOne($expressCheckout);
$response = $payrexx->getOne($gateway);
var_dump($response);
} catch (\Payrexx\PayrexxException $e) {
print $e->getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Payrexx\Models\Request;

/**
* Express Checkout request class
* Gateway request class
*
* @copyright Payrexx AG
* @author Payrexx Development Team <info@payrexx.com>
* @package \Payrexx\Models\Request
*/
class ExpressCheckout extends \Payrexx\Models\Base
class Gateway extends \Payrexx\Models\Base
{

/**
Expand Down Expand Up @@ -228,7 +228,7 @@ public function setFailedRedirectUrl($failedRedirectUrl)
*/
public function getResponseModel()
{
return new \Payrexx\Models\Response\ExpressCheckout();
return new \Payrexx\Models\Response\Gateway();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Payrexx\Models\Response;

/**
* Express Checkout response class
* Gateway response class
*
* @copyright Payrexx AG
* @author Payrexx Development Team <info@payrexx.com>
* @package \Payrexx\Models\Response
*/
class ExpressCheckout extends \Payrexx\Models\Request\ExpressCheckout
class Gateway extends \Payrexx\Models\Request\Gateway
{

/**
Expand Down

0 comments on commit bc83be9

Please sign in to comment.