2011-10-19 12 views
9

मेरा मूल प्रश्न (नीचे) शायद बहुत विशिष्ट था, इसलिए मैं कुछ और सामान्य पूछने जा रहा हूं!सक्रिय व्यापारी इंटीग्रेशंस (ऑफ साइट भुगतान)

किसी को भी एक offsite payment gateway समर्थन करने के लिए सक्रिय व्यापारी Integrations का उपयोग करने पर एक ट्यूटोरियल, उदाहरण या दस्तावेज की दिशा में मुझे बात कर सकते हैं?

सक्रिय मर्चेंट की rdoc सभी सूचियों को निम्नलिखित के रूप में ऑफसाइट भुगतान द्वार का समर्थन किया है, लेकिन मैं कैसे ActiveMerchant::Billing::Integrations

  • 2 चेकआउट
  • बैंका Sella GestPay
  • Chronopay उपयोग करने के लिए पर कोई ट्यूटोरियल या उदाहरण नहीं मिला है
  • डायरेक्ट-eBanking
  • DirecPay
  • HITrust
  • Moneybookers के
  • Nochex
  • पेपैल वेबसाइट भुगतान मानक
  • SagePay फार्म
  • Valitor
  • WorldPay

वे हो सकता है, peepcode और railscasts के रूप में के रूप में अच्छा ही प्रवेश द्वार पर विचार करें, नहीं एकीकरण।

बहुत धन्यवाद!

मेरी कंपनी पेपैल एक्सप्रेस चेकआउट से वर्ल्डपे बिजनेस गेटवे (होस्टेड भुगतान पृष्ठ) में जा रही है। हम रेल और सक्रिय व्यापारी का उपयोग कर रहे हैं।

  1. क्या सक्रिय व्यापारी समर्थन वर्ल्डपे बिजनेस गेटवे (होस्टेड भुगतान पृष्ठ) है? मुझे लगता है कि यह the rdoc
  2. पर निर्णय लेता है मैं ActiveMerchant :: बिलिंग :: इंटीग्रेशंस :: WorldPay.new को क्या तर्क देना चाहिए?

धन्यवाद

+0

आप इस को हल करने के प्रबंधन कैसे किया? मुझे स्विचिंग में भी परेशानी हो रही है :( –

+0

नहीं। अभी भी कुछ भी नहीं मिला है। – Mike

+0

चूंकि आप ऑफसाइट भुगतान का उपयोग कर रहे हैं, तो क्या आप विश्वव्यापी यूआरएल में 'POST' कर कर प्रक्रिया को सरल बना सकते हैं? पेपैल बटन एपीआई की तरह। –

उत्तर

10

मैं प्रदर्शित करने के लिए कैसे परोक्ष WORLDPAY और रेल/Activemerchant के लिए भुगतान साथ काम कर सकते एक सरल अनुप्रयोग बनाया है।

डेमो रेल अनुप्रयोग - https://github.com/daemonsy/Worldpay-Rails--Off-Site--Integration-Example

विश्व वेतन के लिए भुगतान की मेजबानी की, मूल रूप से उनके भुगतान यूआरएल के लिए एक post की आवश्यकता है। परीक्षण मोड के लिए सुरक्षित.worldpay.com पर test- जोड़ें। WP को ग्राहक को पृष्ठ प्रस्तुत करने के लिए राशि, मुद्रा, स्थापना आईडी और कार्ट आईडी की आवश्यकता होती है।

<form action="https://test-secure.worldpay.com/wcc/purchase" method=POST> 

<!-- This next line contains the testMode parameter - it specifies that the submission is a test submission --> 
<input type="hidden" name="testMode" value="100"> 

<!-- This next line contains a mandatory parameter. Put your Installation ID inside the quotes after value= --> 
<input type="hidden" name="instId" value="Your installation ID "> 

<!-- Another mandatory parameter. Put your own reference identifier for the item purchased inside the quotes after value= --> 
<input type="hidden" name="cartId" value="Your ID for the product "> 

<!-- Another mandatory parameter. Put the total cost of the item inside the quotes after value= --> 
<input type="hidden" name="amount" value="The cost of the product "> 

<!-- Another mandatory parameter. Put the code for the purchase currency inside the quotes after value= --> 
<input type="hidden" name="currency" value="currency code e.g. GBP, USD "> 

<!-- This creates the button. When it is selected in the browser, the form submits the purchase details to us. --> 
<input type=submit value=" Buy This "> 

स्रोत: http://www.worldpay.com/support/kb/bg/htmlredirect/rhtml.html

यह एक सरल button कि विश्व वेतन के लिए अपने आदेश जहां ग्राहक क्रेडिट कार्ड के विवरण दर्ज करें और खरीद पूरा हो जाएगा किया जाता है बनाता है। मैंने उपरोक्त कोड को ऑर्डर नियंत्रक के show पृष्ठ में एम्बेड किया है। ई, जी, <input type="hidden" name="amount" value="<%[email protected]"%>>। तो आप आदेश सबमिट करने के बाद buy this पर क्लिक कर सकते हैं। विश्व वेतन में POST प्राप्त करने के कई तरीके हैं।

जिसके बाद, विश्व वेतन एक दुकानदार प्रतिक्रिया पृष्ठ दिखा सकता है, आपको payment response आदि भेज सकता है। काम पर भुगतान प्रतिक्रिया के लिए, आप अपने नियंत्रकों में से एक को भुगतान प्रतिक्रिया callback URL सेट कर सकते हैं। जैसे =>http://mysite.com/payment-backend

यह POST अनुरोध होगा ताकि आपको इसे नियंत्रित करने के लिए अपने नियंत्रक को सेटअप करना होगा। यह वह जगह है जहां में Activemerchant किक। उदाहरण के लिए,

class BackendsController < ApplicationController 
    include ActiveMerchant::Billing::Integrations 
    protect_from_forgery :except=>[:worldpay_return] 

    #in routes => match '/payment-backend'=>'backends#worldpay_return' 
    def worldpay_return 
    notification = WorldPay::Notification.new(request.raw_post) 

    order = Order.find(notification.item_id) 

    if notification.acknowledge 
     begin 
     if notification.complete? 
      order.status = 'success' 
     end 
     rescue 
     order.status = "failed" 
     raise 
     ensure 
     order.save 
     end 
    end 
    render :text =>"Order status for #{order.id} is #{order.status}" 

    end 

end 

तो अधिसूचना वस्तु request.raw_post में पैरामीटर पढ़ सकते हैं और उन्हें एक वस्तु जहां क्वेरी कर सकता है की स्थापना की जाएगी। मैंने सक्रिय व्यापारी दस्तावेज़ों को यह बताने में उपयोगी पाया कि रिटर्न पैराम मैप किए गए हैं।

ध्यान दें कि यह नियंत्रक एक बहुत ही क्रूड उदाहरण है। विश्व वेतन प्रतिक्रिया को सत्यापित करने के लिए आपके लिए कुछ विधियां प्रदान करता है और यह सक्रिय व्यापारी द्वारा समर्थित है।

WorldPay पर

ActiveMerchant डॉक्स :: सूचनाएं http://rdoc.info/github/Shopify/active_merchant/master/ActiveMerchant/Billing/Integrations/WorldPay विश्व वेतन भुगतान रिस्पांस डॉक्स http://www.worldpay.com/support/kb/bg/paymentresponse/payment_response.html

+0

धन्यवाद। मैं इसे आजमाने की उम्मीद करता हूं निकट भविष्य में! – Mike

+0

कोई समस्या नहीं =)। मुझे विश्व वेतन पसंद है, लेकिन मुझे लगता है कि वे अपने बदसूरत होस्ट किए गए पेज को थोड़ा सा सुधार सकते हैं। –

+0

धन्यवाद .. अच्छा जवाब, मैं इसे किसी अन्य भुगतान प्रोसेसर में अनुकूलित करने का प्रयास करूंगा – Orlando