mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
always use parent site for paypal supporter data
This commit is contained in:
parent
b949154df0
commit
5cfb849554
1 changed files with 9 additions and 7 deletions
|
@ -141,11 +141,13 @@ get '/supporter/paypal/return' do
|
|||
redirect '/supporter'
|
||||
end
|
||||
|
||||
site = current_site.parent || current_site
|
||||
|
||||
ppr = PayPal::Recurring.new(paypal_recurring_authorization_hash.merge(
|
||||
frequency: 1,
|
||||
token: params[:token],
|
||||
period: :monthly,
|
||||
reference: current_site.id.to_s,
|
||||
reference: site.id.to_s,
|
||||
payer_id: params[:PayerID],
|
||||
start_at: 1.month.from_now,
|
||||
failed: 3,
|
||||
|
@ -154,12 +156,12 @@ get '/supporter/paypal/return' do
|
|||
|
||||
paypal_response = ppr.create_recurring_profile
|
||||
|
||||
current_site.paypal_token = params[:token]
|
||||
current_site.paypal_profile_id = paypal_response.profile_id
|
||||
current_site.paypal_active = true
|
||||
current_site.plan_type = 'supporter'
|
||||
current_site.plan_ended = false
|
||||
current_site.save_changes validate: false
|
||||
site.paypal_token = params[:token]
|
||||
site.paypal_profile_id = paypal_response.profile_id
|
||||
site.paypal_active = true
|
||||
site.plan_type = 'supporter'
|
||||
site.plan_ended = false
|
||||
site.save_changes validate: false
|
||||
|
||||
redirect '/supporter/thanks'
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue