PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Custom Paypal Button - Unexpected txn_type/status' error

s2Member Plugin. A Membership plugin for WordPress®.

Custom Paypal Button - Unexpected txn_type/status' error

Postby cclambie » January 25th, 2012, 7:06 am

Hi s2Members users,

So I have a unusual request I think.
I want to setup a 7 week subscription via Paypal and have created a custom button to do so.

I need s2Member to send back access to a Custom Post/Page like it would with a "standard" button/ IPN return from Paypal, so I am trying to make it accept the IPN reply from Paypal with associated information.

I have tried a couple of things, and I keep getting this error "Unexpected txn_type/status' error upon IPN request"

I think it might be the line <input type="hidden" name="cmd" value="_s-xclick"> (Also * in code below)
but if I remove this and make it "<input type="hidden" name="cmd" value="_xclick">" it doesn't ask the person to subscribe, so therefore doesn't work.

Any thoughts? I need the action of a standard button with a subscription (I will be manually sending letters out each week with manually created access codes after the first week)

Or maybe another idea on how best to manage 7 emails with 7 access links to 7 pages, each for 1 week, over 7 weeks.

Thanks
C

Code: Select all
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick"> **
<input type="hidden" name="hosted_button_id" value="L22LXBTDCGWGG">
<input type="hidden" name="business" value="info@truesecrets.com.au" />
<!-- Instant Payment Notification & Return Page Details -->
<input type="hidden" name="rm" value="2" />
<!-- Configures Basic Checkout Fields -->
<input type="hidden" name="lc" value="" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="custom" value="www.truesecrets.com.au" />
<input type="hidden" name="currency_code" value="AUD" />
<input type="hidden" name="page_style" value="paypal" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="item_name" value="One a True Secret a Week" />
<input type="hidden" name="item_number" value="sp:1259:168" />
<input type="hidden" name="amount" value="8" />
<!-- Configures s2Member's Unique Invoice ID/Code  -->
<input type="hidden" name="invoice" value="<?php echo S2MEMBER_VALUE_FOR_PP_INV(); ?>" />
<!-- Associates Purchase With A User/Member ( when/if applicable ) -->
<input type="hidden" name="on0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>" />
<input type="hidden" name="os0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>" />
<!-- Identifies The Customer's IP Address For Tracking -->
<input type="hidden" name="on1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; ?>" />
<input type="hidden" name="os1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?>" />
<!-- Displays The PayPal® Image Button -->
<input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
</form>
User avatar
cclambie
Registered User
Registered User
 
Posts: 57
Joined: April 8, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby Raam Dev » January 26th, 2012, 12:29 pm

I'm not sure I understand how managing emails relates to the s2Member buy button. Could you explain the entire process and how you're expecting to use s2Member?

When you say 7-week subscription to PayPal, does the person simply pay once and then receive 7 emails? You could use the WP Admin -> s2Member -> PayPal Buttons -> Specific Post/Page Access Links to generate 7 different links to 7 different pages and then use each of those links in an email followup series with AWeber or MailChimp (the person could be automatically subscribed to the list after making the payment).
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby cclambie » January 26th, 2012, 6:17 pm

Hi Raam,
Thanks for the reply.

So what I am trying to achieve is this:
1 x Paypal subscription setup that will debit $8 from the subscriber for 7 weeks.
Each week I need to send them a special access link to a particular 2 pages that are protected with s2Member for a limit of 7 days access.

So what I am hoping to achieve would look like this:
Week 1
User: Subscribes to Paypal for 7 Weeks at $8 a week, receives access link to 2 pages (7 day pass to pages)
s2Member: Accepts Paypal payment, sends 2 page link, as though a simple button was pressed
Manual: Do nothing

Week 2 - 7
User: Receives email access link to 2 pages (different each week, 7 day pass)
s2Member: Nothing Automatic (Unless you can think of a way)
Manual: Use s2Member to generate access link to 2 pages and send email to user

I am happy to manually create the links initially, I can write something to auto generate the links and send the emails later once it is off and working and the requests for the process warrant automation.
User avatar
cclambie
Registered User
Registered User
 
Posts: 57
Joined: April 8, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby Raam Dev » January 26th, 2012, 10:40 pm

Thank you for explaining. I understand what you're trying to do now.

