I hope I understand this question correctly. Yes there is a way, you could just add a column e.g. paypalkey
to your Submission
model. (You can also name it paid
, I dont know if you want to keep the key).
In order to do this:
$ rails generate migration AddPayPalKeyToSubmission paypalkey:string
$ rake db:migrate
$ rake db:test:prepare
Then you could just:
if response.success?
submission.update_attributes(paypalkey: response.pay_key)
and
def paid?
self.paypalkey.present?
end
and from that point onwards would know that this submission has a paypal key.
Edit:
Just as a disclaimer, I don't have prior experience with PayPal and don't know if the paypal key is confidential or should be stored in a secure manner.