File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/request-client.js/src/api Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,12 @@ export default class Request {
244244
245245 // Generate allowance revocation calldata if payer is canceling a recurring payment
246246 let allowanceRevocationCalldata : string | undefined ;
247- if ( options ?. isRecurringPayment && options ?. isPayerCancel && options ?. recurringPaymentInfo ) {
247+ if ( options ?. isRecurringPayment && options ?. isPayerCancel ) {
248+ if ( ! options . recurringPaymentInfo ) {
249+ throw new Error (
250+ 'recurringPaymentInfo is required when the payer cancels a recurring payment' ,
251+ ) ;
252+ }
248253 const proxyAddress = getRecurringPaymentProxyAddress ( options . recurringPaymentInfo . network ) ;
249254 const erc20Interface = ERC20__factory . createInterface ( ) ;
250255 allowanceRevocationCalldata = erc20Interface . encodeFunctionData ( 'approve' , [
You can’t perform that action at this time.
0 commit comments