Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Mar 26, 2015
2 parents 6b8341d + 1aaa3da commit 33dd3e1
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.1
* Updated WordPress pay core library to version 1.1.1.
* If payment description is empty the payment ID is used.

## 1.1.0
* Updated WordPress pay core library to version 1.1.0.
* Updated WordPress pay MultiSafepay library to version 1.1.0.
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
},
"require": {
"php": ">=5.2.4",
"wp-pay/core": "~1.1.0",
"wp-pay-gateways/multisafepay": "~1.1.0"
"wp-pay/core": ">=1.2.0",
"wp-pay-gateways/multisafepay": ">=1.1.1"
},
"require-dev": {
"satooshi/php-coveralls": "dev-master"
Expand Down
113 changes: 65 additions & 48 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "multisafepay-connect",
"version": "1.1.0",
"version": "1.1.1",
"description": "MultiSafepay Connect driver for the WordPress payment processing library.",
"repository": {
"type": "git",
Expand Down
12 changes: 9 additions & 3 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public function __construct( Pronamic_WP_Pay_Gateways_MultiSafepay_Config $confi
public function start( Pronamic_Pay_PaymentDataInterface $data, Pronamic_Pay_Payment $payment, $payment_method = null ) {
$url = add_query_arg( 'payment', $payment->get_id(), home_url( '/' ) );

$transaction_description = $data->get_description();

if ( empty( $transaction_description ) ) {
$transaction_description = $payment->get_id();
}

$merchant = new Pronamic_WP_Pay_Gateways_MultiSafepay_Connect_Merchant();
$merchant->account = $this->config->account_id;
$merchant->site_id = $this->config->site_id;
Expand All @@ -52,8 +58,8 @@ public function start( Pronamic_Pay_PaymentDataInterface $data, Pronamic_Pay_Pay

$customer = new Pronamic_WP_Pay_Gateways_MultiSafepay_Connect_Customer();
$customer->locale = $data->get_language_and_country();
$customer->ip_address = Pronamic_WP_Pay_Server::get( 'REMOTE_ADDR' );
$customer->forwarded_ip = Pronamic_WP_Pay_Server::get( 'HTTP_X_FORWARDED_FOR' );
$customer->ip_address = Pronamic_WP_Pay_Server::get( 'REMOTE_ADDR', FILTER_VALIDATE_IP );
$customer->forwarded_ip = Pronamic_WP_Pay_Server::get( 'HTTP_X_FORWARDED_FOR', FILTER_VALIDATE_IP );
$customer->first_name = $data->getCustomerName();
$customer->last_name = '';
$customer->address_1 = 'Test';
Expand All @@ -69,7 +75,7 @@ public function start( Pronamic_Pay_PaymentDataInterface $data, Pronamic_Pay_Pay
$transaction->id = uniqid();
$transaction->currency = $data->get_currency();
$transaction->amount = $data->get_amount();
$transaction->description = $data->get_description();
$transaction->description = $transaction_description;
$transaction->var1 = '';
$transaction->var2 = '';
$transaction->var3 = '';
Expand Down

0 comments on commit 33dd3e1

Please sign in to comment.