With neko-po.net Standard and Express, you can easily and safely receive online payments from your customer.
If payer wants to fund payments using neko-po.net, set payer to neko-po.net.(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 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);
取引が完了またはキャンセルされた後に購入者がリダイレクトする URL を設定します。
//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/
これはすべての PayerAmountRedirectUrls販売者の資格情報 (Client ID と Client Secret) を設定する必要がある支払いリソースです。支払いオブジェクトに初期化された後create メソッドを呼び出す必要があります。リダイレクト URL が生成されます。ユーザーはリダイレクトする必要があります。 トランザクションを完了するにはこの URL にアクセスしてください。
//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; }
さあ,行きましょう php-sdk/src/PayMoney/Rest/Connection.php, それでは変更します BASE_URL value to your domain name(i.e: If the domain is - 'your-domain.com' then, define( 'BASE_URL' , 'http://your-domain.com/' ) )
サンプルコード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);
SDK を構成して抽出した後に変更が表示されない場合はSDK ルートに移動して以下のコマンドを実行してください。:-