@@ -1532,6 +1532,28 @@ exports.saveMemberPayment = function(memberPayment, callback) {
15321532 return this . saveItem ( memberPayment , callback ) ;
15331533} ;
15341534
1535+ exports . memberPaymentTransaction = function ( memberPaymentId , amount , note , callback ) {
1536+ var params ;
1537+ if ( ! this . isItem ( memberPaymentId ) ) {
1538+ throw new TSArgsError ( 'teamsnap.memberPaymentTransaction' , "must provide a `memberPaymentId`" ) ;
1539+ }
1540+ if ( this . isItem ( memberPaymentId ) ) {
1541+ memberPaymentId = memberPaymentId . id ;
1542+ }
1543+ if ( ! amount ) {
1544+ throw new TSArgsError ( 'teamsnap.memberPaymentTransaction' , "must provide an `amount`" ) ;
1545+ }
1546+ if ( typeof note === 'function' ) {
1547+ callback = note ;
1548+ }
1549+ params = {
1550+ memberPaymentId : memberPaymentId ,
1551+ amount : amount ,
1552+ note : note
1553+ } ;
1554+ return this . collections . memberPayments . exec ( 'transaction' , params ) . pop ( ) . callback ( callback ) ;
1555+ } ;
1556+
15351557} ) ;
15361558
15371559require . register ( "collections/memberPhoneNumbers" , function ( exports , require , module ) {
@@ -4738,7 +4760,7 @@ modifySDK = function(sdk) {
47384760 } ) . callback ( callback ) ;
47394761 } ;
47404762 } ) ;
4741- return wrapMethod ( sdk , 'invite' , function ( invite ) {
4763+ wrapMethod ( sdk , 'invite' , function ( invite ) {
47424764 return function ( options , callback ) {
47434765 return invite . call ( this , options ) . then ( function ( result ) {
47444766 var contactId , memberId ;
@@ -4760,6 +4782,22 @@ modifySDK = function(sdk) {
47604782 } ) . callback ( callback ) ;
47614783 } ;
47624784 } ) ;
4785+ return wrapMethod ( sdk , 'memberPaymentTransaction' , function ( memberPaymentTransaction ) {
4786+ return function ( memberPaymentId , amount , note , callback ) {
4787+ return memberPaymentTransaction . call ( this , memberPaymentId , amount , note ) . then ( function ( result ) {
4788+ var memberId , teamFeeId ;
4789+ memberId = result . memberId ;
4790+ teamFeeId = result . teamFeeId ;
4791+ return promises . when ( sdk . loadMemberBalances ( {
4792+ memberId : memberId
4793+ } ) , sdk . loadTeamFees ( {
4794+ id : teamFeeId
4795+ } ) ) . then ( function ( ) {
4796+ return result ;
4797+ } ) ;
4798+ } ) . callback ( callback ) ;
4799+ } ;
4800+ } ) ;
47634801} ;
47644802
47654803revertSDK = function ( sdk ) {
@@ -5805,7 +5843,7 @@ ref = require('./model'), Collection = ref.Collection, Item = ref.Item;
58055843require ( './errors' ) ;
58065844
58075845TeamSnap = ( function ( ) {
5808- TeamSnap . prototype . version = '1.10 .0' ;
5846+ TeamSnap . prototype . version = '1.11 .0' ;
58095847
58105848 TeamSnap . prototype . promises = promises ;
58115849
0 commit comments