Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #11 from comicrelief/default-description
Browse files Browse the repository at this point in the history
Change default order description to 'Merchandise'
  • Loading branch information
ayanozturk authored Sep 4, 2017
2 parents 418d808 + fe08283 commit d5db0c7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For general usage instructions, please see the main

## Order description

We currently set the order description to "Donation" by default.
We currently set the order description to "Merchandise" by default.

To set another one, use `PurchaseRequest::setDescription()`.

Expand Down
2 changes: 1 addition & 1 deletion src/Omnipay/WorldpayCGHosted/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function getData()
$order->addAttribute('orderCode', $this->getTransactionId());
$order->addAttribute('installationId', $this->getInstallation());

$description = $this->getDescription() ? $this->getDescription() : 'Donation';
$description = $this->getDescription() ? $this->getDescription() : 'Merchandise';
$order->addChild('description', $description);

$amount = $order->addChild('amount');
Expand Down
2 changes: 1 addition & 1 deletion tests/Omnipay/WorldpayCGHosted/GatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function testPurchaseRequestDataSetUp()
$this->assertEquals('ACMECO', $data->attributes()['merchantCode']);
$this->assertEquals($this->parameters['transactionId'], $order->attributes()['orderCode']);
$this->assertEquals('ABC123', $order->attributes()['installationId']);
$this->assertEquals('Donation', $order->description);
$this->assertEquals('Merchandise', $order->description);
$this->assertEquals('745', $order->amount->attributes()['value']);
$this->assertEquals('GBP', $order->amount->attributes()['currencyCode']);
$this->assertEquals('2', $order->amount->attributes()['exponent']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testAmountDetails()
public function testDefaultDescription()
{
$data = $this->purchase->getData();
$this->assertEquals('Donation', $data->submit->order->description);
$this->assertEquals('Merchandise', $data->submit->order->description);
}

public function testPaymentMethodMaskWithKnownOmnipayType()
Expand Down

0 comments on commit d5db0c7

Please sign in to comment.