小编And*_*tov的帖子

一个值得开发人员友好的PayPal替代品

我知道付款是件很棘手的事情,但我还没有找到PayPal的替代品.我想改变PayPal,因为我觉得它们价格昂贵而且并不适用于所有国家.此外,我认为API已经足够,但可能会更好.然而,API文档完全是废话.

我正在寻找更适合开发人员的支付/交易服务,最好是:

  • 一个干净且结构良好的REST API
  • 优秀的开发人员工具和沙盒
  • 良好的示例API实现,最好是Python或Ruby
  • 全球信用卡/借记卡保险
  • 价格比PayPal便宜(或选择付款计划的可能性)

我认为Google Checkout有点值得,但它要求开发者和潜在购买者都拥有Google帐户.非常感谢任何其他建议!

payment paypal credit-card payment-gateway

95
推荐指数
3
解决办法
1万
查看次数

如何从亚马逊vpc连接外部世界?

我通过向导将amazon VPC设置为"仅公共网络",因此我的所有实例都在公共子网中.

VPC中分配了弹性IP的实例可以毫无困难地连接到Internet.

但没有弹性IP的实例无法连接到任何地方.

互联网网关存在.aws控制台中的路由表看起来像

Destination Target 
10.0.0.0/16 local
0.0.0.0/0   igw-nnnnn
Run Code Online (Sandbox Code Playgroud)

和实例内部的路线显示

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.255.255.0   U     0      0        0 eth0
default         10.0.0.1        0.0.0.0         UG    100    0        0 eth0
Run Code Online (Sandbox Code Playgroud)

我尝试将所有入站和出站流量打开到实例所属的安全组中的0.0.0.0/0.仍然没有成功.

~$ ping google.com
PING google.com (74.125.224.36) 56(84) bytes of data.
^C
--- google.com ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5017ms
Run Code Online (Sandbox Code Playgroud)

我还可以做些什么?

connectivity amazon-ec2 vpc amazon-web-services amazon-vpc

52
推荐指数
3
解决办法
6万
查看次数

jq&bash:从变量中生成JSON数组

我正在使用jq从变量值在bash中形成JSON.

有如何制作纯变量

$ VAR="one two three"
$ jq -n "{var:\"$VAR\"}"
{
  "var": "one two three"
}
Run Code Online (Sandbox Code Playgroud)

但是还不能制作阵列.我有

$ echo $ARR
one
two
three
Run Code Online (Sandbox Code Playgroud)

并希望获得类似的东西

{
  "arr": ["one", "two", "three"]
}
Run Code Online (Sandbox Code Playgroud)

我只是设法得到乱码输出

$ jq -n "{arr: [\"$ARR\"]}"
{
  "arr": [
    "one\ntwo\nthree"
  ]
}
Run Code Online (Sandbox Code Playgroud)

如何以正确的方式形成JSON数组?能jq做到吗?

编辑:当只有jq 1.3时问的问题.现在,在jq 1.4中,我可以直接按照我要求的那样做,比如@JeffMercado和@peak建议,为他们提供支持.但是不会撤消对@jbr的回答的接受.

arrays bash json jq

20
推荐指数
6
解决办法
4万
查看次数

如何在spring的xmls中定义变量以在log4j.properties中使用

这里有点难题.

我在WAR中有一个应用程序.那里有web.xml和application context.xml,还有log4j.properties.此WAR在tomcat中运行.

有可能在log4j.properties中使用一些变量,例如 log4j.appender.file.File=${catalina.base}/logs/app.log

我想在web.xml或context.xml中定义一个变量,并在log4j.properties中使用它.例如,以某种方式设置version=1.1和使用log4j.appender.file.File=${catalina.base}/logs/app-${version}.log.它不应该是环境变量.

我可以不重新编译应用程序吗?

ADD 不应该影响任何事情,但以防万一......

它的web.xml如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
     version="2.5"
     xmlns="http://java.sun.com/xml/ns/javaee">

<!-- Spring -->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:context.xml</param-value>
</context-param>

<!-- log4j -->
<listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>classpath:log4j.properties</param-value>
</context-param>
<context-param>
    <param-name>log4jRefreshInterval</param-name>
    <param-value>10000</param-value>
</context-param>
<context-param>
    <param-name>log4jExposeWebAppRoot</param-name>
    <param-value>false</param-value>
</context-param>
...
</web-app>
Run Code Online (Sandbox Code Playgroud)

java xml spring tomcat log4j

15
推荐指数
2
解决办法
1383
查看次数

Paypal付款标准,无需创建Paypal帐户

我想卖媒体,并选择PayPal Payments Standard来做.

根据官方文件,买家可以在没有PayPal帐户的情况下进行购买.只需输入卡号/ CVC,名称和其他一些字段即可购买.

但是,当我点击使用Paypal按钮编辑器创建的"立即购买"按钮时,它提供了两个选项:"使用我的PayPal帐户付款"或"创建PayPal帐户".没有创建PayPal帐户就没有选择支付.

我不想强迫买家记账并填补很多领域.卡号,有效期,CVC以及可能的姓/名 - 这是必要和充分的.如何使它成为可能?

paypal credit-card

13
推荐指数
2
解决办法
2万
查看次数

无法在maven-pmd-plugin 5.0.2中使用自定义规则集

我希望maven-pmd-plugin包含我指定的规则集并排除一些规则(特别是UselessParentheses)

就像在文档中描述的那样,我将以下内容放在pmd.xml中,该pmd.xml是所有模块的父级:

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <rulesets>
            <ruleset>/home/ubuntu/ruleset.xml</ruleset>
          </rulesets>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
Run Code Online (Sandbox Code Playgroud)

并准备了一个自定义规则集,如下所示:

  <!-- We'll use the entire rulesets -->
  <rule ref="rulesets/java/basic.xml"/>
  <rule ref="rulesets/java/imports.xml"/>
  <rule ref="rulesets/java/codesize.xml"/>
  <rule ref="rulesets/java/design.xml"/>
  <rule ref="rulesets/java/strings.xml"/>
  <rule ref="rulesets/java/unusedcode.xml"/>

  <!-- We want everything from this except some -->
  <rule ref="rulesets/java/unnecessary.xml">
    <exclude name="UselessParentheses"/>
  </rule>
Run Code Online (Sandbox Code Playgroud)

作为主要部分.

然而,当我跑步时,我mvn clean jxr:jxr pmd:check在报告中有"UselessParentheses".而且,用-Xshow来运行它

[DEBUG] Preparing ruleset: java-basic
[DEBUG] Before: java-basic After: java-basic.xml
[DEBUG] The resource 'rulesets/java/basic.xml' was found as jar:file:/home/ubuntu/.m2/repository/net/sourceforge/pmd/pmd/5.0.2/pmd-5.0.2.jar!/rulesets/java/basic.xml.
[DEBUG] Preparing …
Run Code Online (Sandbox Code Playgroud)

customization pmd maven-plugin maven

5
推荐指数
1
解决办法
4464
查看次数