UNPKG

ilp-plugin-virtual

Version:

ILP virtual ledger plugin for directly transacting connectors

2 lines 4.76 kB
webpackJsonp([13,16],{821:function(e,t,n){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,u,r=n(15),o=l(r),d=n(3),c=l(d),i=n(14),s=l(i),m=n(5),f=l(m),p=n(4),y=l(p),E=n(1),h=l(E),g=n(2),v=l(g),b=n(1732),w=l(b),_=n(17),P=l(_),C=n(1215),k=l(C),N=P.default.bind(k.default),B=(u=a=function(e){function t(){return(0,c.default)(this,t),(0,f.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){var e=this.context.config;return h.default.createElement("div",{className:"panel panel-default"},h.default.createElement("div",{className:"panel-body"},h.default.createElement("h2",null,"Pay Button"),h.default.createElement("div",null,"Pay Button is the best payment flow, on web and mobile. Pay Button builds on top of ILP to provide your users with a streamlined, payment experience that is constantly improving."),h.default.createElement("div",{className:"row"},h.default.createElement("div",{className:"col-sm-6"},h.default.createElement("h3",null,"Demo"),h.default.createElement("p",null,"Try the demo below"),h.default.createElement("div",null,h.default.createElement(w.default,{destination:e.ledgerUri+"/accounts/bob",amount:"10",currencyCode:"USD",countryCode:"US"},"Make Payment")))),h.default.createElement("div",{className:"row"},h.default.createElement("div",{className:"col-sm-12"},h.default.createElement("h3",null,"Integration"),h.default.createElement("p",null,"You can integrate Pay Button using the code below."),h.default.createElement("p",null,"As we release new Pay Button features, we'll automatically roll them out to your existing integration, so that you will always be using our latest technology without needing to change a thing."),h.default.createElement("pre",null,'<script src="https://web-payments.net/polyfill.js"></script>\n\n<script>\nwindow.addEventListener("message", () => {\n document.getElementsByName("payments_polyfill")[0].remove();\n});\n\nfunction makePayment(amount) {\n navigator.requestPayment(["interledger"], {\n amount: amount,\n currencyCode: "USD",\n countryCode: "US"\n }, {\n interledger: {\n account: "'+e.ledgerUri+'/accounts/bob"\n }\n });\n};\n</script>\n\n<button onclick="makePayment(10)">Make Payment</button>'),h.default.createElement("h3",null,"Configuration Options"),h.default.createElement("table",{className:N("table")},h.default.createElement("thead",null,h.default.createElement("tr",null,h.default.createElement("th",null,"Option"),h.default.createElement("th",null,"Description"))),h.default.createElement("tbody",null,h.default.createElement("tr",null,h.default.createElement("td",null,"amount"),h.default.createElement("td",null,"The amount to be sent")),h.default.createElement("tr",null,h.default.createElement("td",null,"currencyCode"),h.default.createElement("td",null,"The currency code")),h.default.createElement("tr",null,h.default.createElement("td",null,"countryCode"),h.default.createElement("td",null,"The country code"))))))))}}]),t}(E.Component),a.contextTypes={config:v.default.object},u);t.default=B,e.exports=t.default},1215:1204,1732:function(e,t,n){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,u,r=n(15),o=l(r),d=n(3),c=l(d),i=n(14),s=l(i),m=n(5),f=l(m),p=n(4),y=l(p),E=n(1),h=l(E),g=n(2),v=l(g),b=(u=a=function(e){function t(){var e,n,l,a;(0,c.default)(this,t);for(var u=arguments.length,r=Array(u),d=0;d<u;d++)r[d]=arguments[d];return n=l=(0,f.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(r))),l.makePayment=function(e){e.preventDefault(),navigator.requestPayment(["interledger"],{amount:l.props.amount,currencyCode:l.props.currencyCode,countryCode:l.props.countryCode},{interledger:{account:l.props.destination}}),tracker.track("PayButton click")},a=n,(0,f.default)(l,a)}return(0,y.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){window.addEventListener("message",function(){document.getElementsByName("payments_polyfill")[0]&&document.getElementsByName("payments_polyfill")[0].remove()})}},{key:"render",value:function(){var e=this.props.children;return h.default.createElement("div",null,h.default.createElement("script",{src:"https://web-payments.net/polyfill.js"}),h.default.createElement("button",{className:"btn btn-success btn-lg",onClick:this.makePayment},e))}}]),t}(E.Component),a.propTypes={children:v.default.string,destination:v.default.string,amount:v.default.string,currencyCode:v.default.string,countryCode:v.default.string},u);t.default=b,e.exports=t.default}}); //# sourceMappingURL=button-a268084bf92548479c71.js.map