Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ping++ Server SDK未来会有Scala版本吗? #9

Open
scozv opened this issue Nov 18, 2015 · 1 comment
Open

ping++ Server SDK未来会有Scala版本吗? #9

scozv opened this issue Nov 18, 2015 · 1 comment

Comments

@scozv
Copy link

scozv commented Nov 18, 2015

您好,请问未来会有Scala版本的Server SDK吗?

目前sbt里面如何引入Server SDK呢?

谢谢

@scozv
Copy link
Author

scozv commented Nov 19, 2015

关于sbt里面引入Server SDK依赖项的解决方案如下:

  1. pingpp目前托管在"http://jcenter.bintray.com里面

  2. 根据bintray-sbt的建议,需要添加

     resolvers += Resolver.jcenterRepo

但是注意几点:

// project/build.properties中修改`sbt`版本
sbt.version=0.13.8

// build.sbt里面加入依赖项,不要加在project/plugins.sbt里面
libraryDependencies ++= Seq(
  // 其它依赖项
  "Pingplusplus" % "pingpp-java" % "2.1.1"
)

之后就可以在Scala中调用Server SDK了:

import com.pingplusplus.model.Charge
import collection.JavaConversions._

object PaymentBiz {

  def createPayment = {
    Charge.create(Map[String, AnyRef](
      "order_no" -> "123456789",
      "amount" -> "100",
      "id" -> Map("app" -> "app_random_token")
      // ...
    ))
  }
}

还是期待,未来会有Scala版本的Server SDK,或者,等我熟练使用pingppServer之后,我争取用Scala重写Server SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant