Skip to content

Instantly share code, notes, and snippets.

//to generate qr code for a product
POST curl https://pwcstaging.herokuapp.com/product/getQrCode
-H "Authorization: Bearer [access_token_here]"
-d merchant_id=jeeh
-d name=hgfh
-d description=selling that thing
-d amount_locked=true //can be true or false
-d amount=10000
-d image=fhfggfjfghghgg //A base64 encode image string
var PayWithCaptureClient = require('PayWithCapture');
var clientId = "", //Your client id is in devcenter account page
clientSecret = "", //Your clientSecret is in devcenter account page
env = "staging"; //can be staging or production
var client = new PayWithCaptureClient(clientId, clientSecret, env);
var qrClient = client.getQrCode();
data = {
"merchant_id": "",
<?php
use PayWithCapture\Services\Authentication;
use PayWithCapture\Services\QRCode;
$auth = new Authentication($this->clientId, $this->clientSecret);
$auth->loadAccessToken();
$token = $auth->getAccessToken();
$qrClient = new QRCode($token);
$data = array(
"merchant_id" => "",
<?php
use PayWithCapture\PayWithCaptureClient;
//You can find your clientId, $clientSecret in your PayWithCapture DevCenter settings page
$clientId = "745474656hdhdgftfyfjfkg";
$clientSecret = "jyrtr64546470od";
$env = "staging"; // $env should be "staging" when in dev mode and in production change to "production"
$client = new PayWithCaptureClient($clientId, $clientSecret, $env);
$otpClient = $client->getOtpClient();
POST curl https://pwcstaging.herokuapp.com/otp/authenticate
-H "Authorization: Bearer [access_token_here]"
-d otp=446
-d phonenumber=+2349098090424
var PayWithCapture = require('PayWithCapture');
var clientId = "eyet636484u4h", //Your clientId is in your PayWithCapture DevCenter account page
clientSecret = "736484yekhgutit857485", //Your clientSecret is in your PayWithCapture DevCenter account page
env = "staging"; // env can either be staging or production
var pwcClient = new PayWithCapture(clientId, clientSecret, env);
var otpClient = pwcClient.getOtp();
//this method will send otp to phone number
otpClient.sendSmsOtp(phone)
<?php
use PayWithCapture\PayWithCaptureClient;
//You can find your clientId, $clientSecret in your PayWithCapture DevCenter settings page
$clientId = "745474656hdhdgftfyfjfkg";
$clientSecret = "jyrtr64546470od";
$env = "staging"; // $env should be "staging" when in dev mode and in production change to "production"
$client = new PayWithCaptureClient($clientId, $clientSecret, $env);
$otpClient = $client->getOtpClient();
GET curl https://pwcstaging.herokuapp.com/otp/sms/[phonenumber_here]
-H "Authorization: Bearer [access_token_here]"
or
GET curl https://pwcstaging.herokuapp.com/otp/voice/[phonenumber_here]
-H "Authorization: Bearer [access_token_here]"
@darilldrems
darilldrems / pwc-pos-example-node.js
Created July 21, 2016 16:43
PwC pos printing example in javascript for Nodejs server application.
var PayWithCapture = require('PayWithCapture');
var clientId = "eyet636484u4h", //Your clientId is in your PayWithCapture DevCenter account page
clientSecret = "736484yekhgutit857485", //Your clientSecret is in your PayWithCapture DevCenter account page
env = "staging"; // env can either be staging or production
var pwcClient = new PayWithCapture(clientId, clientSecret, env);
var posClient = pwcClient.getPosPrinting();
var merchantCode = "474649"; //You merchant code is in your account page on PayWithCapture DevCenter
//this method will return transactions done by a merchant
@darilldrems
darilldrems / pwc-pos-example.php
Created July 21, 2016 16:40
PwC pos printing example in php
<?php
use PayWithCapture\PayWithCaptureClient;
$clientId = ""; //Your client id is in your devcenter account page
$clientSecret = ""; //Your client secret is in your devcenter account page
$env = "staging"; //this can either be staging or production
$client = new PayWithCaptureClient($clientId, $clientSecret, $env);
$posClient = $client->getPOSPrintingClient();