API DOCUMENTATION
With Pay Money Standard and Express, you can easily and safely receive online payments from your customer.
Get StartedWe’re a technology partner to thousands of organizations – all collaborating and connecting to simplify global payments. And our track record is built on robust APIs, plus expert knowledge and support.
With Pay Money Standard and Express, you can easily and safely receive online payments from your customer.
To generate the merchant Standard Payment Gateway, navigate to the left sidebar of your dashboard and select the option that says 'Merchant'.
Click the gear icon next to 'Standard type'. If you don\'t see the gear icon, please wait for the admin to approve your merchant account.
A form will pop up on your screen. Enter the details of your item, such as its name, order number, price and so on.
Click on Generate button under the popup form. A html code will be created.
To copy the code you created, click on the 'Copy' button in the top right corner of Form.
To display the PayNow button for your customer, insert the code you copied into your html file.
Save it in html file format. Then, send the link of the Pay Now button to your customer.
Payer
If payer wants to fund payments using Pay Money, set payer to Pay Money.(Other payment method ex: paypal, stripe, coin payments etc not available yet).
//Payer Object
$payer = new Payer();
$payer->setPaymentMethod('PayMoney'); //preferably, your system name, example - PayMoney
Amount
Specify a payment amount and the currency.
//Amount Object
$amountIns = new Amount();
$amountIns->setTotal(20)->setCurrency('USD'); //must give a valid currency code and must exist in merchant wallet list
Transaction
It’s a Transaction resource where amount object has to set.
//Transaction Object
$trans = new Transaction();
$trans->setAmount($amountIns);
RedirectUrls
Set the urls where buyer should redirect after transaction is completed or cancelled.
//RedirectUrls Object
$urls = new RedirectUrls();
$urls->setSuccessUrl('http://your-merchant-domain.com/example-success.php') //success url - the merchant domain page, to
redirect after successful payment, see sample example-success.php file in sdk root, example -
http://techvill.net/PayMoney_sdk/example-success.php
->setCancelUrl('http://your-merchant-domain.com/');//cancel url - the merchant domain page, to redirect after
cancellation of payment, example - http://techvill.net/PayMoney_sdk/
Payment
It’s a payment resource where all Payer, Amount, RedirectUrls and Credentials of merchant (Client ID and Client Secret) have to set. After initialized into payment object, need to call create method. It will generate a redirect URL. Users have to redirect into this URL to complete the transaction.
//Payment Object
$payment = new Payment();
$payment->setCredentials([ //client id & client secret, see merchants->setting(gear icon)
'client_id' => 'place your client id here', //must provide correct client id of an express merchant
'client_secret' => 'place your client secret here' //must provide correct client secret of an express merchant
])->setRedirectUrls($urls)
->setPayer($payer)
->setTransaction($trans);
try {
$payment->create(); //create payment
header("Location: ".$payment->getApprovedUrl()); //checkout url
} catch (Exception $ex) {
print $ex;
exit; }
Click download for the package
DownloadNow, go to php-sdk/src/PayMoney/Rest/Connection.php, then change BASE_URL value to your domain name(i.e: If the domain is - 'your-domain.com' then, define( 'BASE_URL' , 'http://your-domain.com/' ) )
Example code/*** * ***/ require 'vendor/autoload.php'; //if you want to change the namespace/path from 'PayMoney' - lines[1-5] - //to your desired name, i.e. (use PayMoney\Api\Amount; //to use MyDomain\Api\Amount;), then you must change the folders name that holds the API classes //as well as change the property 'PayMoney' in (autoload->psr-0) of (php-sdk/composer.json) file to your //desired name and run "composer dump-autoload" command from sdk root use PayMoney\Api\Payer; use PayMoney\Api\Amount; use PayMoney\Api\Transaction; use PayMoney\Api\RedirectUrls; use PayMoney\Api\Payment; //Payer Object $payer = new Payer(); $payer->setPaymentMethod('PayMoney'); //preferably, your system name, example - PayMoney //Amount Object $amountIns = new Amount(); $amountIns->setTotal(20)->setCurrency('USD'); //must give a valid currency code and must exist in merchant wallet list //Transaction Object $trans = new Transaction(); $trans->setAmount($amountIns);
If you don't see changes after configuring and extracting SDK, go to your SDK root and run the commands below:-
Download WooCommerce Plugin
To install WooCommerce Plugin in your admin panel, you need to first click on the download button to get the plugin file on your computer.
Go to Plugins Menu in Admin Penal
After downloading the plugin (which will be a zip file), you will need to go to WordPress admin area and click Plugins
Click Add New
To install WooCommerce Plugin in your admin panel, you need to first click on the download button to get the plugin file on your computer.
Upload Plugin
After that, you will an Upload Plugin button on top of the page. Click here that bring you to the plugin upload page. Here you need to click on the choose file button and select the plugin file you downloaded earlier to your computer.
Install Plugin
After upending your WooCommerce plugin file, you need to click on the install now button.