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

Allow a user to change the API endpoint and get the raw XML response #17

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

James-Byrne
Copy link

Changes

function : getXML
Returns the xml response received from the Realex API. This returns far more informaiton to the user such as authcodes and batchIds.

functions : setEndPoint
Allow the user to set the url that the request should be made too. This is set before purchase is called similar to setMerchantId etc. If not set it will use the default endpoint.

@coatesap
Copy link

coatesap commented Oct 7, 2016

Hi James, thanks for the pull request. Before I merge this, can you outline what scenarios the setEndPoint() method would be used in?

@James-Byrne
Copy link
Author

Hi @coatesap, my scenario is related to a product I am working on at work. We are building a payments testing simulator, basically it allows you to test your application against a number of scenarios that you may encounter in the real world. Such as failing transactions, timeouts, integrating with a number of payment processors etc.

One of the things we want to do is provide a set of examples using existing applications/open source projects. For our Realex & PHP demo app we are using your library but in order to send the requests to our app we need to set a different endpoint. Below is a snippet of a demo api we built and will be making OSS soon.

// Get an instance of the gateway
$gateway = Omnipay::create('Realex_Remote');

$gateway->setEndPoint('https://ourwebsite/realex/v1/auth');
$gateway->setMerchantId('Your MerchantID / TestingPays API key');
$gateway->setAccount('Your Realex Account');
$gateway->setSecret('Your Realex Password');

If you want to check us out we currently don't have a website for TestingPays but our company website is at thepayment.works

@lewisvgd
Copy link
Contributor

lewisvgd commented Nov 2, 2016

The XML part can be done using the getData method (see the bottom of http://omnipay.thephpleague.com/changelog/). While the docs getdata returns an array, this plugin returns XML as the payload is XML

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