Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Grails Plugin for Pin Payments Subscriptions

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .settings
Octocat-spinner-32 grails-app
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 PinPaymentsGrailsPlugin.groovy
Octocat-spinner-32 README.md
Octocat-spinner-32 application.properties
README.md

Grails Pin Payments Plugin

This plugin provides a service and taglib for integration with Pin Payment's Subscriptions an api based service for handling payments for subscriptions. See https://subs.pinpayments.com/ for more information.

Configuration

The plugin requires the following entries in the Config.groovy file:

pinpayments.siteName='Your Pin Payments site name'
pinpayments.authToken='Your Pin Payments auth token'

Your Pin Payments auth token can be found under the "Configuration" tab for your site, for instance

https://subs.pinpayments.com//configuration

PinPayments Service

The PinPayments Service provides a number of methods corresponding closely to the Pin Payments api as described here:

https://subs.pinpayments.com/manual/integration-reference/

allowing your application to deal with subscribers, subscription plans, invoicing and getting transactions from Pin Payments.

createSubscriber
deleteSubscriber
getSubscriber
getSubscribers
getSubscriptionPlanById
getSubscriptionPlanByName
getSubscriptionPlans
giveComplimentarySubscription
stopAutoRenew
subscribeToFreeTrial
createInvoice
payInvoice
getLastTransactions
getTransactionsSince
...

Most service methods return a slurped XML response (NodeChild) and should be manipulated accordingly.

PinPayments TagLib

The PinPayments TagLib provides two tags that facilitate generating some important links.

<pinpayments:subscribeLink subscriber="<subscriber id>" plan="<plan id>" />

The subscribeLink tag takes a subscriber id and a plan id as parameters and will generate a link that a user can click on to subscribe to the plan as described here https://subs.pinpayments.com/manual/integration-guide/expose-a-subscribe-link.

<pinpayments:subscriberAccountLink token="<pinpayments subscriber token>" />

The subscriberAccountLink takes a subscriber token as a parameter and will generate a link that a user can click on to manage account details on the pin payments site such as renewing their credit card information. The subscriber token is an item in a user's subscriber record and can be obtained using the PinPaymentsService getSubscriber() method.

Running the unit tests

There are no integration tests in the grails sense so the best way to run the unit tests is

grails test-app :unit
Something went wrong with that request. Please try again.