apigy / selfstarter

Roll your own crowdfunding
selfstarter.us
Other
3.17k stars 1.63k forks source link

How to actually collect the money #80

Open jtdavis247 opened 10 years ago

jtdavis247 commented 10 years ago

I must be missing something but I cant seem to find how I actually collect the money from the people that sign up and support my campaign. I have pushed my app to heroku and everything seems to be working fine. It allows the customer to click on the reserve now button and it takes them to amazon, it even redirects them to the thank you page after they have hit confirm on amazon. The problem is I want to start collecting money and I can't seem to find where I can do that at on my amazon account. What am I missing here? and help would be great! Thank you!

tailorvj commented 10 years ago

You'll need to create an Amazon Seller Central account. Afterwards, get your access key and secret key from the "Integration" tab on your AWS account. https://payments.amazon.com/sdui/sdui/accountstatus https://payments.amazon.com/sdui/sdui/helpTab/Checkout-by-Amazon/Advanced-Integration-Help/Using-Your-Access-Key

Once you have your access key and secret key, head over to config/settings.yml. Change amazon_access_key and amazon_secret_key appropriately.

Jarred-Sumner commented 10 years ago

There's an additional step. I intentionally left out code to charge multi-use tokens, to raise the barrier to entry slightly higher in the hopes of preventing unsophisticated scammers. Have a look at the documentation for Amazon FPS to see how to charge and refund multi-use tokens. You'll want to implement IPN.

On Feb 14, 2014, at 11:19 AM, Tailor Vijay notifications@github.com wrote:

You'll need to create an Amazon Seller Central account. Afterwards, get your access key and secret key from the "Integration" tab on your AWS account. https://payments.amazon.com/sdui/sdui/accountstatus https://payments.amazon.com/sdui/sdui/helpTab/Checkout-by-Amazon/Advanced-Integration-Help/Using-Your-Access-Key

Once you have your access key and secret key, head over to config/settings.yml. Change amazon_access_key and amazon_secret_key appropriately.

— Reply to this email directly or view it on GitHub.

jtdavis247 commented 10 years ago

Yeah I understnad why you set it up that way for sure. I have done everything that @tailorvj has mentioned now I am following the amazon_flext_pay documentation to try to collect money. I am fairly new to calling API's so thank you for your patients. So do I put this code ...


begin response = AmazonFlexPay.pay('12.99', 'USD', 'senderToken123') flash[:notice] = "Thanks! Your payment is processing." rescue AmazonFlexPay::API::Error => e flash[:error] = "Sorry, something went wrong." e.errors.each do |error|

notify yourself about error.code and error.message

end end

redirect_to product_path

in the Postfill method like so...


def postfill unless params[:callerReference].blank? @order = Order.postfill!(params) end

"A" means the user cancelled the preorder before clicking "Confirm" on Amazon Payments.

if params['status'] != 'A' && @order.present?
  response = AmazonFlexPay.pay('12.99', 'USD', 'senderToken123')
  redirect_to :action => :share, :uuid => @order.uuid
else
  redirect_to root_url
end

end

Lastly would I put the price variable in the first parameter? and what exactly goes in the 3rd parameter? Thank you again for your patients and I hope to hear from you soon! Thank you!