'Multiparty payments using Square

I have used square web-payment sdk and making multiparty payment, but I am getting an error as follow,

[{:code=>"INVALID_CARD_DATA", :detail=>"Card nonce not found in this application environment. Please ensure an application ID belonging to the same environment is used for the SqPaymentForm.", :category=>"INVALID_REQUEST_ERROR"}]

I am trying to make a payment with following scenario,

I am a user and I want to purchase an event. when I do payment, I use square_application id and location id of my Operator (which in other words is a square developer account or seller) to get the card-nonce (payment method token that square returns after validating credit card which is further used to make a payment in square). For calling an API and making payment, I am using square access-token of one of the merchants of that operator (which can also be considered as square developer or seller) as we want to add money of the transaction to that merchant's account.

I am aware of the cause of the error, but is there any way to implement it as; When user makes a payment of say $100, then the four percent of it i.e. $4 should go to Operator's account i.e. the operator's account and the rest should go to the merchants account (after deducting the square transaction fees).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source