The only trouble I see with what you explained above is that s2Member cannot automatically end a recurring subscription after a specific amount of time. So you can create a signup button for a $7/week subscription, but you can't tell the button that the membership should only recur for 7 weeks and then end.

On the s2Member side, once the user has subscribed, you can go into their account and type "+7 weeks" into the Automatic EOT Time field on the users profile to force the account to expire after 7 weeks. However, PayPal will continue charging the customer until you (or they) manually cancel the subscription.

As far as I know, this is a limitation on PayPal's end: I don't believe you can create a weekly subscription that recurs 7 times and then ends.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby cclambie » January 26th, 2012, 10:57 pm

I have created a button in Paypal that does exactly that actually.

What I am trying to do is have the button send back and IPN responce to s2Member with a success and s2M then sends out that first email and access, just like you pressed a "normal" Paypal s2M button.

Here is my Paypal Subscribe button code, which can be found here
Code: Select all
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <input type="hidden" name="cmd" value="_s-xclick">
            <input type="hidden" name="hosted_button_id" value="L22LXBTDCGWGG">
            <input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
            <img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
            </form>
User avatar
cclambie
Registered User
Registered User
 
Posts: 57
Joined: April 8, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby Raam Dev » January 26th, 2012, 11:09 pm

Have you followed these directions? viewtopic.php?f=36&t=309&#p1333
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby cclambie » January 27th, 2012, 1:06 am

Thanks for the pointer Raam, no I hadn't seen it.
However I have tried a lot of what it says already.....

When I follow those instructions I still get the "Unexpected txt_type_status" error coming up....
Image
Button Code after following instructions:
Code: Select all
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="6L5F6X24N568C">
<input type="hidden" name="lc" value="AU">
<input type="hidden" name="item_name" value="One True Secret a week">
<input type="hidden" name="item_number" value="sp:1259:168">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.truesecrets.com.au/strange-tours-melbourne/?s2member_paypal_return=1">
<input type="hidden" name="cancel_return" value="http://www.truesecrets.com.au/strange-tours-melbourne/">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="8.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="W">
<input type="hidden" name="currency_code" value="AUD">
<input type="hidden" name="srt" value="7">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted">
<input type="hidden" name="custom" value="www.truesecrets.com.au/strange-tours-melbourne/">
<input type="hidden" name="notify_url" value="http://www.truesecrets.com.au/strange-tours-melbourne/?s2member_paypal_return=1">
<input type="hidden" name="rm" value="2">
<input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
</form>


You will note the 4 important fields are all there and correct: item_number, custom, notify_url, rm

Thoughts?
User avatar
cclambie
Registered User
Registered User
 
Posts: 57
Joined: April 8, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby Cristián Lávaque » January 30th, 2012, 10:13 pm

Actually, you can make a subscription last only a certain number of terms using the rrt attribute. WP Admin -> s2Member -> PayPal Buttons -> Shortcode Attributes -> rrt

About the txn_type problem, I don't know. I'll ask Jason. But if the rrt attribute works for you, then use the shortcode and that may solve your problem.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby cclambie » January 31st, 2012, 12:39 am

Hi Christian,
Thanks for the suggestion - the issue with rrt is that it suggests it is only for "membership" type transactions, and I am trying for a "outside of the box" post/page access link type transaction. :(

I tried it anyway, and sadly it doesn't work :(
I am most interested to hear and try another idea though :)

C
User avatar
cclambie
Registered User
Registered User
 
Posts: 57
Joined: April 8, 2011

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby Cristián Lávaque » January 31st, 2012, 2:59 am

Got ya. OK, I'll wait for Jason. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Custom Paypal Button - Unexpected txn_type/status' error

Postby Jason Caldwell » February 6th, 2012, 2:07 pm

Thanks for the heads up on this thread.

It sounds like you are trying to custom code some things to make this work in a specific way. You might take a look at this method provided by s2Member, which is documented here: http://www.s2member.com/codex/stable/s2 ... _link_gen()

For example... you might create a script that generates access links to Specific Posts/Pages in clever ways, and then integrate it into the larger picture that you're trying to customize.
Code: Select all
<?php
$post_id 
= 3;
$access_link = c_ws_plugin__s2member_sp_access::sp_access_link_gen($post_id);
wp_redirect($access_link); exit();
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests