Skip to content

Commit 6055018

Browse files
committed
Added PaymentOperationNotSupportedError error code
Signed-off-by: artem.ivanov <[email protected]>
1 parent b5d2dac commit 6055018

File tree

11 files changed

+55
-7
lines changed

11 files changed

+55
-7
lines changed

cli/src/libindy/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ pub enum ErrorCode
173173
PaymentInsufficientFundsError = 702,
174174

175175
// No such source on a ledger
176-
PaymentSourceDoesNotExistError = 703
176+
PaymentSourceDoesNotExistError = 703,
177+
178+
// Operation is not supported for payment method
179+
PaymentOperationNotSupportedError = 704
177180
}
178181

179182
impl ErrorCode {
@@ -233,6 +236,7 @@ impl ErrorCode {
233236
PaymentIncompatibleMethodsError => "Multiple different payment methods were specified",
234237
PaymentInsufficientFundsError => "Insufficient funds on inputs",
235238
PaymentSourceDoesNotExistError => "No such source found",
239+
PaymentOperationNotSupportedError => "Operation is not supported for payment method",
236240
}
237241
}
238242
}

libindy/include/indy_mod.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ typedef enum
159159
PaymentInsufficientFundsError = 702,
160160

161161
// No such source on a ledger
162-
PaymentSourceDoesNotExistError = 703
162+
PaymentSourceDoesNotExistError = 703,
163+
164+
// Operation is not supported for payment method
165+
PaymentOperationNotSupportedError = 704
163166

164167
} indy_error_t;
165168

libindy/src/api/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,8 @@ pub enum ErrorCode
216216
PaymentInsufficientFundsError = 702,
217217

218218
// No such source on a ledger
219-
PaymentSourceDoesNotExistError = 703
219+
PaymentSourceDoesNotExistError = 703,
220+
221+
// Operation is not supported for payment method
222+
PaymentOperationNotSupportedError = 704
220223
}

libnullpay/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,7 @@ pub enum ErrorCode
206206

207207
// No such source on a ledger
208208
PaymentSourceDoesNotExistError = 703,
209+
210+
// Operation is not supported for payment method
211+
PaymentOperationNotSupportedError = 704
209212
}

wrappers/ios/libindy-pod/Indy/Wrapper/IndyErrors.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,8 @@ typedef NS_ENUM(NSInteger, IndyErrorCode)
158158
PaymentInsufficientFundsError = 702,
159159

160160
// No such source on a ledger
161-
PaymentSourceDoesNotExistError = 703
161+
PaymentSourceDoesNotExistError = 703,
162+
163+
// Operation is not supported for payment method
164+
PaymentOperationNotSupportedError = 704
162165
};

wrappers/java/src/main/java/org/hyperledger/indy/sdk/ErrorCode.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ public enum ErrorCode {
288288
* No such source on a ledger
289289
*/
290290
PaymentSourceDoesNotExistError(703),
291+
292+
/**
293+
* Operation is not supported for payment method
294+
*/
295+
PaymentOperationNotSupportedError(704),
291296
;
292297

293298
private int value;

wrappers/java/src/main/java/org/hyperledger/indy/sdk/IndyException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public static IndyException fromSdkError(int sdkErrorCode) {
141141
return new InsufficientFundsException();
142142
case PaymentSourceDoesNotExistError:
143143
return new PaymentSourceDoesNotExistException();
144+
case PaymentOperationNotSupportedError:
145+
return new PaymentOperationNotSupportedException();
144146
default:
145147
String message = String.format("An unmapped error with the code '%s' was returned by the SDK.", sdkErrorCode);
146148
return new IndyException(message, sdkErrorCode);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.hyperledger.indy.sdk.payments;
2+
3+
import org.hyperledger.indy.sdk.ErrorCode;
4+
import org.hyperledger.indy.sdk.IndyException;
5+
6+
public class PaymentOperationNotSupportedException extends IndyException {
7+
private static final long serialVersionUID = - 5009466707967765943L;
8+
private static final String message = "Operation is not supported for payment method";
9+
10+
/**
11+
* Initializes a new {@link PaymentOperationNotSupportedException} with the specified message.
12+
*/
13+
public PaymentOperationNotSupportedException() {
14+
super(message, ErrorCode.PaymentOperationNotSupportedError.value());
15+
}
16+
}

wrappers/nodejs/codegen/api.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"c700": "PaymentUnknownMethodError",
5151
"c701": "PaymentIncompatibleMethodsError",
5252
"c702": "PaymentInsufficientFundsError",
53-
"c703": "PaymentSourceDoesNotExistError"
53+
"c703": "PaymentSourceDoesNotExistError",
54+
"c704": "PaymentOperationNotSupportedError"
5455
},
5556
"functions": {
5657
"indy_issuer_create_schema": {

wrappers/nodejs/src/IndyError.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ var errors = {
4040
406: 'AnoncredsCredentialRevoked',
4141
407: 'AnoncredsCredDefAlreadyExistsError',
4242
500: 'UnknownCryptoTypeError',
43-
600: 'DidAlreadyExistsError'
43+
600: 'DidAlreadyExistsError',
44+
700: 'PaymentUnknownMethodError',
45+
701: 'PaymentIncompatibleMethodsError',
46+
702: 'PaymentInsufficientFundsError',
47+
703: 'PaymentSourceDoesNotExistError',
48+
704: 'PaymentOperationNotSupportedError'
4449
}
4550

4651
function IndyError (err) {

0 commit comments

Comments
 (0)