Thanks Jason I now got create, cancel and modify subscription to work . . . Perfect :)
But now I have stumbled on another challenge. This is creating a subscription for a user that already exists in my wordpress blog. It might be a user that had a previous subscription and then got demoted and now has the ‘subscriber’ role (Level #0 user).
When I create a new subscription with txn_type=’subscr_signup’, s2Member sends the user that paid a mail telling him that payment was successful and link so that he can register. This is good and works for new Yet unregistered users.
But if I have a user that already is registered in my wordpress blog with the subscriber (Level #0 user) role it doesn’t work. Sending a transaction with txn_type=’subscr_signup’ doesn’t recognise that the user already exists, and will still send an e-mail with link to register. Unfortunately, this time the user cannot register as the user already exists.
I therefore tried to create a subscription with txn_type=’subscr_payment’ instead. I still failed though. See log below.
So my questions are.
1: What is the strategy to create an subscription for an already existing user so that s2Member recognises him and automatically associates the transaction with him?
2: If txn_type=’subscr_payment’ is the right way, what important field have I missed to get s2Member to recognise that the transaction belongs to an existing user?
Please se log below:
array (
‘first_name’ => ‘Test’,
‘last_name’ => ‘Testuser’,
‘payer_email’ => ‘test@testing.com’,
‘item_number’ => ‘1’,
‘item_name’ => ‘s2Member Level 1’,
‘mc_currency’ => ‘USD’,
‘mc_amount3’ => ‘29.95’,
‘mc_fee’ => ‘0.34’,
‘mc_gross’ => ‘9.34’,
‘txn_type’ => ‘subscr_payment’,
‘subscr_id’ => ‘0702362132’,
‘period3’ => ‘1 D’,
‘recurring’ => ”,
‘custom’ => ‘www.myweb.com’,
‘proxy_verified’ => ‘sms’,
‘s2member_log’ =>
array (
0 => ‘IPN received on: Sat Nov 3, 2012 9:14:35 pm UTC’,
1 => ‘s2Member POST vars verified with a Proxy Key’,
2 => ‘s2Member originating domain ( `$_SERVER[“HTTP_HOST”]` ) validated.’,
3 => ‘Ignoring this IPN request. The `txn_type/status` does NOT require any action on the part of s2Member.’,
),
‘subscr_gateway’ => ‘sms’,
‘s2member_paypal_proxy’ => ‘sms’,
‘s2member_paypal_proxy_verification’ => ‘d8fa2a4e12218c04d3205119612c7ff8’,
)