Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pay_me

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pay_me

  • 0.5.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

PayMe

This gem is currently a work in progress, follows semver, and may change significantly until version 1.0

A gem for attaching a payment system to business login in Rails

TODO...

Details

TODO...

Testing

Ensure you have STRIPE_TEST_SECRET_KEY as an ENV variable. This progect uses dotenv so you can create a .env file. You can run the tests using rake test.

Installation

Add the gem to your Gemfile: gem 'pay_me'.

Run bundle install to install it.

Run rails g pay_me:install

Add the following to your routes

...
  pay_me_customerable_for :users
...

Add the following to your customer model controller

require 'pay_me/concerns/controllers/customerable'
...
class UsersController < BaseController
  include PayMe::Concerns::Controllers::Customerable
...

Add the following to your customer model

require 'pay_me/concerns/models/customerable'
...
class User < ActiveRecord::Base
  include PayMe::Concerns::Models::Customerable
...

The model will also need a receipt_email attribute and customer_id.

The installer will automatically add the following to your secrets.yml for development test and production. secrets.yml

development:
  ###
  # Other configs
  ###
  stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %>
  stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %>
  stripe_webhook_secret: <%= ENV['STRIPE_WEBHOOK_SECRET'] %>
  stripe_signing_secret: <%= ENV['STRIPE_SIGNING_SECRET'] %>

or using inheritance: secrets.yml

stripe: &stripe
  stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %>
  stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %>
  stripe_webhook_secret: <%= ENV['STRIPE_WEBHOOK_SECRET'] %>
  stripe_signing_secret: <%= ENV['STRIPE_SIGNING_SECRET'] %>

development:
  <<: *stripe
  ...

test:
  <<: *stripe
  ...

production:
  <<: *stripe
  ...

You will need to add the stripe keys to your ENV.

  • STRIPE_PUBLISHABLE_KEY is your stripe publishable key.
  • STRIPE_SECRET_KEY is your stripe secret key.
  • STRIPE_WEBHOOK_SECRET is a secret that is used for stripe as a password for basic authentication to the webhook. You can use rake secret to generate a suitable secret. This is also used when configuring the stripe webhook in stripe: https://stripe:STRIPE_WEBHOOK_SECRET@myapplication.com/pay_me-stripe_webhooks
  • STRIPE_SIGNING_SECRET is used by stripe to sign webhooks. It can be found in your stripe webhook settings.

PayMe adds to rake task for caching Stripe plans locally to reduce calls to stripe. They are:

  • pay_me:stripe:add_stripe_plans This will add missing Stripe plans, but not delete local ones that no longer exist on stripe.
  • pay_me:stripe:sync_stripe_plans This will add missing Stripe plans and delete local ones that don't exist on stripe.

You are now setup!

Stripe Configuration Checklist

  • Get API keys and add to ENV
  • Add webhook URL and webhook secret to ENV
  • Get webhook signing secret and add to ENV
  • Add plan(s) to Stripe. TODO...

Usage

Todo:
  • TODO...

License

Copyright (c) 2015, Pay Me is developed and maintained by Wildland

FAQs

Package last updated on 07 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc