diff --git a/.gitignore b/.gitignore
index 8a282a5..3ab779d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,9 @@
composer.lock
composer.phar
phpunit.xml
+/.idea
+/documents
+.directory
+dirlist.app
+dirlist.cache
+dirlist.vendor
diff --git a/README.md b/README.md
index 21c17bf..d043fde 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,9 @@
[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment
processing library for PHP 5.3+. This package implements eWAY support for Omnipay.
+[eWay](https://eway.io/about-eway) was launched in Australia in 1998 and now operates payment gateways
+in 8 countries.
+
## Installation
Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it
@@ -31,10 +34,19 @@ And run composer to update your dependencies:
The following gateways are provided by this package:
-* Eway_Rapid
-* Eway_RapidShared
-* Eway_RapidDirect
-* Eway_Direct
+* Eway_Direct -- This gateway is deprecated. If you have existing code that uses it you can continue
+ to do so but you should consider migrating to Eway_RapidDirect
+* Eway_RapidDirect -- This is the primary gateway used for direct card processing, i.e. where you collect the
+ card details from the customer and pass them to eWay yourself via the API.
+* Eway_Rapid -- This is used for eWAY Rapid Transparent Redirect requests. The gateway is just
+ called Eway_Rapid as it was the first implemented. Like other redirect gateways the purchase() call
+ will return a redirect response and then requires you to redirect the customer to the eWay site for
+ the actual purchase.
+* Eway_RapidShared -- This provides a hosted form for entering payment information, other than that
+ it is similar to the Eway_Rapid gateway in functionality.
+
+See the docblocks within the gateway classes for further information and links to the eWay gateway on
+line.
For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)
repository.
diff --git a/makedoc.sh b/makedoc.sh
new file mode 100755
index 0000000..e69b9ed
--- /dev/null
+++ b/makedoc.sh
@@ -0,0 +1,146 @@
+#!/bin/sh
+
+#
+# Smart little documentation generator.
+# GPL/LGPL
+# (c) Del 2015 http://www.babel.com.au/
+#
+
+APPNAME='Omnipay eWay Gateway Module'
+CMDFILE=apigen.cmd.$$
+DESTDIR=./documents
+
+#
+# Find apigen, either in the path or as a local phar file
+#
+if [ -f apigen.phar ]; then
+ APIGEN="php apigen.phar"
+
+else
+ APIGEN=`which apigen`
+ if [ ! -f "$APIGEN" ]; then
+
+ # Search for phpdoc if apigen is not found.
+ if [ -f phpDocumentor.phar ]; then
+ PHPDOC="php phpDocumentor.phar"
+
+ else
+ PHPDOC=`which phpdoc`
+ if [ ! -f "$PHPDOC" ]; then
+ echo "Neither apigen nor phpdoc is installed in the path or locally, please install one of them"
+ echo "see http://www.apigen.org/ or http://www.phpdoc.org/"
+ exit 1
+ fi
+ fi
+ fi
+fi
+
+#
+# As of version 4 of apigen need to use the generate subcommand
+#
+if [ ! -z "$APIGEN" ]; then
+ APIGEN="$APIGEN generate"
+fi
+
+#
+# Without any arguments this builds the entire system documentation,
+# making the cache file first if required.
+#
+if [ -z "$1" ]; then
+ #
+ # Check to see that the cache has been made.
+ #
+ if [ ! -f dirlist.cache ]; then
+ echo "Making dirlist.cache file"
+ $0 makecache
+ fi
+
+ #
+ # Build the apigen/phpdoc command in a file.
+ #
+ if [ ! -z "$APIGEN" ]; then
+ echo "$APIGEN --php --tree --title '$APPNAME API Documentation' --destination $DESTDIR/main \\" > $CMDFILE
+ cat dirlist.cache | while read dir; do
+ echo "--source $dir \\" >> $CMDFILE
+ done
+ echo "" >> $CMDFILE
+
+ elif [ ! -z "$PHPDOC" ]; then
+ echo "$PHPDOC --sourcecode --title '$APPNAME API Documentation' --target $DESTDIR/main --directory \\" > $CMDFILE
+ cat dirlist.cache | while read dir; do
+ echo "${dir},\\" >> $CMDFILE
+ done
+ echo "" >> $CMDFILE
+
+ else
+ "Neither apigen nor phpdoc are found, how did I get here?"
+ exit 1
+ fi
+
+ #
+ # Run the apigen command
+ #
+ rm -rf $DESTDIR/main
+ mkdir -p $DESTDIR/main
+ . ./$CMDFILE
+
+ /bin/rm -f ./$CMDFILE
+
+#
+# The "makecache" argument causes the script to just make the cache file
+#
+elif [ "$1" = "makecache" ]; then
+ echo "Find application source directories"
+ find src -name \*.php -print | \
+ (
+ while read file; do
+ grep -q 'class' $file && dirname $file
+ done
+ ) | sort -u | \
+ grep -v -E 'config|docs|migrations|phpunit|test|Test|views|web' > dirlist.app
+
+ echo "Find vendor source directories"
+ find vendor -name \*.php -print | \
+ (
+ while read file; do
+ grep -q 'class' $file && dirname $file
+ done
+ ) | sort -u | \
+ grep -v -E 'config|docs|migrations|phpunit|codesniffer|test|Test|views' > dirlist.vendor
+
+ #
+ # Filter out any vendor directories for which apigen fails
+ #
+ echo "Filter source directories"
+ mkdir -p $DESTDIR/tmp
+ cat dirlist.app dirlist.vendor | while read dir; do
+ if [ ! -z "$APIGEN" ]; then
+ $APIGEN --quiet --title "Test please ignore" \
+ --source $dir \
+ --destination $DESTDIR/tmp && (
+ echo "Including $dir"
+ echo $dir >> dirlist.cache
+ ) || (
+ echo "Excluding $dir"
+ )
+
+ elif [ ! -z "$PHPDOC" ]; then
+ $PHPDOC --quiet --title "Test please ignore" \
+ --directory $dir \
+ --target $DESTDIR/tmp && (
+ echo "Including $dir"
+ echo $dir >> dirlist.cache
+ ) || (
+ echo "Excluding $dir"
+ )
+
+ fi
+ done
+ echo "Documentation cache dirlist.cache built OK"
+
+ #
+ # Clean up
+ #
+ /bin/rm -rf $DESTDIR/tmp
+
+fi
diff --git a/runtests.sh b/runtests.sh
new file mode 100755
index 0000000..75a898f
--- /dev/null
+++ b/runtests.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+#
+# Command line runner for unit tests for composer projects
+# (c) Del 2015 http://www.babel.com.au/
+# No Rights Reserved
+#
+
+#
+# Clean up after any previous test runs
+#
+mkdir -p documents
+rm -rf documents/coverage-html-new
+rm -f documents/coverage.xml
+
+#
+# Run phpunit
+#
+vendor/bin/phpunit --coverage-html documents/coverage-html-new --coverage-clover documents/coverage.xml
+
+if [ -d documents/coverage-html-new ]; then
+ rm -rf documents/coverage-html
+ mv documents/coverage-html-new documents/coverage-html
+fi
+
diff --git a/src/DirectGateway.php b/src/DirectGateway.php
index 5c8cd4b..f2480e9 100644
--- a/src/DirectGateway.php
+++ b/src/DirectGateway.php
@@ -2,7 +2,7 @@
/**
* eWAY Legacy Direct XML Payments Gateway
*/
-
+
namespace Omnipay\Eway;
use Omnipay\Common\AbstractGateway;
@@ -14,7 +14,6 @@
*
* NOTE: The APIs called by this gateway are older legacy APIs, new integrations should instead
* use eWAY Rapid.
- *
*/
class DirectGateway extends AbstractGateway
{
@@ -27,7 +26,7 @@ public function getDefaultParameters()
{
return array(
'customerId' => '',
- 'testMode' => false,
+ 'testMode' => false,
);
}
diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php
index 13bafe4..ffcb047 100644
--- a/src/Message/AbstractRequest.php
+++ b/src/Message/AbstractRequest.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Abstract Request
*/
-
+
namespace Omnipay\Eway\Message;
/**
@@ -83,7 +83,7 @@ public function setInvoiceReference($value)
{
return $this->setParameter('invoiceReference', $value);
}
-
+
protected function getBaseData()
{
$data = array();
diff --git a/src/Message/AbstractResponse.php b/src/Message/AbstractResponse.php
index 5798cc3..34556cb 100644
--- a/src/Message/AbstractResponse.php
+++ b/src/Message/AbstractResponse.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Abstract Response
*/
-
+
namespace Omnipay\Eway\Message;
/**
diff --git a/src/Message/DirectCaptureRequest.php b/src/Message/DirectCaptureRequest.php
index bb89323..e253856 100644
--- a/src/Message/DirectCaptureRequest.php
+++ b/src/Message/DirectCaptureRequest.php
@@ -15,7 +15,7 @@ class DirectCaptureRequest extends DirectAbstractRequest
public function getData()
{
$this->validate('transactionId');
-
+
$xml = '';
$sxml = new \SimpleXMLElement($xml);
diff --git a/src/Message/DirectRefundRequest.php b/src/Message/DirectRefundRequest.php
index e6c511a..70c4501 100644
--- a/src/Message/DirectRefundRequest.php
+++ b/src/Message/DirectRefundRequest.php
@@ -25,7 +25,7 @@ public function getRefundPassword()
public function getData()
{
$this->validate('refundPassword', 'transactionId');
-
+
$xml = '';
$sxml = new \SimpleXMLElement($xml);
diff --git a/src/Message/DirectResponse.php b/src/Message/DirectResponse.php
index 5dbb81c..85a5c9c 100644
--- a/src/Message/DirectResponse.php
+++ b/src/Message/DirectResponse.php
@@ -26,7 +26,7 @@ public function getTransactionReference()
if (empty($this->data->ewayTrxnNumber)) {
return null;
}
-
+
return (int) $this->data->ewayTrxnNumber;
}
diff --git a/src/Message/RapidCaptureRequest.php b/src/Message/RapidCaptureRequest.php
index bf12366..4001ba2 100644
--- a/src/Message/RapidCaptureRequest.php
+++ b/src/Message/RapidCaptureRequest.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Capture Request
*/
-
+
namespace Omnipay\Eway\Message;
/**
@@ -51,7 +51,7 @@ public function getEndpoint()
{
return $this->getEndpointBase().'/CapturePayment';
}
-
+
public function sendData($data)
{
// This request uses the REST endpoint and requires the JSON content type header
diff --git a/src/Message/RapidCompletePurchaseRequest.php b/src/Message/RapidCompletePurchaseRequest.php
index 54a27f1..a346a28 100644
--- a/src/Message/RapidCompletePurchaseRequest.php
+++ b/src/Message/RapidCompletePurchaseRequest.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Complete Purchase Request
*/
-
+
namespace Omnipay\Eway\Message;
/**
diff --git a/src/Message/RapidDirectAbstractRequest.php b/src/Message/RapidDirectAbstractRequest.php
index fa628c2..e7c7b50 100644
--- a/src/Message/RapidDirectAbstractRequest.php
+++ b/src/Message/RapidDirectAbstractRequest.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Direct Abstract Request
*/
-
+
namespace Omnipay\Eway\Message;
/**
@@ -18,7 +18,7 @@ public function getEncryptedCardNumber()
{
return $this->getParameter('encryptedCardNumber');
}
-
+
/**
* Sets the encrypted card number, for use when submitting card data
* encrypted using eWAY's client side encryption.
@@ -30,7 +30,7 @@ public function setEncryptedCardNumber($value)
{
return $this->setParameter('encryptedCardNumber', $value);
}
-
+
public function getEncryptedCardCvv()
{
return $this->getParameter('encryptedCardCvv');
@@ -47,32 +47,31 @@ public function setEncryptedCardCvv($value)
{
return $this->setParameter('encryptedCardCvv', $value);
}
-
+
protected function getBaseData()
{
-
$data = parent::getBaseData();
$data['TransactionType'] = $this->getTransactionType();
-
+
if ($this->getCardReference()) {
$data['Customer']['TokenCustomerID'] = $this->getCardReference();
} else {
$this->validate('card');
}
-
+
if ($this->getCard()) {
$data['Customer']['CardDetails'] = array();
$data['Customer']['CardDetails']['Name'] = $this->getCard()->getName();
$data['Customer']['CardDetails']['ExpiryMonth'] = $this->getCard()->getExpiryDate('m');
$data['Customer']['CardDetails']['ExpiryYear'] = $this->getCard()->getExpiryDate('y');
$data['Customer']['CardDetails']['CVN'] = $this->getCard()->getCvv();
-
+
if ($this->getEncryptedCardNumber()) {
$data['Customer']['CardDetails']['Number'] = $this->getEncryptedCardNumber();
} else {
$data['Customer']['CardDetails']['Number'] = $this->getCard()->getNumber();
}
-
+
if ($this->getEncryptedCardCvv()) {
$data['Customer']['CardDetails']['CVN'] = $this->getEncryptedCardCvv();
} else {
@@ -83,7 +82,7 @@ protected function getBaseData()
$data['Customer']['CardDetails']['StartMonth'] = $this->getCard()->getStartDate('m');
$data['Customer']['CardDetails']['StartYear'] = $this->getCard()->getStartDate('y');
}
-
+
if ($this->getCard()->getIssueNumber()) {
$data['Customer']['CardDetails']['IssueNumber'] = $this->getCard()->getIssueNumber();
}
diff --git a/src/Message/RapidDirectAuthorizeRequest.php b/src/Message/RapidDirectAuthorizeRequest.php
index 254a727..46ed87e 100644
--- a/src/Message/RapidDirectAuthorizeRequest.php
+++ b/src/Message/RapidDirectAuthorizeRequest.php
@@ -2,16 +2,16 @@
/**
* eWAY Rapid Direct Authorise Request
*/
-
+
namespace Omnipay\Eway\Message;
/**
* eWAY Rapid Direct Authorise Request
*
- * Completes an authorise transaction (pre-auth) using eWAY's Rapid Direct
+ * Completes an authorise transaction (pre-auth) using eWAY's Rapid Direct
* Connection API. This looks exactly like a RapidDirectPurchaseRequest,
* except the Method is set to "Authorise" (note British English spelling).
- *
+ *
* The returned transaction ID (use getTransactionReference()) can be used to
* capture the payment.
*
@@ -70,7 +70,7 @@ class RapidDirectAuthorizeRequest extends RapidDirectAbstractRequest
public function getData()
{
$data = $this->getBaseData();
-
+
$this->validate('amount');
$data['Payment'] = array();
@@ -79,9 +79,9 @@ public function getData()
$data['Payment']['InvoiceDescription'] = $this->getDescription();
$data['Payment']['CurrencyCode'] = $this->getCurrency();
$data['Payment']['InvoiceReference'] = $this->getInvoiceReference();
-
+
$data['Method'] = 'Authorise';
-
+
return $data;
}
diff --git a/src/Message/RapidDirectCreateCardRequest.php b/src/Message/RapidDirectCreateCardRequest.php
index b4c6d8b..8569c7d 100644
--- a/src/Message/RapidDirectCreateCardRequest.php
+++ b/src/Message/RapidDirectCreateCardRequest.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Direct Create Card Request
*/
-
+
namespace Omnipay\Eway\Message;
/**
@@ -60,12 +60,12 @@ class RapidDirectCreateCardRequest extends RapidDirectAbstractRequest
public function getData()
{
$data = $this->getBaseData();
-
+
$data['Payment'] = array();
$data['Payment']['TotalAmount'] = 0;
-
+
$data['Method'] = 'CreateTokenCustomer';
-
+
return $data;
}
diff --git a/src/Message/RapidDirectPurchaseRequest.php b/src/Message/RapidDirectPurchaseRequest.php
index 9d7dd40..b9a187c 100644
--- a/src/Message/RapidDirectPurchaseRequest.php
+++ b/src/Message/RapidDirectPurchaseRequest.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Direct Purchase Request
*/
-
+
namespace Omnipay\Eway\Message;
/**
@@ -13,8 +13,8 @@
* eWAY Token (passed as the cardReference).
*
* Using Direct Connection to pass card details in the clear requires
- * proof of PCI compliance to eWAY. Alternatively they can be
- * encrypted using Client Side Encryption - in which case the card
+ * proof of PCI compliance to eWAY. Alternatively they can be
+ * encrypted using Client Side Encryption - in which case the card
* number and CVN should be passed using the encryptedCardNumber and
* encryptedCardCvv respectively (these are not in the CreditCard
* object).
@@ -72,8 +72,8 @@ class RapidDirectPurchaseRequest extends RapidDirectAbstractRequest
public function getData()
{
$data = $this->getBaseData();
-
- $this->validate('amount', 'transactionType');
+
+ $this->validate('amount');
$data['Payment'] = array();
$data['Payment']['TotalAmount'] = $this->getAmountInteger();
@@ -81,16 +81,16 @@ public function getData()
$data['Payment']['InvoiceDescription'] = $this->getDescription();
$data['Payment']['CurrencyCode'] = $this->getCurrency();
$data['Payment']['InvoiceReference'] = $this->getInvoiceReference();
-
+
if ($this->getCardReference()) {
$data['Method'] = 'TokenPayment';
} else {
$data['Method'] = 'ProcessPayment';
}
-
+
return $data;
}
-
+
/**
* Get transaction endpoint.
*
diff --git a/src/Message/RapidDirectUpdateCardRequest.php b/src/Message/RapidDirectUpdateCardRequest.php
index 52e9698..64abaf5 100644
--- a/src/Message/RapidDirectUpdateCardRequest.php
+++ b/src/Message/RapidDirectUpdateCardRequest.php
@@ -8,8 +8,8 @@
/**
* eWAY Rapid Direct Update Card Request
*
- * Update card data stored as a token with eWAY using eWAY's Rapid
- * Direct Connection API.
+ * Update card data stored as a token with eWAY using eWAY's Rapid
+ * Direct Connection API.
*
* This requires the TokenCustomerID of the token being updated, handled
* in OmniPay as the cardReference.
@@ -63,16 +63,16 @@ class RapidDirectUpdateCardRequest extends RapidDirectAbstractRequest
public function getData()
{
$data = $this->getBaseData();
-
+
$this->validate('cardReference');
-
+
$data['Payment'] = array();
$data['Payment']['TotalAmount'] = 0;
-
+
$data['Customer']['TokenCustomerID'] = $this->getCardReference();
-
+
$data['Method'] = 'UpdateTokenCustomer';
-
+
return $data;
}
diff --git a/src/Message/RapidResponse.php b/src/Message/RapidResponse.php
index 8412e97..047ec04 100644
--- a/src/Message/RapidResponse.php
+++ b/src/Message/RapidResponse.php
@@ -2,14 +2,14 @@
/**
* eWAY Rapid Response
*/
-
+
namespace Omnipay\Eway\Message;
use Omnipay\Common\Message\RedirectResponseInterface;
/**
* eWAY Rapid Response
- *
+ *
* This is the response class for Rapid Direct & Transparent Redirect (Rapid)
*
*/
@@ -49,7 +49,7 @@ public function getCardReference()
if (isset($this->data['Customer']['TokenCustomerID'])) {
return $this->data['Customer']['TokenCustomerID'];
}
-
+
return null;
}
}
diff --git a/src/Message/RapidSharedPurchaseRequest.php b/src/Message/RapidSharedPurchaseRequest.php
index a1e0497..2f6bcc6 100644
--- a/src/Message/RapidSharedPurchaseRequest.php
+++ b/src/Message/RapidSharedPurchaseRequest.php
@@ -22,7 +22,7 @@ public function getData()
$data['Method'] = 'ProcessPayment';
$data['RedirectUrl'] = $this->getReturnUrl();
$data['TransactionType'] = $this->getTransactionType();
-
+
// Shared page parameters (optional)
$data['CancelUrl'] = $this->getCancelUrl();
$data['LogoUrl'] = $this->getLogoUrl();
@@ -65,7 +65,7 @@ public function getCancelUrl()
{
return $this->getParameter('cancelUrl');
}
-
+
public function setCancelUrl($value)
{
return $this->setParameter('cancelUrl', $value);
diff --git a/src/Message/RapidSharedResponse.php b/src/Message/RapidSharedResponse.php
index 6c04da2..9584e9a 100644
--- a/src/Message/RapidSharedResponse.php
+++ b/src/Message/RapidSharedResponse.php
@@ -33,7 +33,7 @@ public function getRedirectData()
{
return null;
}
-
+
/**
* Get a card reference (eWAY Token), for createCard requests.
*
diff --git a/src/Message/RefundRequest.php b/src/Message/RefundRequest.php
index 72177c6..9442ae0 100644
--- a/src/Message/RefundRequest.php
+++ b/src/Message/RefundRequest.php
@@ -7,8 +7,8 @@
/**
* eWAY Rapid Refund Request
- *
- * Refund a transaction processed through eWAY.
+ *
+ * Refund a transaction processed through eWAY.
* Requires the amount to refund and the eWAY Transaction ID of
* the transaction to refund (passed as transactionReference).
*
diff --git a/src/Message/RefundResponse.php b/src/Message/RefundResponse.php
index 2e8ef2b..8859a2c 100644
--- a/src/Message/RefundResponse.php
+++ b/src/Message/RefundResponse.php
@@ -9,5 +9,4 @@
*/
class RefundResponse extends AbstractResponse
{
-
}
diff --git a/src/RapidDirectGateway.php b/src/RapidDirectGateway.php
index 1e04296..d842341 100644
--- a/src/RapidDirectGateway.php
+++ b/src/RapidDirectGateway.php
@@ -12,54 +12,72 @@
*
* This class forms the gateway class for eWAY Rapid Direct Connection requests.
*
- * The eWAY Rapid gateways use an API Key and Password for authentication.
+ * The eWAY Rapid gateways use an API Key and Password for authentication.
*
- * There is also a test sandbox environment, which uses a separate endpoint and
+ * Before gaining access to this connection type eWAY must be provided with proof
+ * of a PCI-DSS compliant environment with a current and valid PCI-DSS certificate.
+ * Note that transactions not involving credit card data (such as a recurring token
+ * payment) may be processed without proof of compliance.
+ *
+ * There is also a test sandbox environment, which uses a separate endpoint and
* API key and password. To access the eWAY Sandbox requires an eWAY Partner account.
* https://myeway.force.com/success/partner-registration
*
- * Simple Purchase Example:
+ * If you're getting the response "Unauthorised API Access, Account Not PCI Certified"
+ * when testing with the sandbox, this means you're integrating Rapid Direct. If you're
+ * not using client side encryption then you will need to provide proof of PCI compliance
+ * when moving to the live endpoint.
+ *
+ * For testing in sandbox, it's a simple process to enable direct payments.
+ *
+ * * Log into your Sandbox Account
+ * * Hover the mouse over the Settings tab, then click on Sandbox.
+ * * Tick the box under Direct Payment Method (Next to PCI) and click on Save Sandbox Settings.
+ *
+ * You're now set up to test direct payments.
+ *
+ * ### Example
*
*
- * // Create a gateway for the eWAY Direct Gateway
- * $gateway = Omnipay::create('Eway_RapidDirect');
+ * // Create a gateway for the eWAY Direct Gateway
+ * $gateway = Omnipay::create('Eway_RapidDirect');
*
- * // Initialise the gateway
- * $gateway->initialize(array(
- * 'apiKey' => 'Rapid API Key',
- * 'password' => 'Rapid API Password',
- * 'testMode' => true, // Or false when you are ready for live transactions
- * ));
+ * // Initialise the gateway
+ * $gateway->initialize(array(
+ * 'apiKey' => 'Rapid API Key',
+ * 'password' => 'Rapid API Password',
+ * 'testMode' => true, // Or false when you are ready for live transactions
+ * ));
*
- * // Create a credit card object
- * $card = new CreditCard(array(
- * 'firstName' => 'Example',
- * 'lastName' => 'User',
- * 'number' => '4444333322221111',
- * 'expiryMonth' => '01',
- * 'expiryYear' => '2020',
- * 'cvv' => '321',
- * 'billingAddress1' => '1 Scrubby Creek Road',
- * 'billingCountry' => 'AU',
- * 'billingCity' => 'Scrubby Creek',
- * 'billingPostcode' => '4999',
- * 'billingState' => 'QLD',
- * ));
+ * // Create a credit card object
+ * $card = new CreditCard(array(
+ * 'firstName' => 'Example',
+ * 'lastName' => 'User',
+ * 'number' => '4444333322221111',
+ * 'expiryMonth' => '01',
+ * 'expiryYear' => '2020',
+ * 'cvv' => '321',
+ * 'billingAddress1' => '1 Scrubby Creek Road',
+ * 'billingCountry' => 'AU',
+ * 'billingCity' => 'Scrubby Creek',
+ * 'billingPostcode' => '4999',
+ * 'billingState' => 'QLD',
+ * ));
*
- * // Do a purchase transaction on the gateway
- * $request = $gateway->purchase(array(
- * 'amount' => '10.00',
- * 'currency' => 'AUD',
- * 'transactionType' => 'Purchase',
- * 'card' => $card,
- * ));
+ * // Do a purchase transaction on the gateway
+ * $request = $gateway->purchase(array(
+ * 'amount' => '10.00',
+ * 'currency' => 'AUD',
+ * 'transactionType' => 'Purchase',
+ * 'card' => $card,
+ * ));
*
- * $response = $request->send();
- * if ($response->isSuccessful()) {
- * echo "Purchase transaction was successful!\n";
- * $txn_id = $response->getTransactionReference();
- * echo "Transaction ID = " . $txn_id . "\n";
- * }
+ * $response = $request->send();
+ * if ($response->isSuccessful()) {
+ * echo "Purchase transaction was successful!\n";
+ * $txn_id = $response->getTransactionReference();
+ * echo "Transaction ID = " . $txn_id . "\n";
+ * }
*
*
* @link https://eway.io/api-v3/#direct-connection
@@ -78,7 +96,7 @@ public function getName()
public function getDefaultParameters()
{
return array(
- 'apiKey' => '',
+ 'apiKey' => '',
'password' => '',
'testMode' => false,
);
@@ -103,7 +121,7 @@ public function setPassword($value)
{
return $this->setParameter('password', $value);
}
-
+
/**
* Create a purchase request.
*
@@ -155,7 +173,7 @@ public function capture(array $parameters = array())
/**
* Refund a Transaction
*
- * Use this resource to refund a complete payment. To use this resource requires the transaction
+ * Use this resource to refund a complete payment. To use this resource requires the transaction
* reference from the purchase or capture.
*
* @link https://eway.io/api-v3/#refunds
@@ -174,7 +192,7 @@ public function refund(array $parameters = array())
* charging using eWAY's Tokens.
* After storing the card, pass the cardReference instead of the card
* details to complete a payment.
- *
+ *
* @link https://eway.io/api-v3/#create-token-customer
* @param array $parameters
* @return \Omnipay\Eway\Message\RapidDirectCreateCardRequest
@@ -190,7 +208,7 @@ public function createCard(array $parameters = array())
* You can currently securely store card details with eWAY for future
* charging using eWAY's Tokens.
* This resource requires the cardReference for the card to be updated.
- *
+ *
* @link https://eway.io/api-v3/#update-token-customer
* @param array $parameters
* @return \Omnipay\Eway\Message\RapidDirectUpdateCardRequest
diff --git a/src/RapidGateway.php b/src/RapidGateway.php
index 0de8d04..48cff5d 100644
--- a/src/RapidGateway.php
+++ b/src/RapidGateway.php
@@ -13,9 +13,9 @@
* This class forms the gateway class for eWAY Rapid Transparent Redirect requests.
* The gateway is just called Eway_Rapid as it was the first implemented.
*
- * The eWAY Rapid gateways use an API Key and Password for authentication.
+ * The eWAY Rapid gateways use an API Key and Password for authentication.
*
- * There is also a test sandbox environment, which uses a separate endpoint and
+ * There is also a test sandbox environment, which uses a separate endpoint and
* API key and password. To access the eWAY Sandbox requires an eWAY Partner account.
* https://myeway.force.com/success/partner-registration
*
@@ -36,7 +36,7 @@ public function getName()
public function getDefaultParameters()
{
return array(
- 'apiKey' => '',
+ 'apiKey' => '',
'password' => '',
'testMode' => false,
);
diff --git a/src/RapidSharedGateway.php b/src/RapidSharedGateway.php
index 57868e7..33d2ee7 100644
--- a/src/RapidSharedGateway.php
+++ b/src/RapidSharedGateway.php
@@ -2,7 +2,7 @@
/**
* eWAY Rapid Responsive Shared Page Gateway
*/
-
+
namespace Omnipay\Eway;
use Omnipay\Common\AbstractGateway;
@@ -12,9 +12,9 @@
*
* This class forms the gateway class for eWAY Rapid Responsive Sharesd Page requests.
*
- * The eWAY Rapid gateways use an API Key and Password for authentication.
+ * The eWAY Rapid gateways use an API Key and Password for authentication.
*
- * There is also a test sandbox environment, which uses a separate endpoint and
+ * There is also a test sandbox environment, which uses a separate endpoint and
* API key and password. To access the eWAY Sandbox requires an eWAY Partner account.
* https://myeway.force.com/success/partner-registration
*
@@ -33,7 +33,7 @@ public function getName()
public function getDefaultParameters()
{
return array(
- 'apiKey' => '',
+ 'apiKey' => '',
'password' => '',
'testMode' => false,
);