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.
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
The PinPayments Service provides a number of methods corresponding closely to the Pin Payments api as described here:
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.
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.
There are no integration tests in the grails sense so the best way to run the unit tests is
grails test-app :unit