ModularMerchant
Knowledge Base
Shopping Cart Software Online Manual
Controlling the RMV System's Behavior with Variables
Create Members-Only Websites: RMV Method Working with RMV System Errors
Location Home > Shopping Cart Software Components > Administration Area > Modules > Subscription Products > Memberships & Remote Member Validation (RMV) System

Controlling the RMV System's Behavior with Variables

Modular Merchant's Remote Membership Validation (RMV) system makes it simple to set up a "members-only" area on your website where your customers can log in to access content that they have purchased. When a customer purchases an eligible product, they will automatically gain access to the protected membership area on your website. Anyone who has not purchased that product won't have access to the website!

There are several options available when using the RMV system. Before it can be used, these options must be configured. The RMV system's options can be configured in many different ways, allowing you to set it up to your exact specifications. To configure the RMV system's settings, simply add several PHP variables to your login page. These variables will be used to control the RMV system's behavior. These variables are:

reference
$store_url
This will be set to the URL of your Modular Merchant shopping cart.
Example: http://www.MyShoppingCartURL.com/

$api_key
Your account's API Key is located at [Admin > System Settings > Setting # 68].
Example: 9c1bc31d15sr23a22c9ba51d621a7b2fd

$results_format
This variable determines whether the store returns its validation results in either simple or XML format. Set this value to the desired format, either simple or xml.
Example: simple

$product_ids
Set this to a comma-separated list of the product SID (System ID) numbers of the products that must be present in either the customer's order history or subscription.
Example: 1,2,3

$all_any
If set to all, then the customer must be subscribed to all of the products set in the $product_ids variable.
If set to any, then the customer just needs to be subscribed to any one of the products set in the $product_ids variable.
Example: any

$subscription_vs_order
Set this to order to check for the required products in the orders the customer has already placed: their purchase history.
Set this to subscription to check for the required products in a subscription that is scheduled to be processed on a future date.
Example: subscription

$lookup_range
This determines how many days from today the RMV system will look for a qualifying product for the customer.
For example, if $subscription_vs_order is set to order and $lookup_range is set to 90, then the RMV system will look for a qualifying order placed by the customer within the last 90 days.
Or, if $subscription_vs_order is set to subscription and $lookup_range is set to 90, then the RMV system will look for a qualifying subscription for the customer that is due to be billed within the next 90 days.
Set the value of this variable to 0 (zero) to ignore it.
Example: 90

$require_order_authorization
The $require_order_authorization variable is only used when the $subscription_vs_order variable is set to order.
If set to Y or left blank, then only orders with a status of "payment authorized" will pass the RMV check.
If set to N, then the check of the orders' "payment authorized" status will be skipped.
Example: Y

$require_order_payment
The $require_order_payment variable is only used when the $subscription_vs_order variable is set to order.
If set to Y or left blank, then only orders with a status of "order paid" will pass the RMV check.
If set to N, then the check of the orders' "order paid" status will be skipped.
Example: Y

 
Examples
Here are examples of just some of the ways the RMV system's variables could be configured to achieve different results...

Scenario: 
A customer must have a subscription to either product ID 1, 2 or 3.
The RMV system will return a simple "Y" or "N" response, indicating whether the customer's membership is valid or not.

code
<?php
    $store_url 
'http://www.MyShoppingCartURL.com'// This is the URL of my Modular Merchant online store.
    
$api_key '9c1bc31d15sr23a22c9ba51d621a7b2fd'// My store's secret API key.
    
$product_ids '1,2,3'// The ID numbers of the required products.
    
$any_all 'any'// A match of any one of the products listed above will qualify the customer.
    
$subscription_vs_order 'subscription'// The list of products the customer is subscribed to will be searched.
    
$lookup_range '0'// When set to zero, this option will be ignored.
    
$results_format 'simple'// The results will be returned as either "Y" or "N".
    
?>


Scenario: 
A customer must have a subscription to product IDs 1 and 2 and 3.
The RMV system will return a simple "Y" or "N" response, indicating whether the customer's membership is valid or not.

code
<?php
    $store_url 
'http://www.MyShoppingCartURL.com'// This is the URL of my Modular Merchant online store.
    
