PayPal的Ruby API:Ruby-PayPal
Ruby-PayPal 是 PayPal API 的 Ruby 语言封装版本。
安装方法:gem install ruby-paypal
示例代码:
username = <PayPal API username> password = <PayPal API password> signature = <PayPal API signature> ipaddress = '192.168.1.1' # can be any IP address amount = '100.00' # amount paid card_type = 'VISA' # can be Visa, Mastercard, Amex etc card_no = '4512345678901234' # credit card number exp_date = '022010' # expiry date of the credit card first_name = 'Sau Sheong' last_name = 'Chang' paypal = Paypal.new(username, password, signature) # uses the PayPal sandbox response = paypal.do_direct_payment_sale(ipaddress, amount, card_type, card_no, exp_date, first_name, last_name) if response.ack == 'Success' then # do your thing end
本文由用户 fmms 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!