Skip to content
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

Added new updated API url's and fixed up tests. #12

Merged
merged 5 commits into from
May 25, 2018
Merged

Added new updated API url's and fixed up tests. #12

merged 5 commits into from
May 25, 2018

Conversation

sudiptpa
Copy link
Contributor

No description provided.

@sudiptpa
Copy link
Contributor Author

sudiptpa commented Mar 26, 2017

@joshbenham Tests are green in my local end, but failed in travis build, could you please help. It says like below:

There were 2 errors:
1) Omnipay\SecurePay\Message\SecureXMLAuthorizeRequestTest::testSendFailure
Guzzle\Common\Exception\InvalidArgumentException: Unable to open mock file: /home/travis/build/thephpleague/omnipay-securepay/tests/Message/Mock/SecureXMLAuthorizeRequestFailure.txt
/home/travis/build/thephpleague/omnipay-securepay/vendor/guzzle/guzzle/src/Guzzle/Plugin/Mock/MockPlugin.php:73
/home/travis/build/thephpleague/omnipay-securepay/vendor/omnipay/tests/src/Omnipay/Tests/TestCase.php:89
/home/travis/build/thephpleague/omnipay-securepay/vendor/omnipay/tests/src/Omnipay/Tests/TestCase.php:117
/home/travis/build/thephpleague/omnipay-securepay/tests/Message/SecureXMLAuthorizeRequestTest.php:47
2) Omnipay\SecurePay\Message\SecureXMLAuthorizeRequestTest::testInsufficientFundsFailure
Guzzle\Common\Exception\InvalidArgumentException: Unable to open mock file: /home/travis/build/thephpleague/omnipay-securepay/tests/Message/Mock/SecureXMLAuthorizeRequestInsufficientFundsFailure.txt
/home/travis/build/thephpleague/omnipay-securepay/vendor/guzzle/guzzle/src/Guzzle/Plugin/Mock/MockPlugin.php:73
/home/travis/build/thephpleague/omnipay-securepay/vendor/omnipay/tests/src/Omnipay/Tests/TestCase.php:89
/home/travis/build/thephpleague/omnipay-securepay/vendor/omnipay/tests/src/Omnipay/Tests/TestCase.php:117
/home/travis/build/thephpleague/omnipay-securepay/tests/Message/SecureXMLAuthorizeRequestTest.php:60

@sudiptpa
Copy link
Contributor Author

@delatbabel @joshbenham with the recent updated doc from Secure Pay

Document Control
This is a control document
DESCRIPTION
Direct Post Integration Guide
CREATION DATE 20/12/2011 CREATED BY SecurePay
VERSION 1.4 DATE UPDATED 28/02/2017
CHANGES 1.4
 New Production and Test URLs
 Updated from SHA1 to SHA256 fingerprints

They are saying, they have updated hashing mechanism from SHA1 to SHA256 fingerprints, i tried to use hash('sha256', $fingerprint) it says Invalid Fingerprint. Latest updated urls still accepting sha1 for me.

@sudiptpa
Copy link
Contributor Author

sudiptpa commented Mar 26, 2017

I am getting Approved with test urls with sha1

array (size=12)
  'settdate' => string '20170327' (length=8)
  'expirydate' => string '52017' (length=5)
  'callback_status_code' => string '-1' (length=2)
  'restext' => string 'Approved' (length=8)
  'fingerprint' => string '5844b65b60df7894fec69a9a1dd515f2794657d8' (length=40)
  'merchant' => string 'ABC0010' (length=7)
  'refid' => string '18' (length=2)
  'pan' => string '444433...111' (length=12)
  'summarycode' => string '1' (length=1)
  'rescode' => string '00' (length=2)
  'txnid' => string '667575' (length=6)
  'timestamp' => string '20170326155457' (length=14)

Still getting the fingerprint different so its throwing an exception.

HELP
Invalid fingerprint
\vendor\omnipay\securepay\src\Message\DirectPostCompletePurchaseRequest.php
class DirectPostCompletePurchaseRequest extends DirectPostAbstractRequest
{
    public function getData()
    {
        $data = $this->httpRequest->query->all();
 
        if ($this->generateResponseFingerprint($data) !== $this->httpRequest->query->get('fingerprint')) {
            throw new InvalidRequestException('Invalid fingerprint');
        }

@sudiptpa
Copy link
Contributor Author

Contacted technical support at SecurePay to know about the sha256 i will update the PR accordingly.

@sudiptpa
Copy link
Contributor Author

sudiptpa commented Mar 28, 2017

From SecurePay support:

SHA256 is not currently supported on the test environment due to an issue we are working on. For now, please use SHA1 to hash the fingerprint until further notice. Apologies for the inconvenience.

SHA1 works with all of the endpoints for now (a notification will be sent to you before SHA1 is disabled).

Can you confirm if you're using the following URL to send payment requests to? https://api.securepay.com.au/directpost/authorise

And with https://api.securepay.com.au/directpost/authoriseit is working fine for me in live.

@delatbabel
Copy link
Contributor

OK this is green on travis but I'm a bit concerned about the SHA1/SHA256 comment above. Is this ready to merge or not?

@delatbabel
Copy link
Contributor

Also I think this obsoletes #11 -- can you please confirm?

@delatbabel delatbabel mentioned this pull request Apr 9, 2017
@sudiptpa
Copy link
Contributor Author

sudiptpa commented Apr 9, 2017

@delatbabel Let's wait until we hear back from Secure Pay again, they are still working on the upgrade to SHA256, and current production are still fine with the SHA1 hashing. I will update the PR later to use the SHA256 hashing.

@sudiptpa
Copy link
Contributor Author

sudiptpa commented Apr 9, 2017

@delatbabel Also upgrading to SHA256 will need update to tests as well. Will update later once we get notice from SecurePay officials.

@delatbabel
Copy link
Contributor

Noted, thanks for the update.

@barryvdh
Copy link
Member

Can we combine this with a release for Omnipay v3?

@sudiptpa
Copy link
Contributor Author

@barryvdh Yep the PR is valid to merge, the team has already finalized the end points on test env, see the official doc - https://www.securepay.com.au/tlsv1-2-upgrade-information

@barryvdh barryvdh merged commit e190c2d into thephpleague:master May 25, 2018
@sudiptpa sudiptpa deleted the fix/api-url-update branch May 25, 2018 07:34
@barryvdh
Copy link
Member

Did you use this in production? Should I tag a new release?

@barryvdh
Copy link
Member

I can tag this as v2.2 and if you want, you can create a PR to upgrade it to Omnipay v3: https://omnipay.thephpleague.com/changelog/

@sudiptpa
Copy link
Contributor Author

@barryvdh We are using in our production, and the new endpoint changes worked well on both production, sandbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants