Rails Spree OffsitePayments Integrations work flow -


i'm newbie in spree, activemerchant , payment flow...

that said, trying integrate offsitepayment spree, created custom gateway, added spree's payment methods on spree.rb config file , set on admin interface, such showing option buyer, , purchase method getting called. inside purchase method? suppose (and expect) integration helper has properties need fill in (as see in docs it), once filled, how "submit" payment? don't know if should looking spree related or offsitepayments, or activemerchant related... bit lost.

class spree::gateway::pagseguro < spree::gateway     def provider_class         offsitepayments::integrations::pagseguro     end      def provider         provider_class::helper     end      def auto_capture?         true     end      def purchase(amount, paym_source, gateway_options={})         # here?                     activemerchant::billing::response.new(true, 'success', {}, {})     end  end 

your purchase method needs whatever required gateway take money, , return appropriate activemerchant::billing::response based on status spree knows how process it.


Comments

Popular posts from this blog

python - Alternative to referencing variable before assignment -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -