Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7545305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:53:34+00:00 2026-05-30T08:53:34+00:00

My original question (below) was perhaps too specific, so I’m going to ask something

  • 0

My original question (below) was perhaps too specific, so I’m going to ask something more general!

Can anyone point me in the direction of a tutorial, example or documentation on using Active Merchant Integrations to support an offsite payment gateway?

Active Merchant’s rdoc lists all of the following as supported offsite payment gateways but I haven’t found any tutorials or examples on how to use ActiveMerchant::Billing::Integrations

  • 2 Checkout
  • Banca Sella GestPay
  • Chronopay
  • Direct-eBanking
  • DirecPay
  • HiTRUST
  • Moneybookers
  • Nochex
  • PayPal Website Payments Standard
  • SagePay Form
  • Valitor
  • WorldPay

As good as they may be, peepcode and rails casts only consider gateways, not integrations.

Many thanks!

My company is moving from PayPal Express Checkout to WorldPay Business
Gateway (Hosted Payment Page). We’re using Rails and Active Merchant.

  1. Does Active Merchant support WorldPay Business Gateway (Hosted Payment Page)? I think it does, judging by the rdoc
  2. What arguments must I supply to ActiveMerchant::Billing::Integrations::WorldPay.new ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:53:36+00:00Added an answer on May 30, 2026 at 8:53 am

    I made a simple app to demonstrate how off-site payments for Worldpay and Rails/Activemerchant can work together.

    Demo Rails App–
    https://github.com/daemonsy/Worldpay-Rails–Off-Site–Integration-Example

    For World Pay hosted payment, basically a post to their payment URL is required. Add test- to secure.worldpay.com for testing mode. WP requires amount, currency, installation ID and cartId to render the page to the customer.

    <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 ">
    

    Source: http://www.worldpay.com/support/kb/bg/htmlredirect/rhtml.html

    This creates a simple button that carries your order to World Pay where the customer will enter credit card details and complete the purchase. I’ve embedded the above code in the show page of an orders controller. e,g, <input type="hidden" name="amount" value="<%=@order.amount"%>>. So you can click buy this after submitting the order. There are many ways to achieve a POST to World Pay.

    After which, World Pay can show a shopper response page, send you payment response etc. For payment response to work, you can setup the payment response callback URL to one of your controllers. e.g. =>http://mysite.com/payment-backend

    This will be a POST request so you have to setup your controller to handle it. This is where Activemerchant kicks in. For example,

    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
    

    So the Notification object will read the params in request.raw_post and set them up the an object where you can query. I found the active merchant docs useful in telling what return params are mapped by it.

    Note that this controller is a very crude example. World Pay provides a few methods for you to validate the response and this is supported by Active Merchant.

    ActiveMerchant Docs on WorldPay::Notifications
    http://rdoc.info/github/Shopify/active_merchant/master/ActiveMerchant/Billing/Integrations/WorldPay
    World Pay Payment Response Docs
    http://www.worldpay.com/support/kb/bg/paymentresponse/payment_response.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(please read the update section below, I leave the original question too for clarity)
[EDITED: I left the original question below, with some more context and code to
I think that perhaps the original question was too long-winded with too many unnecessary
Original question is below, but as I have come up with a more minimal
The original question is below, but I changed the title because I think it
ORIGINAL (see UPDATED QUESTION below) I am designing a new laboratory database that tests
My original question can be found here , for which I've gotten some great
Author post-edit: Chosen solution (Original question remains below this box) SUMMARY: You SHOULD NOT
SEE EDIT UPDATES BELOW. Original question has been modified! I have a working window
EDIT 3: I am maintaining the original question below for historical reasons. However, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.