Wordpress plugin added

This commit is contained in:
Matt Pass 2018-07-18 09:28:21 +01:00 committed by GitHub
parent d36fd787a4
commit e97626e84e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 52 additions and 0 deletions

52
plugin-wordpress.php Normal file
View File

@ -0,0 +1,52 @@
<?php
/**
* @package BTCP_Pay
* @version 0.1
*/
/*
Plugin Name: BTCP Pay
Plugin URI: http://wordpress.org/plugins/btcp-pay/
Description: Official BTCP Pay plugin from the Bitcoin Private core dev team. Allows users to add their widget button directly into the Wordpress website so they can take Bitcoin Private payments.
Author: Bitcoin Private
Version: 1.0
Author URI: https://btcprivate.org
*/
function btcp_pay_widget() {
echo '
<!-- BTCP Pay Widget // -->
<!-- Set parameters and actions //-->
<script id="btcp_widget_data">
var btcpWidget = {};
btcpWidget.data = {
"id" : "btcp_widget",
"buttonData" : "buy_A1_6",
"merchantid" : "414",
"walletid" : "2",
"amount" : 0.001,
"itemid" : "0",
"description" : "Pepperoni Pizza",
"transactiondetails" :
{
"size" : "12 inch",
"crust" : "stuffed",
"pan" : "thin base"
}
};
btcpWidget.onPaymentSuccess = function(data) {
alert("Payment success! Data:\n\n" + JSON.stringify(data));
};
btcpWidget.onPaymentFail = function(data) {
alert("Payment failed! Reason: " + data.reason);
}
</script>
<!-- Load core functionality //-->
<script src="//mattpass.com/lab/widget.js" id="btcp_widget"></script>
';
}
?>