Я использую класс Lionite PayPal для обработки повторяющихся платежей PayPal, однако я, похоже, не получаю настраиваемую переменную, которую я установил, через IPN.Периодические платежи PayPal lionite
Это, как я пройти экспресс-проверки:
$item = array(
'subscription_description' => 'Monthly ' . $plan['title'] . ' subscription',
'cost' => $plan['price'],
);
$options = array(
'return' => $this->base . 'action/subscription/', // Confirmation URL
'cancel' => $this->base . 'action/cancel/', // Cancellation URL
'cost' => $plan['price'],
'item_cost' => $plan['price'],
'custom' => 999 //config('user:id')
);
$result = $this->paypal->getCheckoutUrl($options, $item);
if (is_string($result)) {
//Redirection URL generated successfully! redirecting to Paypal
header('Location: ' . $result);
}
если они завершают покупку они получают перенаправлены на моей странице подписки, где я создаю профиль подписки: $ дата = дата («с», strtotime ('+ 1 месяц')); // запуск в следующем месяце
$profile = array(
'period' => 'Month', // Subscription Period
'frequency' => 1, // Frequency x period equals 1 billing cycle (up to 1 year)
'total_cycles' => 12, // End profile after 1 year (12 cycles)
// Regular subscription amount
'start_date' => $date, // Profile start date
'currency' => 'USD' // Payment currency
);
//select user info
$user = $this->Db->selectOne(array('id' => config('user:id')), 'users');
//get user's plan
$plan = $this->Db->selectOne(array('id' => $user['plan']), 'plans');
$profile['cost'] = $profile['init_amount'] = $plan['price'];
$profile['desc'] = 'Monthly ' . $plan['title'] . ' subscription';
$profileId = $this->paypal->createRecurringProfile($profile);
После этого я получаю IPN с txn_type из recurring_payment_profile_created но пользовательская переменная отсутствует .. Есть идеи? Как я должен отслеживать, какой из моих пользователей зарегистрировался для подписки?
Edit: Сообщение IPN
Array
(
[payment_cycle] => Monthly
[txn_type] => recurring_payment_profile_created
[last_name] => Bernotas
[initial_payment_status] => Completed
[next_payment_date] => 03:00:00 Mar 28, 2013 PDT
[residence_country] => GB
[initial_payment_amount] => 0.01
[currency_code] => USD
[time_created] => 08:52:45 Feb 28, 2013 PST
[verify_sign] => xxxx
[period_type] => Regular
[payer_status] => verified
[tax] => 0.00
[payer_email] => xxxx
[first_name] => Ignas
[receiver_email] => xxxx
[payer_id] => xxxx
[product_type] => 1
[initial_payment_txn_id] => xxxx
[shipping] => 0.00
[amount_per_cycle] => 0.01
[profile_status] => Active
[charset] => windows-1252
[notify_version] => 3.7
[amount] => 0.01
[outstanding_balance] => 0.00
[recurring_payment_id] => xxxxx
[product_name] => Monthly Basic subscription
[ipn_track_id] => xxx
)
Благодаря
FYI, ваша ссылка на страницу Lionlite не работает. Если я открою его из SO, он вернет меня в SO, и если я открою его на новой вкладке, он вернет меня на свою главную страницу. – h2ooooooo
Исправлено. Извините :) – Ignas