Skip to content

Commit

Permalink
Merge pull request #47 from strangerstudios/dev
Browse files Browse the repository at this point in the history
Update master to lastest version 0.8.3
  • Loading branch information
andrewlimaza authored Oct 16, 2019
2 parents 26e17e0 + f8c3b95 commit 867e8f0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 32 deletions.
2 changes: 1 addition & 1 deletion pmpro-payfast.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Paid Memberships Pro - PayFast Gateway
Plugin URI: https://www.paidmembershipspro.com/add-ons/payfast-payment-gateway/
Description: Adds PayFast as a gateway option for Paid Memberships Pro.
Version: .8.2
Version: .8.3
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
Text Domain: pmpro-payfast
Expand Down
19 changes: 14 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
=== Paid Memberships Pro - PayFast Gateway Add On ===
Contributors: strangerstudios,andrewza
Tags: paid memberships pro, pmpro, payfast, gateway, credit card
Requires at least: 4.8
Tested up to: 5.1.1
Stable tag: .8.2
Requires at least: 4.7
Tested up to: 5.2.4
Stable tag: .8.3

Add the South African payment processing service PayFast as a gateway option for Paid Memberships Pro.

== Description ==

Add the South African payment processing service PayFast as a gateway option for Paid Memberships Pro.

PayFast (https://www.payfast.co.za/) is a payments processing service for South Africans and South African websites. Their payment gateway offers a secure and instant transfer of money between online buyers and sellers. Merchants can accept funds from local and international customers from anywhere in the world in ZAR.
[PayFast](https://www.payfast.co.za/) is a payments processing service for South Africans and South African websites. Their payment gateway offers a secure and instant transfer of money between online buyers and sellers. Merchants can accept funds from local and international customers from anywhere in the world in ZAR.

Fees are charged per-transaction according to this fee schedule and there are no setup or monthly fees.
Fees are charged per-transaction [according to this fee schedule](https://www.payfast.co.za/fees/) and there are no setup or monthly fees.

[youtube http://www.youtube.com/watch?v=aDjjSjmJ-j8]

== Installation ==

Expand Down Expand Up @@ -48,6 +50,8 @@ To test PayFast payments without being billed in sandbox mode requires a sandbox


== Changelog ==
= .8.3 - 2019-10-16 =
* BUG FIX: Signature mismatch on recurring payments. (thanks Tauriq Stanley)

= .8.2 - 2019-04-26 =
* ENHANCEMENT: Prefix all constants to avoid conflict with other PayFast Plugins.
Expand All @@ -58,3 +62,8 @@ To test PayFast payments without being billed in sandbox mode requires a sandbox

= .8 =
* Initial release. Pluganized from the PayFast PMPro fork. Includes many bug fixes and improvements.

== Upgrade Notice ==

= .8.3 =
* Please upgrade for bug fixes pertaining to recurring membership billing.
36 changes: 10 additions & 26 deletions services/payfast_itn_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,33 +491,17 @@ function pmpro_ipnSaveOrder( $txn_id, $last_order ) {
function pmpro_pfGetData() {

$pfData = array();
// Ensure that all posted data is used at the ITN stage
$postedData = array_keys($_POST);

// Get all the POST data and sanitize it.
$pfData['m_payment_id'] = pmpro_getParam( 'm_payment_id', 'POST' );
$pfData['pf_payment_id'] = pmpro_getParam( 'pf_payment_id', 'POST' );
$pfData['payment_status'] = pmpro_getParam( 'payment_status', 'POST' );
$pfData['item_name'] = pmpro_getParam( 'item_name', 'POST' );
$pfData['item_description'] = pmpro_getParam( 'item_description', 'POST' );
$pfData['amount_gross'] = pmpro_getParam( 'amount_gross', 'POST' );
$pfData['amount_fee'] = pmpro_getParam( 'amount_fee', 'POST' );
$pfData['amount_net'] = pmpro_getParam( 'amount_net', 'POST' );
$pfData['custom_str1'] = pmpro_getParam( 'custom_str1', 'POST' );
$pfData['custom_str2'] = pmpro_getParam( 'custom_str2', 'POST' );
$pfData['custom_str3'] = pmpro_getParam( 'custom_str3', 'POST' );
$pfData['custom_str4'] = pmpro_getParam( 'custom_str4', 'POST' );
$pfData['custom_str5'] = pmpro_getParam( 'custom_str5', 'POST' );
$pfData['custom_int1'] = pmpro_getParam( 'custom_int1', 'POST' );
$pfData['custom_int2'] = pmpro_getParam( 'custom_int2', 'POST' );
$pfData['custom_int3'] = pmpro_getParam( 'custom_int3', 'POST' );
$pfData['custom_int4'] = pmpro_getParam( 'custom_int4', 'POST' );
$pfData['custom_int5'] = pmpro_getParam( 'custom_int5', 'POST' );
$pfData['name_first'] = pmpro_getParam( 'name_first', 'POST' );
$pfData['name_last'] = pmpro_getParam( 'name_last', 'POST' );
$pfData['email_address'] = pmpro_getParam( 'email_address', 'POST', '', 'sanitize_email' );
$pfData['merchant_id'] = pmpro_getParam( 'merchant_id', 'POST' );
$pfData['token'] = pmpro_getParam( 'token', 'POST' );
$pfData['billing_date'] = pmpro_getParam( 'billing_date', 'POST' );
$pfData['signature'] = pmpro_getParam( 'signature', 'POST' );
// Sanitize all posted data
foreach ( $postedData as $key ) {
if ( $key != 'email_address' ) {
$pfData[$key] = pmpro_getParam( $key, 'POST' );
} else {
$pfData[$key] = pmpro_getParam( $key, 'POST', '', 'sanitize_email' );
}
}

// Return "false" if no data was received
if ( sizeof( $pfData ) == 0 ) {
Expand Down

0 comments on commit 867e8f0

Please sign in to comment.