$api_key '9c1bc31d15sr23a22c9ba51d621a7b2fd'// My store's secret API key.
    
$product_ids '1,2,3'// The ID numbers of the required products.
    
$any_all 'all'// A match of all of the products listed above are required to qualify the customer.
    
$subscription_vs_order 'subscription'// The list of products the customer is subscribed to will be searched.
    
$lookup_range '0'// When set to zero, this option will be ignored.
    
$results_format 'simple'// The results will be returned as either "Y" or "N".
    
?>


Scenario: 
A customer must have a placed an order for product ID 4.
The RMV system will return a simple "Y" or "N" response, indicating whether the customer's membership is valid or not.

code
<?php
    $store_url 
'http://www.MyShoppingCartURL.com'// This is the URL of my Modular Merchant online store.
    
$api_key '9c1bc31d15sr23a22c9ba51d621a7b2fd'// My store's secret API key.
    
$product_ids '4'// The ID numbers of the required products.
    
$any_all 'all'// A match of all of the products listed above are required to qualify the customer.
    
$subscription_vs_order 'order'// The products in the customer's purchase history will be searched.
    
$lookup_range '0'// When set to zero, this option will be ignored.
    
$require_order_authorization 'Y'// The customer's orders must have "payment authorized" status to qualify.
    
$require_order_payment 'Y'// The customer's orders must have "order paid" status to qualify.
    
$results_format 'simple'// The results will be returned as either "Y" or "N".
    
?>


Scenario: 
A customer must have a placed an order within the last 90 days for product ID 4.
The RMV system will return a simple "Y" or "N" response, indicating whether the customer's membership is valid or not.
The IP address of the customer that is logging in must match the IP address on file for that customer.

code
<?php
    $store_url 
'http://www.MyShoppingCartURL.com'// This is the URL of my Modular Merchant online store.
    
$api_key '9c1bc31d15sr23a22c9ba51d621a7b2fd'// My store's secret API key.
    
$product_ids '4'// The ID numbers of the required products.
    
$any_all 'all'// A match of all of the products listed above are required to qualify the customer.
    
$subscription_vs_order 'order'// The products in the customer's purchase history will be searched.
    
$lookup_range '90'// Just the last 90 days of the customer's order history will be searched.
    
$require_order_authorization 'Y'// The customer's orders must have "payment authorized" status to qualify.
    
$require_order_payment 'Y'// The customer's orders must have "order paid" status to qualify.
    
$results_format 'simple'// The results will be returned as either "Y" or "N".
    
?>


Scenario: 
A customer must have a placed an order within the last 365 days for either product ID 4 or 5.
In addition to a simple "Y" or "N" response, the RMV system will also return an XML document containing the customer's account and order history information.
The IP address of the customer that is logging in must match the IP address on file for that customer.

code
<?php
    $store_url 
'http://www.MyShoppingCartURL.com'// This is the URL of my Modular Merchant online store.
    
$api_key '9c1bc31d15sr23a22c9ba51d621a7b2fd'// My store's secret API key.
    
$product_ids '4,5'// The ID numbers of the required products.
    
$any_all 'any'// A match of any one of the products listed above will qualify the customer.
    
$subscription_vs_order 'order'// The products in the customer's purchase history will be searched.
    
$lookup_range '365'// Just the last 365 days of the customer's order history will be searched.
    
$require_order_authorization 'Y'// The customer's orders must have "payment authorized" status to qualify.
    
$require_order_payment 'Y'// The customer's orders must have "order paid" status to qualify.
    
$results_format 'xml'// In addition to the "Y" or "N" result, the results will also be returned in XML format.
    
?>



— Last Edited - 01/8/2014 9:43am PST
Rank and add a comment to this article
Only logged in users may leave comments and rank articles. Log in to have your say!
  Knowledge Base Home

  QuickCode™ Tag Glossary

  Modular Merchant.com Homepage

Not Logged in.
Either Log in or create a User Account.

Other articles in this category...

Create a Multi-Level RMV Login

Creating Members-Only Websites: Introduction

Troubleshooting RMV installations

Create Members-Only Websites: Simple Method

Create Members-Only Websites: RMV Method

Controlling the RMV System's Behavior with Variables

Working with RMV System Errors

Working with RMV XML Data