-
Notifications
You must be signed in to change notification settings - Fork 24
Added ability to change endpoint urls #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
3dgroup
wants to merge
33
commits into
digitickets:master
Choose a base branch
from
3dgroup:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
4daf2f7
Added ability to change endpoint urls
3dgroup 49d9807
changed opening brace to new lines
3dgroup 4b467bc
updated closing brace position
3dgroup d6d40ee
Added Realex PayandShop.com default values
3dgroup 31cf30b
changed formatting and removed comments
3dgroup ec574a3
removed commented line
3dgroup 4a8f35b
xml text node coding problem bugfix
746a6fe
replace tabs to 4 spaces
0f14eb8
tidy changes
8543016
RemoteAbstractRequest Amount node currency attribute value convert wa…
6abd1d3
added space after comma
be85459
added Redirect features
3dgroup a7c887c
Merge remote-tracking branch 'refs/remotes/digitickets/master'
3dgroup a0c0b24
format code
3dgroup ddef3d6
cs fixer update
3dgroup c40724a
Format fix's
3dgroup dc32d8e
more formatting
3dgroup 8b929e4
formatting issue
3dgroup 53e342d
formatting
3dgroup bad47ad
format issue
3dgroup 0802aab
Multi line format issue
3dgroup 948b737
formatting
3dgroup 3b83247
formatting issue
3dgroup 71ecb9a
formatting last attempt
3dgroup d270e3c
Code Tidy
3dgroup cab2de2
Merge remote-tracking branch 'refs/remotes/digitickets/master'
3dgroup 4072174
Merge remote-tracking branch 'origin/master'
3dgroup 6a9b41e
Rename response.php to Response.php
3dgroup 6e6e542
Add script timeout
3dgroup 3a45694
Merge branch 'digitickets:master' into master
3dgroup d534dac
Update dataVaultResponse.php
3dgroup 1e71f28
Update RedirectCompleteStoreCardRequest.php
3dgroup 23333f8
Update RemoteAbstractRequest.php
3dgroup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -3,3 +3,5 @@ composer.lock | |
composer.phar | ||
phpunit.xml | ||
.idea | ||
/nbproject/private/ | ||
.php_cs.cache |
This file contains hidden or 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 hidden or 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 hidden or 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,16 +1,14 @@ | ||
<?php | ||
|
||
/** | ||
* @author Philip Wright- Christie <[email protected]> | ||
* Date: 04/08/15 | ||
*/ | ||
|
||
namespace Omnipay\Realex\Message; | ||
|
||
|
||
class CreateCardRequest extends RemoteAbstractRequest | ||
{ | ||
protected $endpoint = 'https://epage.payandshop.com/epage-remote-plugins.cgi'; | ||
|
||
public function getCustomerRef() | ||
{ | ||
return $this->getParameter('customerRef'); | ||
|
@@ -24,21 +22,21 @@ public function setCustomerRef($customerRef) | |
public function getData() | ||
{ | ||
// Create the hash | ||
$timestamp = strftime("%Y%m%d%H%M%S"); | ||
$timestamp = strftime("%Y%m%d%H%M%S"); | ||
$merchantId = $this->getMerchantId(); | ||
$orderId = $this->getTransactionId(); | ||
$secret = $this->getSecret(); | ||
$payerRef = $this->getCustomerRef(); | ||
$orderId = $this->getTransactionId(); | ||
$secret = $this->getSecret(); | ||
$payerRef = $this->getCustomerRef(); | ||
|
||
/** | ||
* @var \Omnipay\Common\CreditCard $card | ||
*/ | ||
$card = $this->getCard(); | ||
|
||
//$tmp = "$timestamp.$merchantId.$orderId.$amount.$currency.$payerRef"; | ||
$tmp = "$timestamp.$merchantId.$orderId...$payerRef.{$card->getBillingName()}.{$card->getNumber()}"; | ||
$tmp = "$timestamp.$merchantId.$orderId...$payerRef.{$card->getBillingName()}.{$card->getNumber()}"; | ||
$sha1hash = sha1($tmp); | ||
$tmp2 = "$sha1hash.$secret"; | ||
$tmp2 = "$sha1hash.$secret"; | ||
$sha1hash = sha1($tmp2); | ||
|
||
$domTree = new \DOMDocument('1.0', 'UTF-8'); | ||
|
@@ -50,39 +48,49 @@ public function getData() | |
$root = $domTree->appendChild($root); | ||
|
||
// merchant ID | ||
$merchantEl = $domTree->createElement('merchantid', $merchantId); | ||
$merchantEl = $domTree->createElement('merchantid'); | ||
$merchantEl->appendChild($domTree->createTextNode($merchantId)); | ||
$root->appendChild($merchantEl); | ||
|
||
// order ID | ||
$merchantEl = $domTree->createElement('orderid', $orderId); | ||
$merchantEl = $domTree->createElement('orderid'); | ||
$merchantEl->appendChild($domTree->createTextNode($orderId)); | ||
$root->appendChild($merchantEl); | ||
|
||
$cardEl = $domTree->createElement('card'); | ||
|
||
$cardRefEl = $domTree->createElement('ref', $this->getCardReference()); | ||
$cardRefEl = $domTree->createElement('ref'); | ||
$cardRefEl->appendChild($domTree->createTextNode($this->getCardReference())); | ||
$cardEl->appendChild($cardRefEl); | ||
|
||
$payerRefEl = $domTree->createElement('payerref', $this->getCustomerRef()); | ||
$payerRefEl = $domTree->createElement('payerref'); | ||
$payerRefEl->appendChild($domTree->createTextNode($this->getCustomerRef())); | ||
$cardEl->appendChild($payerRefEl); | ||
|
||
$numberEl = $domTree->createElement('number', $card->getNumber()); | ||
$numberEl = $domTree->createElement('number'); | ||
$numberEl->appendChild($domTree->createTextNode($card->getNumber())); | ||
$cardEl->appendChild($numberEl); | ||
|
||
$expDateEl = $domTree->createElement('expdate', $card->getExpiryDate("my")); | ||
$expDateEl = $domTree->createElement('expdate'); | ||
$expDateEl->appendChild($domTree->createTextNode($card->getExpiryDate("my"))); | ||
$cardEl->appendChild($expDateEl); | ||
|
||
$chNameEl = $domTree->createElement('chname', $card->getBillingName()); | ||
$chNameEl = $domTree->createElement('chname'); | ||
$chNameEl->appendChild($domTree->createTextNode($card->getBillingName())); | ||
$cardEl->appendChild($chNameEl); | ||
|
||
$typeEl = $domTree->createElement('type', $this->getCardBrand()); | ||
$typeEl = $domTree->createElement('type'); | ||
$typeEl->appendChild($domTree->createTextNode($this->getCardBrand())); | ||
$cardEl->appendChild($typeEl); | ||
|
||
$issueNoEl = $domTree->createElement('issueno', $card->getIssueNumber()); | ||
$issueNoEl = $domTree->createElement('issueno'); | ||
$issueNoEl->appendChild($domTree->createTextNode($card->getIssueNumber())); | ||
$cardEl->appendChild($issueNoEl); | ||
|
||
$root->appendChild($cardEl); | ||
|
||
$sha1El = $domTree->createElement('sha1hash', $sha1hash); | ||
$sha1El = $domTree->createElement('sha1hash'); | ||
$sha1El->appendChild($domTree->createTextNode($sha1hash)); | ||
$root->appendChild($sha1El); | ||
|
||
$xmlString = $domTree->saveXML($root); | ||
|
@@ -97,6 +105,11 @@ protected function createResponse($data) | |
|
||
public function getEndpoint() | ||
{ | ||
return $this->endpoint; | ||
return $this->getParameter('AuthEndpoint'); | ||
} | ||
|
||
public function setAuthEndpoint($value) | ||
{ | ||
return $this->setParameter('AuthEndpoint', $value); | ||
} | ||
} |
This file contains hidden or 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,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* @author Philip Wright- Christie <[email protected]> | ||
* Date: 04/08/15 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not make more sense to leave the endpoint property in place, and allow the setter and getter to set it/access it? Also by removing it will break the existing Global Iris driver, which extends these requests (see https://github.com/coatesap/omnipay-global-iris/blob/master/src/Omnipay/GlobalIris/Message/AuthRequest.php for example). If there is no real reason to remove it, I'd rather not have to remove/upgrade/lock down the Global Iris driver...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sort of agree with this implementation. This makes it possible to inject the parameters at the configuration stage (as per the merchant ID etc). Obviously the omnipay interfaces need to be adhered to so this results in not being able to explicitly pass the endpoint other than in the params.