Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

alipay

> 编程语言
Open source

Unofficial alipay ruby gem

729 stars0 likes0 views
WebsiteGitHub

About

Unofficial alipay ruby gem

Alipay

Unofficial Alipay ruby gem.

Note: Alipay::Client API does not have enough feedback in production yet, please fully test in your staging environment before production. You can find legacy API document here.

You should read https://doc.open.alipay.com before using this gem.

Installation

To install using Bundler. Add this line to your application's Gemfile:

ruby
gem 'alipay'

Then run:

bash
$ bundle

Or you can manually install using RubyGems:

bash
$ gem install alipay

Getting Started

This gem needs to be configured with your application's private key for Alipay and Alipay's public key. Here is a quick guide on generating RSA key for use with this gem to get you started.

Setup

…

Create a payment

ruby
@alipay_client.page_execute_url(
  method: 'alipay.trade.page.pay',
  biz_content: JSON.generate({
    out_trade_no: '20160401000000',
    product_code: 'FAST_INSTANT_TRADE_PAY',
    total_amount: '0.01',
    subject: 'test'
  }, ascii_only: true), # ascii_only is important!
  timestamp: '2016-04-01 00:00:00'
)

# This method will then return a payment url
# => 'https://openapi.alipaydev.com/gateway.do?app_id=201600...'

Read Alipay::Client or the Quick Start Guide for usage detail.

Contributing

Bug report or pull request are welcome.

Make a pull request

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Please write unit test with your code if necessary.

License

MIT License

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言