Reference
shared.services.payment_providers.jpmorgan.entities ¶
JPMorganAccountType ¶
JPMorganBusinessAccountConfig
dataclass
¶
JPMorganBusinessAccountConfig(
base_url,
account_id,
debtor_agent_bic,
signature_private_key,
signature_private_key_secret_name,
transport_public_certificate,
transport_public_certificate_secret_name,
transport_private_key,
transport_private_key_secret_name,
)
transport_public_certificate_secret_name
instance-attribute
¶
JPMorganBusinessAccountName ¶
Bases: AlanBaseEnum
JPMorganCallbackException
dataclass
¶
JPMorganPaymentCallbackEvent
dataclass
¶
JPMorganPaymentCallbackEvent(
end_to_end_id,
firm_root_id,
payment_status,
create_date_time,
exceptions,
raw=None,
)
Doc -> https://developer.payments.jpmorgan.com/docs/treasury/global-payments/capabilities/global-payments/callbacks ⧉ Example payload: { "callbacks": [ { "endToEndId": "MY20230727_0219", "createDateTime": "2023-07-27T07:41:54.773Z", "paymentStatus": "REJECTED", "firmRootId": "53038faa-43f6-42fc-9545-648fd2dab411", "exceptions": [ { "errorCode": "10004", "errorDescription": "Error occurred on /requestedExecutionDate", "ruleDefinition": "Date validation failure" } ] } ] }
from_dict
staticmethod
¶
Source code in shared/services/payment_providers/jpmorgan/entities.py
JPMorganTransactionState ¶
Bases: AlanBaseEnum
blocked
class-attribute
instance-attribute
¶
Payment blocked due to sanctions issue
completed
class-attribute
instance-attribute
¶
Payment has successfully completed
completed_credited
class-attribute
instance-attribute
¶
Status indicating the beneficiary's account has been credited
pending_posting
class-attribute
instance-attribute
¶
Payment is yet to be posted in the beneficiary account
rejected
class-attribute
instance-attribute
¶
Payment has been rejected. Please refer to the exception object for error details
returned
class-attribute
instance-attribute
¶
Payment has been retured to the debtor party
warehoused
class-attribute
instance-attribute
¶
Payment request was successfully received. The request will be processed in the next available window, typically the next calendar day
shared.services.payment_providers.jpmorgan.errors ¶
JPMorganBadRequestError ¶
Bases: JPMorganError
Our request was not formatted correctly, maybe their API has evolved or we have missed something
List of Error codes and Rule definitions.¶
| Error Code | Rule Definition |
|---|---|
10001 |
Mandatory field is missing or invalid |
10002 |
Minimum length validation failure |
10003 |
Maximum length validation failure |
10004 |
Date validation failure |
10005 |
Amount validation failure ~ value more than maximum |
10006 |
Amount validation failure ~ value less than minimum |
10007 |
Amount validation failure ~ value is not a number |
10008 |
Validation failure ~ unexpected value provided |
10009 |
Invalid Id provided |
10010 |
Personal information validation failure |
12000 |
System error |
13000 |
Uncategorized error |
errorDescription is dynamically generated, hence not shown here.
Standard API Gateway Error codes and descriptions¶
| Error Code | Description |
|---|---|
GCA-023 |
Please re-send request in valid format |
GCA-030 |
API Processing Error |
GCA-148 |
debtor Account id must be provided |
GCA-149 |
debtorAgent bic or clearingSystemId must be provided |
GCA-150 |
debtor account id/bic was not found |
GCA-154 |
Mandatory field paymentType is invalid or missing |
Source code in shared/services/payment_providers/jpmorgan/errors.py
JPMorganError ¶
Bases: Exception
A generic JPMorgan exception we should handle
Source code in shared/services/payment_providers/jpmorgan/errors.py
JPMorganForbiddenError ¶
Bases: JPMorganError
We get a 403, for one of the below reasons
| Error Code | Description |
|----------- |-------------------------------------------|
| GCA-001 |Client is not eligible for the API Service |
| GCA-003 |Client is not eligible for the API Service |
| GCA-145 |incorrect originator account id provided |
| GCA-150 |debtor account id/bic was not found |
Source code in shared/services/payment_providers/jpmorgan/errors.py
JPMorganInternalError ¶
Bases: JPMorganError
JPMorgan issue, we can't act on it
Source code in shared/services/payment_providers/jpmorgan/errors.py
JPMorganNotFoundError ¶
Bases: JPMorganError
Resource does not exist on JPMorgan, it is up to us to decide whether we take this error into account or not
Source code in shared/services/payment_providers/jpmorgan/errors.py
shared.services.payment_providers.jpmorgan.helpers ¶
get_jpmorgan_config_from_business_account_name ¶
Source code in shared/services/payment_providers/jpmorgan/helpers.py
shared.services.payment_providers.jpmorgan.jpmorgan_client ¶
JPMorganClient ¶
See the authentication documentation here: https://developer.jpmorgan.com/products/tsapi-onboarding-guides/guides/digitally-sign-payment-requests-(required ⧉)
And the payment endpoint here: https://developer.jpmorgan.com/products/global-rtp/specification ⧉
Source code in shared/services/payment_providers/jpmorgan/jpmorgan_client.py
get_supported_currency ¶
get_transaction_info ¶
Source code in shared/services/payment_providers/jpmorgan/jpmorgan_client.py
pay ¶
pay(
request_id,
amount_in_cents,
ibancode,
swift=None,
account_type=JPMorganAccountType.IBAN,
payment_description=None,
reimbursement_payment_id=None,
recipient_first_name=None,
recipient_last_name=None,
recipient_company_name=None,
address=None,
)
Trigger a payment using JPMorgan Treasury API.
The payment will be sent to the recipient described by the recipient_* fields.
Source code in shared/services/payment_providers/jpmorgan/jpmorgan_client.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
shared.services.payment_providers.jpmorgan.noop_jpmorgan_client ¶
NoopJPMorganClient ¶
JPMorgan client that does nothing
get_supported_currency ¶
Source code in shared/services/payment_providers/jpmorgan/noop_jpmorgan_client.py
pay ¶
pay(
request_id,
amount_in_cents,
ibancode,
swift=None,
account_type=JPMorganAccountType.IBAN,
payment_description=None,
reimbursement_payment_id=None,
recipient_first_name=None,
recipient_last_name=None,
recipient_company_name=None,
address=None,
)