-
Notifications
You must be signed in to change notification settings - Fork 24
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
base: master
Are you sure you want to change the base?
Conversation
Hi James, thanks for the pull request. Before I merge this, can you outline what scenarios the |
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 |
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 |
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.