Setup Subscription Plan

Please log in to Merchant Area, navigate to Tokidoki section and configure subscription package information according to steps below.

Please check the description of parameters below, which may appear via your configuration.

Name Description
Active If Active = Yes, package is able to be shown in checkout page
If Active = No, package isn’t able to be shown in checkout page
Package name
required
Name of package, which will be presented in checkout page and notification emails.
Package SKU ID
required
Unique number to mark different packages.
Price
required
The price which would be charged every duration.
Discount price
optional
It will be applied instead of price during the entire subscription period.
Charge user every
required
The timeframe to charge user.
Subscription runs (limited)
required
Subscription period and billing interval can be up to 12 months(Default).
Subscription runs (unlimited)
required
Subscription can last forever until cancelled or stop after a duration of time. Please contact merchantsupport@paymentwall.com for activation.
Trial Type
optional
No trial
Free trial: If free trial is selected, initial trial period textbox will be shown allowing you to input the number of day to use free-trial.
Paid trial: If paid trial is selected, price and initial trial period textbox will be shown allowing you to input the duration of trial and price for that trial period.

Step 1: Add new package

Click “ADD NEW PACKAGE”.

Step 2: Configure package information

Configure product information, please refer to parameter description if doubted.

Step 3: Save and manage

Click “save” and check subscription plan you have created.

Step 4: API implementation.

Step 5: Handle Pingback

Before you start, please read Pingbacks document to get an overview of Paymentwall Pingback system.

Sample Pingback Request for Digital Goods :

http://www.yourserver.com/anypath?uid=pwuser&goodsid=gold_membership&slength=1&speriod=month&type=0&ref=b1493096790&sign_version=2&sig=d94b23ba8585f29978706dd1b153ead9

Sample code using Paymentwall API Libraries at GitHub.

<?php
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Config::getInstance()->set(array(
    'api_type' => Paymentwall_Config::API_GOODS,
    'public_key' => 'YOUR_APPLICATION_KEY', // available in your Paymentwall merchant area
    'private_key' => 'YOUR_SECRET_KEY', // available in your Paymentwall merchant area
));

$pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
if ($pingback->validate(true)) {
    $productId = $pingback->getProduct()->getId();
    if ($pingback->isDeliverable()) {
        // deliver the product
    } else if ($pingback->isCancelable()) {
        // withdraw the product
    } else if ($pingback->isUnderReview()) {
        // set "pending" as order status
    }
    echo 'OK'; // Paymentwall expects response to be OK, otherwise the pingback will be resent
} else {
    echo $pingback->getErrorSummary();
}
?>
var Paymentwall = require('paymentwall');
Paymentwall.Configure(
    Paymentwall.Base.API_GOODS,
    'YOUR_PROJECT_KEY',
    'YOUR_SECRET_KEY'
);

var pingback = new Paymentwall.Pingback("query data in pingback request", "ip address of pingback");
if (pingback.validate(true)) {
    var productId = pingback.getProduct().getId();
    if (pingback.isDeliverable()) {
        // deliver the product
    } else if (pingback.isCancelable()) {
        // withdraw the product
    } 
    console.log('OK'); // Paymentwall expects the string OK in response, otherwise the pingback will be resent
} else {
    console.log(pingback.getErrorSummary());
}
import com.paymentwall.java.*;

Config.getInstance().setLocalApiType(Config.API_GOODS);
Config.getInstance().setPublicKey("YOUR_PROJECT_KEY");
Config.getInstance().setPrivateKey("YOUR_SECRET_KEY");

Pingback pingback = new Pingback(request.getParameterMap(), request.getRemoteAddr());
if (pingback.validate(true)) {
    String goods = pingback.getProductId();
    String userId = pingback.getUserId();
    if (pingback.isDeliverable()) {
        // deliver Product to user with userId
    } else if (pingback.isCancelable()) {
        // withdraw Product from user with userId
    }
    return "OK";
} else {
    return pingback.getErrorSummary();
}
require 'paymentwall' # alternatively, require_relative '/path/to/paymentwall-ruby/lib/paymentwall.rb'
Paymentwall::Base::setApiType(Paymentwall::Base::API_GOODS)
Paymentwall::Base::setAppKey('YOUR_PROJECT_KEY') # available in your Paymentwall merchant area
Paymentwall::Base::setSecretKey('YOUR_SECRET_KEY') # available in your Paymentwall merchant area

pingback = Paymentwall::Pingback.new(request_get_params, request_ip_address)
if pingback.validate(true)
    productId = pingback.getProduct().getId()
    if pingback.isDeliverable()
        # deliver the product
    elsif pingback.isCancelable()
        # withdraw the product
    end 
    puts 'OK' # Paymentwall expects response to be OK, otherwise the pingback will be resent
else
    puts pingback.getErrorSummary()
end
from paymentwall import *
Paymentwall.set_api_type(Paymentwall.API_GOODS)
Paymentwall.set_app_key('YOUR_PROJECT_KEY') # available in your merchant area
Paymentwall.set_secret_key('YOUR_SECRET_KEY') # available in your merchant area

pingback = Pingback({x:y for x, y in request.args.iteritems()}, request.remote_addr)

if pingback.validate(True):
    product_id = pingback.get_product().get_id()
    if pingback.is_deliverable():
        # deliver the product
        pass
    elif pingback.is_cancelable():
        # withdraw the product
        pass

    print('OK') # Paymentwall expects response to be OK, otherwise the pingback will be resent

else:
    print(pingback.get_error_summary())
using Paymentwall;

Paymentwall_Base.setApiType(Paymentwall_Base.API_GOODS);
Paymentwall_Base.setAppKey("YOUR_PROJECT_KEY"); // available in your Paymentwall merchant area
Paymentwall_Base.setSecretKey("YOUR_SECRET_KEY"); // available in your Paymentwall merchant area


NameValueCollection parameters = Request.QueryString;
Paymentwall_Pingback pingback = new Paymentwall_Pingback(parameters, HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);
if (pingback.validate(true))
{
    string productId = pingback.getProduct().getId();
    if (pingback.isDeliverable())
    {
        //deliver the product
    }
    else if (pingback.isCancelable())
    {
        //withdraw the product
    }
    Response.Write("OK"); // Paymentwall expects response to be OK, otherwise the pingback will be resent
}
else {
    Response.Write(pingback.getErrorSummary());
}

Before you submit the project, please test your pingback integration using Test Pingback Tool.

You should check whether your Pingback listener is :

  • responding OK to Paymentwall pingback requests.
  • filtering duplicate reference id requests.
  • filtering wrong signature requests. You can test this by checking Use a dummy value feature in Test Pingback Tool.

Step 6: Success Page

If you would like to redirect the user after a payment is made, you can pass the success_url and failure_url parameters as optional parameter that will be used as the address of landing page after your users made payments. You can also use client side callback if you want to take more actions.

To enable client side callback, please contact to devsupport@paymentwall.com with your Paymentwall account email address.


Next Step

Once you have successfully integrated our widget and set up for the pingback listener, you can submit your project for review.

See project go live.