-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release date: 05 Mar 2018 Platform: PrestaShop 1.6 Supported Editions and Versions: - PrestaShop 1.6.1.17 and later - Afterpay-PrestaShop1.6 module v1.0.0 has been verified against a new instance of PrestaShop 1.6.1.17 - https://github.com/PrestaShop/PrestaShop/releases/tag/1.6.1.17 Supported Markets: - Australia (AUD currency) Highlights Version 1.0.0 of the Afterpay-PrestaShop1.6 module introduces: - Afterpay transaction processing (orders and refunds) – Australia. - Transaction Integrity Check. - Afterpay asset display on PrestaShop website. - Afterpay configuration in PrestaShop Back Office. - Afterpay module logging. Afterpay transaction processing (orders and refunds) - Australia - Access to the Afterpay Payment Gateway via Afterpay Merchant API V1. - Following a successful Afterpay payment capture, the below records are created in PrestaShop Back Office: * PrestaShop Order record with status of 'Payment accepted' * PrestaShop Invoice document linked to Order record - PrestaShop order refunds (full value) trigger a call to the Afterpay API to process the refund. - PrestaShop order refunds (partial value) are not supported in this version (1.0.0). - Afterpay Merchant Portal provides the functionality to perform order refunds (partial or full value). Transaction Integrity Check - To verify the integrity of each transaction, a Transaction Integrity Check has been implemented. - The Transaction Integrity Check compares the below values at time of checkout against the value present prior to payment capture: * Afterpay Token ID * PrestaShop Quote total amount. - In the instance of a discrepancy between these values, the transaction is cancelled and no payment capture attempts will be made. Afterpay asset display on PrestaShop website - Afterpay installment detail displayed on PrestaShop product pages. - Afterpay is included as a Payment Method on PrestaShop checkout page 'Payment' step. - Afterpay installment detail on the Payment Submission page. - Afterpay Lightbox modal available on PrestaShop product pages. Afterpay configuration in Prestashop Back Office - Afterpay module configuration available under: * PrestaShop Back Office > Modules > Modules & Services > Installed Modules. - Afterpay configuration includes: * Enable / Disable module. * Afterpay Merchant ID. * Afterpay Merchant Key. * API Mode. Afterpay configuration in Prestashop Back Office - Afterpay module introduces transaction and validation logging into the PrestaShop Back Office log. - Afterpay logging includes: * Afterpay transaction result - Approved. * Afterpay transaction result - Declined. * Validation of Merchant ID & Merchant Key combination.
- Loading branch information
Steven Gunarso
committed
Mar 5, 2018
1 parent
d25777f
commit d7fbd3b
Showing
91 changed files
with
7,941 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Afterpay PrestaShop Module Changelog | ||
|
||
### Release Name: Version 1.0.0 | ||
#### Release date: 05 Mar 2018 | ||
#### Platform: PrestaShop 1.6 | ||
|
||
### Supported Editions and Versions: | ||
- PrestaShop 1.6.1.17 and later | ||
- Afterpay-PrestaShop1.6 module v1.0.0 has been verified against a new instance of PrestaShop 1.6.1.17 | ||
- https://github.com/PrestaShop/PrestaShop/releases/tag/1.6.1.17 | ||
|
||
### Supported Markets: | ||
- Australia (AUD currency) | ||
|
||
### Highlights | ||
Version 1.0.0 of the Afterpay-PrestaShop1.6 module introduces: | ||
- Afterpay transaction processing (orders and refunds) – Australia. | ||
- Transaction Integrity Check. | ||
- Afterpay asset display on PrestaShop website. | ||
- Afterpay configuration in PrestaShop Back Office. | ||
- Afterpay module logging. | ||
|
||
#### Afterpay transaction processing (orders and refunds) - Australia | ||
- Access to the Afterpay Payment Gateway via Afterpay Merchant API V1. | ||
- Following a successful Afterpay payment capture, the below records are created in PrestaShop Back Office: | ||
* PrestaShop Order record with status of 'Payment accepted' | ||
* PrestaShop Invoice document linked to Order record | ||
- PrestaShop order refunds (full value) trigger a call to the Afterpay API to process the refund. | ||
- PrestaShop order refunds (partial value) are not supported in this version (1.0.0). | ||
- Afterpay Merchant Portal provides the functionality to perform order refunds (partial or full value). | ||
|
||
#### Transaction Integrity Check | ||
- To verify the integrity of each transaction, a Transaction Integrity Check has been implemented. | ||
- The Transaction Integrity Check compares the below values at time of checkout against the value present prior to payment capture: | ||
* Afterpay Token ID | ||
* PrestaShop Quote total amount. | ||
- In the instance of a discrepancy between these values, the transaction is cancelled and no payment capture attempts will be made. | ||
|
||
#### Afterpay asset display on PrestaShop website | ||
- Afterpay installment detail displayed on PrestaShop product pages. | ||
- Afterpay is included as a Payment Method on PrestaShop checkout page 'Payment' step. | ||
- Afterpay installment detail on the Payment Submission page. | ||
- Afterpay Lightbox modal available on PrestaShop product pages. | ||
|
||
#### Afterpay configuration in Prestashop Back Office | ||
- Afterpay module configuration available under: | ||
* PrestaShop Back Office > Modules > Modules & Services > Installed Modules. | ||
- Afterpay configuration includes: | ||
* Enable / Disable module. | ||
* Afterpay Merchant ID. | ||
* Afterpay Merchant Key. | ||
* API Mode. | ||
|
||
#### Afterpay configuration in Prestashop Back Office | ||
- Afterpay module introduces transaction and validation logging into the PrestaShop Back Office log. | ||
- Afterpay logging includes: | ||
* Afterpay transaction result - Approved. | ||
* Afterpay transaction result - Declined. | ||
* Validation of Merchant ID & Merchant Key combination. |
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Afterpay SDK for PHP | ||
|
||
|
||
__Welcome to Afterpay PHP SDK V1.0__. This repository contains Afterpay PHP SDK Code, documentation and samples to use merchant APi V1 | ||
|
||
|
||
## SDK Documentation | ||
|
||
[ Our Afterpay-PHP-SDK Page ](https://tngith-sup.tafmo.net/Touch/paylater-php.git) includes all the documentation related to PHP SDK. Everything from Documentation, Sample Codes, to Releases. Here are few quick links to get you there faster. | ||
|
||
* [ Afterpay-PHP-SDK Home Page ](https://tngith-sup.tafmo.net/Touch/paylater-php.git) | ||
* [ Samples ](https://tngith-sup.tafmo.net/Touch/paylater-php.git) | ||
* [ Installation ](https://tngith-sup.tafmo.net/Touch/paylater-php.git) | ||
* [ Make your First SDK Call](https://tngith-sup.tafmo.net/Touch/paylater-php.git) | ||
* [ Afterpay Developer Docs] (https://tngith-sup.tafmo.net/Touch/paylater-php.git) | ||
|
||
## Latest Updates | ||
|
||
- SDK v1.0 allows you to use Afterpay Merchant API V1 endpoints. | ||
- Starting from configuration API call, Order, Payment and Refund API calls are very easy to make. | ||
- It includes sample code for all API calls to make it easy to use. | ||
|
||
|
||
## Prerequisites | ||
|
||
- PHP 7.1 | ||
- PHPUnit 6.0 | ||
- [curl](http://php.net/manual/en/book.curl.php) & [json](http://php.net/manual/en/book.json.php) extensions must be enabled | ||
|
||
|
||
|
||
## Installation and Activation | ||
|
||
This section outlines the steps to install the Afterpay PHP SDK. | ||
|
||
If you are upgrading to a new version of the Afterpay SDK, it is always a good practice to backup your existing SDK folder before you commence the installation steps. | ||
|
||
1. Download a ZIP archive of this repository by clicking the "Clone or download" dropdown button, then "Download ZIP". | ||
2. Go to AfterpayConfig.php file in Afterpay/Core folder to set all API constants. Mainly need to change MERCHANT_ID and MERCHANT_SECRET_KEY. | ||
3. Change the API end points based on production or sandbox enviornment. | ||
3. Follow SampleCode directory to see how to call Config, Create Order, Payment Capture and Refund API's. | ||
4. Use SampleCode/SamplePreAuth to retrieves a list of payment configuration that includes payment types and valid payment ranges. | ||
5. Use SampleCode/SampleCreateOrder to create an order that is used to initiate the afterpay payment process. | ||
6. Use SampleCode/SampleGetOrder to retrieves an individual order by token. | ||
7. Use SampleCode/SampleCapturePayment to perform a direct payment capture and is the equivalent of capturing a credit card. | ||
8. Use SampleCode/SampleProcessRefund to perform a full or partial refund. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,247 @@ | ||
<?php | ||
|
||
namespace Afterpay\Api; | ||
|
||
/** | ||
* Class Address | ||
* | ||
* Customer Address object can be extended for Billing or Shipping Address. | ||
* | ||
* @package Afterpay\Api | ||
* | ||
* @property string name | ||
* @property string line1 | ||
* @property string line2 | ||
* @property string postCode | ||
* @property string state | ||
* @property string suburb | ||
* @property string countryCode | ||
* @property string phoneNumber | ||
*/ | ||
class Address | ||
{ | ||
|
||
/** | ||
* Customer Name | ||
*/ | ||
protected $name; | ||
/** | ||
* Customer Line1 Address | ||
*/ | ||
protected $line1; | ||
/** | ||
* Customer Line2 Address | ||
*/ | ||
protected $line2; | ||
/** | ||
* Customer Post Code | ||
*/ | ||
protected $postcode; | ||
/** | ||
* Customer State | ||
*/ | ||
protected $state; | ||
/** | ||
* Customer Suburb | ||
*/ | ||
protected $suburb; | ||
/** | ||
* Customer Country Code | ||
*/ | ||
protected $countryCode; | ||
/** | ||
* Customer Phone Number | ||
*/ | ||
protected $phoneNumber; | ||
|
||
/** | ||
* Default Constructor | ||
* | ||
* Will set values for all address properties | ||
* | ||
* @param Array $address | ||
* | ||
*/ | ||
public function __construct($address) | ||
{ | ||
$this->setName($address['name']); | ||
$this->setLine1($address['line1']); | ||
$this->setLine2($address['line2']); | ||
$this->setPostcode($address['postcode']); | ||
$this->setState($address['state']); | ||
$this->setSuburb($address['suburb']); | ||
$this->setCountryCode($address['countryCode']); | ||
$this->setPhoneNumber($address['phoneNumber']); | ||
|
||
} | ||
/** | ||
* Name of the customer at this address. | ||
* | ||
* @param string $name | ||
* | ||
* @return $this | ||
*/ | ||
protected function setName($name) | ||
{ | ||
$this->name = $name; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Name of the customer at this address. | ||
* | ||
* @return string | ||
*/ | ||
protected function getName() | ||
{ | ||
return $this->name; | ||
} | ||
/** | ||
* Line 1 of the Address (eg. number, street, etc). | ||
* | ||
* @param string $line1 | ||
* | ||
* @return $this | ||
*/ | ||
protected function setLine1($line1) | ||
{ | ||
$this->line1 = $line1; | ||
return $this; | ||
} | ||
/** | ||
* Line 1 of the Address (eg. number, street, etc). | ||
* | ||
* @return string | ||
*/ | ||
protected function getLine1() | ||
{ | ||
return $this->line1; | ||
} | ||
/** | ||
* Line 2 of the Address (eg. suite, apt #, etc.). | ||
* | ||
* @param string $line2 | ||
* | ||
* @return $this | ||
*/ | ||
protected function setLine2($line2) | ||
{ | ||
$this->line2 = $line2; | ||
return $this; | ||
} | ||
/** | ||
* Line 2 of the Address (eg. suite, apt #, etc.). | ||
* | ||
* @return string | ||
*/ | ||
protected function getLine2() | ||
{ | ||
return $this->line2; | ||
} | ||
/** | ||
* Post Code. | ||
* | ||
* @param string $postcode | ||
* | ||
* @return $this | ||
*/ | ||
protected function setPostcode($postcode) | ||
{ | ||
$this->postcode = $postcode; | ||
return $this; | ||
} | ||
/** | ||
* Post Code. | ||
* | ||
* @return string | ||
*/ | ||
protected function getPostcode() | ||
{ | ||
return $this->postcode; | ||
} | ||
/** | ||
* State Code. | ||
* | ||
* @param string $state | ||
* | ||
* @return $this | ||
*/ | ||
protected function setState($state) | ||
{ | ||
$this->state = $state; | ||
return $this; | ||
} | ||
/** | ||
* State Code. | ||
* | ||
* @return string | ||
*/ | ||
protected function getState() | ||
{ | ||
return $this->state; | ||
} | ||
/** | ||
* Suburb. | ||
* | ||
* @param string $suburb | ||
* | ||
* @return $this | ||
*/ | ||
protected function setSuburb($suburb) | ||
{ | ||
$this->suburb = $suburb; | ||
return $this; | ||
} | ||
/** | ||
* Suburb. | ||
* | ||
* @return string | ||
*/ | ||
protected function getSuburb() | ||
{ | ||
return $this->suburb; | ||
} | ||
/** | ||
* Country Code. | ||
* | ||
* @param string $countryCode | ||
* | ||
* @return $this | ||
*/ | ||
protected function setCountryCode($countryCode) | ||
{ | ||
$this->countryCode = $countryCode; | ||
return $this; | ||
} | ||
/** | ||
* Country Code. | ||
* | ||
* @return string | ||
*/ | ||
protected function getCountryCode() | ||
{ | ||
return $this->countryCode; | ||
} | ||
/** | ||
* Customer phone number | ||
* | ||
* @param string $phoneNumber | ||
* | ||
* @return $this | ||
*/ | ||
protected function setPhoneNumber($phoneNumber) | ||
{ | ||
$this->phoneNumber = $phoneNumber; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Customer phone number | ||
* | ||
* @return string | ||
*/ | ||
protected function getPhoneNumber() | ||
{ | ||
return $this->phoneNumber; | ||
} | ||
} |
Oops, something went wrong.