Paymentwall付款免密支付宝付款设置密码怎么无法取消?

TECH2IPO/创见
「 新生活 新科技 新零售」
Paymentwall的游戏内支付反响不错
今天宣布已经有超过名开发者在他们的游戏中使用了他们的支付方式来为虚拟物品付款这一拓展支付方式无疑会为开拓更为广阔的市场。他们的说&我们在这个还相对空白的市场上选择了一种其他人都回避了的方式,我们目标是在这一领域能做到头把交椅。&就像他们的名字所暗示的那样.
Paymentwall今天宣布已经有超过1000名开发者在他们的游戏中使用了他们的支付方式来为虚拟物品付款,这一拓展支付方式无疑会为Paymentwall开拓更为广阔的市场。他们的CEO Honor Gunday 说:“我们在这个还相对空白的市场上选择了一种其他人都回避了的方式,我们目标是在这一领域能做到头把交椅。”就像他们的名字所暗示的那样,这家旧金山公司提供各种各样的在线支付手段给他们的用户。你可以从图片中看出,你可以通过PayPal,信用卡,各种移动支付手段或者亚马逊和Google来付钱,就连广告费用他们也没问题。Gunday 说他们支持的支付手段已经达到了75种。由于之前的 Facebook 事件,大批用户在他们不知情的情况下白白交了钱,于是 Facebook 改变了支付策略,并创建了他们的虚拟货币。而Paymentwall则更关心除了Facebook之外的那些游戏和应用。Gunday 说:“这一改变使我们受到很大影响,那些曾使用我们的开发者变得一无所有,只因为 Facebook 修改了策略。”他们表示自己的思路是正确的,因为很多应用都有很多国际玩家,而即使是像PayPal这样的支付手段也不是全球通用的。Paymentwall 最近加入了对中国、俄罗斯和巴西的支持,在这些国家,Facebook 不是主流应用。而对于德国和土耳其的支持也近在眼前。目前,Paymentwall 支持50个国家和20种语言。
请后参与评论About Paymentwall
is the leading digital payments platform for globally monetizing digital goods and services. Paymentwall assists game publishers, dating sites, rewards sites, SaaS companies and many other verticals to monetize their digital content and services.
Merchants can plugin Paymentwall's API to accept payments from over 100 different methods including credit cards, debit cards, bank transfers, SMS/Mobile payments, prepaid cards, eWallets, landline payments and others.
To sign up for a Paymentwall Merchant Account, .
Paymentwall Node.js Library
This library allows developers to use
(Virtual Currency, Digital Goods featuring recurring billing, and Virtual Cart).
To use Paymentwall, all you need to do is to sign up for a Paymentwall Merchant Account so you can setup an Application designed for your site.
To open your merchant account and set up an application, you can .
Installation
To install the library in your environment, simply run the following command:
npm install paymentwall
Then use a code sample below.
Code Samples
Digital Goods API
Initializing Paymentwall
var Paymentwall = require('paymentwall');Paymentwall.Configure(
Paymentwall.Base.API_GOODS,
'YOUR_APPLICATION_KEY',
'YOUR_SECRET_KEY');
Widget Call
The widget is a payment page hosted by Paymentwall that embeds the entire payment flow: selecting the payment method, completing the billing details, and providing customer support via the Help section. You can redirect the users to this page or embed it via iframe. The sample code below renders an iframe with Paymentwall Widget.
var widget = new Paymentwall.Widget(
'user40012',
id of the end-user who's making the payment
widget code, e.g. p1; can be picked in the Widgets section of your merchant account
product details for Flexible Widget Call.
Leave empty if product selection happens on Paymentwall's side
new Paymentwall.Product(
'product301',
id of the product in your system
currency code
'Gold Membership',
product name
if it is a onetime charge product, you don't need to configure time-based part
Paymentwall.Product.TYPE_SUBSCRIPTION,
this is a time-based product
length of product period
Paymentwall.Product.PERIOD_TYPE_MONTH,
type of product period
this is a recurring product
{'email': ''}
additional parameters. for full list check API docs );console.log(widget.getHtmlCode());
Pingback Processing
The Pingback is a webhook notifying about a payment being made. Pingbacks are sent via HTTP/HTTPS to your servers. To process pingbacks use the following code:
var pingback = new Paymentwall.Pingback(&query data in pingback request&, &ip address of pingback&);if (pingback.validate()) {
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());}
Virtual Currency API
Initializing Paymentwall
var Paymentwall = require('paymentwall');Paymentwall.Configure(
Paymentwall.Base.API_VC,
'YOUR_APPLICATION_KEY',
'YOUR_SECRET_KEY');
Widget Call
var widget = new Paymentwall.Widget(
'user40012',
{'email': ''});console.log(widget.getHtmlCode());
Pingback Processing
var pingback = new Paymentwall.Pingback(&query data in pingback request&, &ip address of pingback&);if (pingback.validate()) {
var virtualCurrency = pingback.getVirtualCurrencyAmount();
if (pingback.isDeliverable()) { deliver the virtual currency
} else if (pingback.isCancelable()) { withdraw the virtual currency
console.log('OK');
Paymentwall expects the string OK in response, otherwise the pingback will be resent } else {
console.log(pingback.getErrorSummary());}
Initializing Paymentwall
var Paymentwall = require('paymentwall');Paymentwall.Configure(
Paymentwall.Base.API_CART,
'YOUR_APPLICATION_KEY',
'YOUR_SECRET_KEY');
Widget Call
var widget = new Paymentwall.Widget(
'user40012',
new Paymentwall.Product('product301', 3.33, 'EUR'),
first product in cart
new Paymentwall.Product('product607', 7.77, 'EUR')
second product in cart
{'email': ''});console.log(widget.getHtmlCode());
Pingback Processing
var pingback = new Paymentwall.Pingback(&query data in pingback request&, &ip address of pingback&);if (pingback.validate()) {
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());}
Initializing Paymentwall
var Paymentwall = require('paymentwall');Paymentwall.Configure(
Paymentwall.Base.API_GOODS,
'YOUR_APPLICATION_KEY',
'YOUR_SECRET_KEY');
Create a one-time token
var onetimetoken = new Paymentwall.Onetimetoken(
Card number, digits only
Expiration month, 2 digits from 01 to 12
Expiration year, 4 digits
CVC/CVV, 3-4 digits ); onetimetoken.createOnetimetoken(function(response){ response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
if(response.isSuccessful()){
if(response.isActivated()){
token = response.getOnetimeToken();
get onetimetoken
card = response.getCardInfo();
get card information
error_code = response.getErrorCode();
error_details = response.getErrorDetails();
console.log(response.getFullResponse());});
var charge = new Paymentwall.Charge(
currency code
'description',
description of the product
user's email which can be gotten by req.body.email
'fingerprint',
fingerprint which can be gotten by req.body.brick_fingerprint
'onetimetoken',
one-time token
{'custom[User_prfile_API]':'Value'}
custom parameters ); charge.createCharge(function(brick_response){ brick_response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
if(brick_response.isSuccessful()){
if(brick_response.isCaptured()){
charge_id = brick_response.getChargeId();
deliver goods to user
} else if(brick_response.isUnderReview()){
charge_id = brick_response.getChargeId();
under risk review
} else if(brick_response.isUnder3DSecure()){
return_page = brick_response.get3DHtml();
return 3D secure page
error_code = brick_response.getErrorCode();
handle error
error_details = brick_response.getErrorDetails();
brick_response.getFullResponse();
get full response content in String format
brick_response.getFullResponse('JSON');
get full response content in JSON format });
Charge Details
get the charge details through chargeid var charge = new Paymentwall.Charge();charge.otherOperation(chargeid,'detail',function(brick_response){ brick_response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
brick_response.getFullResponse();
get full response content in String format
brick_response.getFullResponse('JSON');
get full response content in JSON format });
Charge-capture
capture a charge through chargeid var charge = new Paymentwall.Charge();charge.otherOperation(chargeid,'capture',function(brick_response){ brick_response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
brick_response.getFullResponse();
get full response content in String format
brick_response.getFullResponse('JSON');
get full response content in JSON format });
Charge-void
void a charge through chargeid var charge = new Paymentwall.Charge();charge.otherOperation(chargeid,'void',function(brick_response){ response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
brick_response.getFullResponse();
get full response content in String format
brick_response.getFullResponse('JSON');
get full response content in JSON format });
Charge-refund
refund a charge through chargeid var charge = new Paymentwall.Charge();charge.otherOperation(chargeid,'refund',function(brick_response){ response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
brick_response.getFullResponse();
get full response content in String format
brick_response.getFullResponse('JSON');
get full response content in JSON format });
Subscription
create a subscription var subscription = new Paymentwall.Subscription(
currency code
'description',
description of the product
user's email which can be gotten by req.body.email
'fingerprint',
fingerprint which can be gotten by req.body.brick_fingerprint
'onetimetoken',
one-time token
day/week/month/year
{ parameters for trial period
'trial[amount]':0.5,
'trial[currency]':'USD',
'trial[period]':'day',
'trial[period_duration]':3
{'custom[User_prfile_API]':'Value'}
custom parameters, if there is a trail, plan is required ); subscription.createSubscription(function(brick_response){ brick_response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
if(brick_response.isSuccessful()){
if(brick_response.isActivated()&&brick_response.isStarted()){
subscription_id = getSubscriptionId();
charge_id = brick_response.getChargeId();
deliver goods to user
} else if(brick_response.isUnderReview()){
subscription_id = getSubscriptionId();
charge_id = brick_response.getChargeId();
under risk review
} else if(brick_response.isUnder3DSecure()){
return_page = brick_response.get3DHtml();
return 3D secure page
error_code = brick_response.getErrorCode();
handle error
error_details = brick_response.getErrorDetails();
brick_response.getFullResponse();
get full response content in String format
brick_response.getFullResponse('JSON');
get full response content in JSON format });
Subscription-details
get the subscription details through subscriptionid var subscription = new Paymentwall.Subscription();subscription.otherOperation(subscriptionid,'detail',function(response){ response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
response.getFullResponse();
get full response content in String format
response.getFullResponse('JSON');
get full response content in JSON format });
Subscription-cancel
cancel a subscription through subscriptionid var subscription = new Paymentwall.Subscription();subscription.otherOperation(subscriptionid,'cancel',function(response){ response is a new Response Object Entity (defined in paymentwall/lib/Response/Abstract)
response.getFullResponse();
get full response content in String format
response.getFullResponse('JSON');
get full response content in JSON format });
Pingback Processing
The Pingback is a webhook notifying about a payment being made. Pingbacks are sent via HTTP/HTTPS to your servers. To process pingbacks use the following code:
var pingback = new Paymentwall.Pingback(&query data in pingback request&, &ip address of pingback&);if (pingback.validate()) {
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());}
Signature API
Widget Signature
var Paymentwall = require('paymentwall');var widget_signature = Paymentwall.WidgetSignature.calculateSignature(parameters,secret_key, signature_version);
Pingback Signature
var Paymentwall = require('paymentwall');var pingback_signature = Paymentwall.PingbackSignature.calculateSignature(parameters,secret_key, signature_version);
T10:21:29.742Z
is the latest
of 8 releases
Collaborators
downloads in the last day
downloads in the last week
downloads in the last month
Have an issue?
Try it out
Dependenciespaymentwall/paymentwall-php - Packagist
Paymentwall PHP Library. Paymentwall is the leading digital payments platform for globally monetizing digital goods and services.
php: &=5.2ext-curl: *ext-json: *
Requires (Dev)
: 2.4.*@stable
bbdd0ed519b95e8f9a6ca721cbd3ce
Paymentwall Team
is the leading digital payments platform for globally monetizing digital goods and services. Paymentwall assists game publishers, dating sites, rewards sites, SaaS companies and many other verticals to monetize their digital content and services.
Merchants can plugin Paymentwall's API to accept payments from over 100 different methods including credit cards, debit cards, bank transfers, SMS/Mobile payments, prepaid cards, eWallets, landline payments and others.
To sign up for a Paymentwall Merchant Account, .
Paymentwall PHP Library
This library allows developers to use
(Virtual Currency, Digital Goods featuring recurring billing, and Virtual Cart).
To use Paymentwall, all you need to do is to sign up for a Paymentwall Merchant Account so you can setup an Application designed for your site.
To open your merchant account and set up an application, you can .
Installation
To install the library in your environment, you can download the , unzip it and place into your project.
Alternatively, you can run:
git clone git://github.com/paymentwall/paymentwall-php.git
Then use a code sample below.
Code Samples
Digital Goods API
Initializing Paymentwall
Using Paymentwall PHP Library v2:
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Config::getInstance()-&set(array(
'api_type' =& Paymentwall_Config::API_GOODS,
'public_key' =& 'YOUR_PUBLIC_KEY',
'private_key' =& 'YOUR_PRIVATE_KEY'
Using Paymentwall PHP Library v1 (deprecated in v2):
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Base::setApiType(Paymentwall_Base::API_GOODS);
Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymentwall merchant area
Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area
Widget Call
The widget is a payment page hosted by Paymentwall that embeds the entire payment flow: selecting the payment method, completing the billing details, and providing customer support via the Help section. You can redirect the users to this page or embed it via iframe. Below is an example that renders an iframe with Paymentwall Widget.
$widget = new Paymentwall_Widget(
'user40012',
// id of the end-user who's making the payment
// widget code, e.g. can be picked inside of your merchant account
// product details for Flexible Widget Call. To let users select the product on Paymentwall's end, leave this array empty
new Paymentwall_Product(
'product301',
// id of the product in your system
// currency code
'Gold Membership',
// product name
Paymentwall_Product::TYPE_SUBSCRIPTION, // this is a time- for one-time products, use Paymentwall_Product::TYPE_FIXED and omit the following 3 array elements
// duration is 1
Paymentwall_Product::PERIOD_TYPE_MONTH, //
// recurring
array('email' =& '')
// additional parameters
echo $widget-&getHtmlCode();
Pingback Processing
The Pingback is a webhook notifying about a payment being made. Pingbacks are sent via HTTP/HTTPS to your servers. To process pingbacks use the following code:
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Base::setApiType(Paymentwall_Base::API_GOODS);
Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymentwall merchant area
Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area
$pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
if ($pingback-&validate()) {
$productId = $pingback-&getProduct()-&getId();
if ($pingback-&isDeliverable()) {
// deliver the product
} else if ($pingback-&isCancelable()) {
// withdraw the product
} else if ($pingback-&isUnderReview()) {
// set "pending" status to order
echo 'OK'; // Paymentwall expects response to be OK, otherwise the pingback will be resent
echo $pingback-&getErrorSummary();
Virtual Currency API
Initializing Paymentwall
Using Paymentwall PHP Library v2:
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Config::getInstance()-&set(array(
'api_type' =& Paymentwall_Config::API_VC,
'public_key' =& 'YOUR_PUBLIC_KEY',
'private_key' =& 'YOUR_PRIVATE_KEY'
Using Paymentwall PHP Library v1 (deprecated in v2):
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Base::setApiType(Paymentwall_Base::API_VC);
Paymentwall_Base::setAppKey('YOUR_PUBLIC_KEY'); // available in your Paymentwall merchant area
Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area
Widget Call
$widget = new Paymentwall_Widget(
'user40012', // id of the end-user who's making the payment
// widget code, e.g. p1; can be picked inside of your merchant account
// array of products - leave blank for Virtual Currency API
array('email' =& '') // additional parameters
echo $widget-&getHtmlCode();
Pingback Processing
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Base::setApiType(Paymentwall_Base::API_VC);
Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymentwall merchant area
Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area
$pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
if ($pingback-&validate()) {
$virtualCurrency = $pingback-&getVirtualCurrencyAmount();
if ($pingback-&isDeliverable()) {
// deliver the virtual currency
} else if ($pingback-&isCancelable()) {
// withdraw the virtual currency
} else if ($pingback-&isUnderReview()) {
// set "pending" status to order
echo 'OK'; // Paymentwall expects response to be OK, otherwise the pingback will be resent
echo $pingback-&getErrorSummary();
Initializing Paymentwall
Using Paymentwall PHP Library v2:
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Config::getInstance()-&set(array(
'api_type' =& Paymentwall_Config::API_CART,
'public_key' =& 'YOUR_PUBLIC_KEY',
'private_key' =& 'YOUR_PRIVATE_KEY'
Using Paymentwall PHP Library v1 (deprecated in v2):
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Base::setApiType(Paymentwall_Base::API_CART);
Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymentwall merchant area
Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area
Widget Call
Stored products call example (when products are stored in Paymentwall):
$widget = new Paymentwall_Widget(
'user40012', // id of the end-user who's making the payment
// widget code, e.g. p1; can be picked inside of your merchant account,
new Paymentwall_Product('product301', 3.33, 'EUR'), // first product in cart
new Paymentwall_Product('product607', 7.77, 'EUR')
// second product in cart
array('email' =& '') // additional params
echo $widget-&getHtmlCode();
Non-stored products call example (when products are not stored in Paymentwall):
$widget = new Paymentwall_Widget(
'user40012', // id of the end-user who's making the payment
// widget code, e.g. p1; can be picked inside of your merchant account,
new Paymentwall_Product('product301', 3.33, 'EUR', 'Product 1'), // first product in cart
new Paymentwall_Product('product607', 7.77, 'EUR', 'Product 2')
// second product in cart
array('email' =& '', 'flexible_cart_api' =& 1) // additional params
echo $widget-&getHtmlCode();
Pingback Processing
require_once('/path/to/paymentwall-php/lib/paymentwall.php');
Paymentwall_Base::setApiType(Paymentwall_Base::API_CART);
Paymentwall_Base::setAppKey('YOUR_APPLICATION_KEY'); // available in your Paymentwall merchant area
Paymentwall_Base::setSecretKey('YOUR_SECRET_KEY'); // available in your Paymentwall merchant area
$pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
if ($pingback-&validate()) {
$products = $pingback-&getProducts();
if ($pingback-&isDeliverable()) {
// deliver products from the cart
} else if ($pingback-&isCancelable()) {
// withdraw products from the cart
} else if ($pingback-&isUnderReview()) {
// set "pending" status to order
echo 'OK'; // Paymentwall expects response to be OK, otherwise the pingback will be resent
echo $pingback-&getErrorSummary();
Initializing Paymentwall
Paymentwall_Config::getInstance()-&set(array(
'public_key' =& 'YOUR_PUBLIC_KEY',
'private_key' =& 'YOUR_PRIVATE_KEY'
Create a one-time token
$tokenModel = new Paymentwall_OneTimeToken();
$tokenModel-&create(array(
'public_key' =& Paymentwall_Config::getInstance()-&getPublicKey(),
'card[number]' =& '4242',
'card[exp_month]' =& '11',
'card[exp_year]' =& '19',
'card[cvv]' =& '123'
// send token to charge via $token-&getToken();
$charge = new Paymentwall_Charge();
$charge-&create(array(
// if generated via backend
//'token' =& $token-&getToken(),
// if generated via brick.js
'token' =& $_POST['brick_token'],
'email' =& $_POST['email'],
'currency' =& 'USD',
'amount' =& 10,
'fingerprint' =& $_POST['brick_fingerprint'],
'description' =& 'Order #123'
$response = $charge-&getPublicData();
if ($charge-&isSuccessful()) {
if ($charge-&isCaptured()) {
// deliver s product
} elseif ($charge-&isUnderReview()) {
// decide on risk charge
$errors = json_decode($response, true);
echo $errors['error']['code'];
echo $errors['error']['message'];
echo $response; // need for JS communication
Charge - refund
$charge = new Paymentwall_Charge('CHARGE_ID');
$charge-&refund();
echo $charge-&isRefunded();
Subscription
$subscription = new Paymentwall_Subscription();
$subscription-&create(array(
// if generated via backend
//'token' =& $token-&getToken(),
// if generated via brick.js
'token' =& $_POST['brick_token'],
'email' =& $_POST['email'],
'currency' =& 'USD',
'amount' =& 10,
'fingerprint' =& $_POST['brick_fingerprint'],
'plan' =& 'product_123',
'description' =& 'Order #123',
'period' =& 'week',
'period_duration' =& 2,
// if trial, add following parameters
'trial[amount]' =& 1,
'trial[currency]' =& 'USD',
'trial[period]'
=& 'month',
'trial[period_duration]' =& 1
echo $subscription-&getId();
Subscription - cancel
$subscription = new Paymentwall_Subscription('SUBSCRIPTION_ID');
$subscription-&cancel();
echo $subscription-&isActive();
Signature calculation - Widget
$widgetSignatureModel = new Paymentwall_Signature_Widget();
echo $widgetSignatureModel-&calculate(
array(), // widget params
2 // signature version
Signature calculation - Pingback
$pingbackSignatureModel = new Paymentwall_Signature_Pingback();
echo $pingbackSignatureModel-&calculate(
array(), // pingback params
1 // signature version
Initializing Paymentwall
Paymentwall_Config::getInstance()-&set(array(
'public_key' =& 'YOUR_PUBLIC_KEY',
'private_key' =& 'YOUR_PRIVATE_KEY'
Get a token
$model = new Paymentwall_Mobiamo();
$tokenParams = [
'uid' =& 'test'
$response = $model-&getToken($tokenParams);
if (!empty($response['success'])) {
//store this token and expire time (default is 86400s) to use in all next requests
//example of success response:
'success' =& 1,
'token' =& 'randomString',
'expire_time' =& 86400
var_dump($response['token']);
var_dump($response['expire_time']);
var_dump($response['error']);
var_dump($response['code']);
Init payment
$model = new Paymentwall_Mobiamo();
$initParams = [
'uid' =& 'test',
'amount' =& 1,
'currency' =& 'GBP', //currency of payment in ISO 4217 format
'country' =& 'GB', //country of payment in ISO alpha-2 format
'product_id' =& 123, //product id of payment
'product_name' =& 'test_product_name', //product name of payment
'msisdn' =& '', //optional - phone number of user in internaltional format
'carrier' =& '19', //mandatory in some countries - Given id of user's operator
'mcc' =& '262', //optional - mobile country code of user
'mnc' =& '007', //optional - mobile netword code of user
'is_recurring' =& 1, //optional and only available in some countries - value: 1/0 - determine if this payment is recurring subscription
'period' =& 'd', //mandatory if is_recurring = 1 - value: d (day) - w (week) - m (month) - period of the recurring
'period_value' =& 1 //mandatory if is_recurring = 1 - value: positive number - value of the recurring period
//token returned from get token step above
$response = $model-&initPayment($token, $initParams);
if (!empty($response['success'])) {
/** example of success response:
'success' =& true,
'ref' =& 'w', //reference id of payment.
'flow' =& 'code', //next flow of this payment. values can be: code/pinless - user send sms contain keyword to shortcode in instructions/ msisdn - user input phone number / redirect - redirect user to redirect_url in intructions
'price' =& [
'amount' =& 1,
'currency' =& 'GBP',
'formatted' =& 'GBP 1.00',
'carriers' =& [
'id' =& 19,
'name' =& 'O2',
'instructions' =& [
'keyword' =& 'test_keyword', //return if flow = code/pinless - sms message content for user to send
'shortcode' =& '123456', //return if flow = code/pinless - the number user should send message to
'redirect_url' =& 'http://google.com' //return if flow = redirect - url user should be redirected to
'product_name' =& 'test_product_name',
//Store the parameter ref
var_dump($response['error']);
var_dump($response['code']);
Process payment (Use this request if previous response has flow = code/msisdn)
$model = new Paymentwall_Mobiamo();
$processParams = [
'uid' =& 'test',
'ref' =& 'w', //reference id returned from init request
'flow' =& 'code', //flow returned from init request
'data' =& 'ABCDEF' //value can be: code user received after sending message / phone number of user
//token returned from get token step above
$response = $model-&processPayment($token, $processParams);
if (!empty($response['success'])) {
/** example of success response:
'success' =& true,
'flow' =& 'redirect', //Only return if this payment requires next processing step. values can be: code - user send keyword to shortcode in instructions/ msisdn - user input phone number / redirect - redirect user to redirect_url in intructions /
'instructions' =& [
'keyword' =& 'test_keyword', //return if flow = code/pinless - sms message content for user to send
'shortcode' =& '123456', //return if flow = code/pinless - the number user should send message to
'redirect_url' =& 'http://google.com' //return if flow = redirect - url user should be redirected to
var_dump($response['error']);
var_dump($response['code']);
Get payment info
$model = new Paymentwall_Mobiamo();
$getPaymentParams = [
'uid' =& 'test',
'ref' =& 'w', //reference id returned from init request
//token returned from get token step above
$response = $model-&processPayment($token, $getPaymentParams);
if (!empty($response['success'])) {
/** example of success response:
'success' =& true,
'completed' =& true, //value: true/false - indicate this payment was already successfull or not
'amount' =& 1,
'currency' =& "GBP",
'country' =& "GB",
'product_name' =& "test_product_name",
'msisdn' =& "",
'ref' =& "w"
var_dump($response['error']);
var_dump($response['code']);

我要回帖

更多关于 paymentwall 免密支付 的文章

 

随机推荐