Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Nicolas Figueira

    (@nahuelmahe)

    Hello @napapey,

    Thank you for your interest in Direct Stripe.

    Direct Stripe is meant to be a simple payment solution that let its users build everything that is around.

    I am not particularly aware of an affiliate program that would work with Direct Stripe, I would need to know the specifics to really answer, like do you need to add an id on payment? Or retrieve an id on payment?
    How does your program work?

    Best regards

    Thread Starter napapey

    (@napapey)

    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 );

    Plugin Author Nicolas Figueira

    (@nahuelmahe)

    Hello @napapey,

    From the docs here https://wpaffiliatemanager.com/api-track-commission-via-a-wordpress-hook/ and your example, I think we can use an action processed just after a Direct Stripe payment is done to trigger that hook.

    I updated the example from your plugin with data from Direct Stripe here :

    https://gist.github.com/New0/85cdf453a2dd6f264fd673e07bd1e474

    You can use it in your (child-)theme’s functions.php file or in a custom plugin.

    Please be aware that I didn’t test it, tell me how it goes.

    Kind regards,

    Thread Starter napapey

    (@napapey)

    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 ?

    Plugin Author Nicolas Figueira

    (@nahuelmahe)

    @napapey, I just updated the Gist, please copy the code again if you already copied it!

    https://gist.github.com/New0/85cdf453a2dd6f264fd673e07bd1e474

    For the coupon question, it is not possible at the moment.
    The coupon can be used with predefined and promoted promotions and not as a regular coupon discount system.

    Let me know how the testing goes!

    Thread Starter napapey

    (@napapey)

    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 ?

    Thread Starter napapey

    (@napapey)

    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 ??

    Plugin Author Nicolas Figueira

    (@nahuelmahe)

    Hello @napapey,

    It seems like a really quick conclusion, support from a premium service seems more adapted to your situation but if you want to share access to an installation with WordPress Affiliate Manager ready to be tested, I’ll be glad to help. (Find the address at newo.me)

    Best regards

    Thread Starter napapey

    (@napapey)

    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Any affiliate program that works with your plugin ?’ is closed to new replies.