napapey
Forum Replies Created
-
Forum: Plugins
In reply to: [Direct Stripe] Any affiliate program that works with your plugin ?I didn’t want to criticise, I just wanted to tell you what was going on by just implementing your solution.
Well, I could use some help – I’m pming you through your website.Forum: Plugins
In reply to: [Direct Stripe] Any affiliate program that works with your plugin ?Well, it seems not to work unless it takes hours to be taken into account into wp affiliate.
If no further comment, it definitely not work 🙂Forum: Plugins
In reply to: [Direct Stripe] Any affiliate program that works with your plugin ?Thank you I’m going to test the new code within the hour. I’ll keep your informed whether it works or not so you can add this in the description of your plugin.
Also do you plan on releasing an update with a “regular coupon discount system” or is this way beyond what offers Stripe ?
Forum: Plugins
In reply to: [Direct Stripe] Any affiliate program that works with your plugin ?Who thank you I’m going to test that asap.
I’ll upload your code in my child themein the function.php file and see where it goes by doing a purchase on an affiliate link. Is this the right way to test it out ?I have another question, maybe you want me to create another thread so it’s easier for people to search through everything ? The question would be : when using the coupon thing, e.g, coupon=”first-month-50″, is there a way to have an empty text input so people can write the coupon if they have it or otherwise leave it blank ?
Forum: Plugins
In reply to: [Direct Stripe] Any affiliate program that works with your plugin ?Hello thanks for the prompt answer.
I don’t exactly know how it works. I know they have a plugin linking the Stripe plugin to the affiliate plugin which does the following :
Anyway to tweak it to use your plugin or is it too complicated ? 🙂if (!defined(‘ABSPATH’)){
exit;
}function wpam_asp_stripe_payment_completed( $post_data, $charge ) {
WPAM_Logger::log_debug(‘Stripe Payments Integration – asp_stripe_payment_completed hook triggered.’);
//Required Parameters
$purchaseAmount = $post_data[‘item_price’];//Sale Amount
$order_id = $post_data[‘txn_id’];//Transaction ID
$buyer_email = $post_data[‘stripeEmail’];//Email address//Optional parameter
$reference = $post_data[‘item_name’];//Use the item name as the reference
$ip_address = isset($charge->client_ip) ? $charge->client_ip : ”;//Check the referrer data
$wpam_id = (isset($_COOKIE[‘wpam_id’]) && !empty($_COOKIE[‘wpam_id’])) ? $_COOKIE[‘wpam_id’] : ”;
if(empty($wpam_id) && !empty($ip_address)){
WPAM_Logger::log_debug(‘Stripe Payments integration – Checking affiliate ID using customer IP address.’);
$wpam_id = WPAM_Click_Tracking::get_referrer_id_from_ip_address($ip_address);
}
if (empty($wpam_id)) {
WPAM_Logger::log_debug(‘Stripe Payments integration – affiliate ID is not present. This customer was not referred by an affiliate.’);
return;
}
$args = array();
$args[‘txn_id’] = $order_id;
$args[‘amount’] = $purchaseAmount;
$args[‘aff_id’] = $wpam_id;
$args[’email’] = $buyer_email;
WPAM_Logger::log_debug(‘Stripe Payments integration – awarding commission for order ID: ‘ . $order_id . ‘, Purchase amount: ‘ . $purchaseAmount . ‘, Affiliate ID: ‘ . $wpam_id . ‘, Buyer Email: ‘ . $buyer_email);
do_action(‘wpam_process_affiliate_commission’, $args);
}
add_action( ‘asp_stripe_payment_completed’, ‘wpam_asp_stripe_payment_completed’, 10, 2 );