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

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -