"""TransferWise fixtures.""" REFRESH_ACCOUNT_REQUIREMENTS = { "currency": "usd", "type": "aba", "profile": 4496, "ownedByCustomer": True, "accountHolderName": "Little Annie", "details": { "legalType": "PRIVATE", "abartn": "231470", "accountNumber": "28821822", "accountType": "CHECKING", "address": { "country": "GR", "city": "ATHENS", "firstLine": "1525 S 9th St", "postCode": "19147", }, }, } ACCOUNT_REQUIREMENTS_RESPONSE = [ { "type": "aba", "title": "Local bank account", "usageInfo": None, "fields": [ { "name": "Recipient type", "group": [ { "key": "legalType", "name": "Recipient type", "type": "select", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "", "minLength": None, "maxLength": None, "validationRegexp": None, "validationAsync": None, "valuesAllowed": [ {"key": "PRIVATE", "name": "Person"}, {"key": "BUSINESS", "name": "Business"}, ], } ], }, { "name": "ACH routing number", "group": [ { "key": "abartn", "name": "ACH routing number", "type": "text", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "026009593", "minLength": 9, "maxLength": 9, "validationRegexp": "^\\d{9}$", "validationAsync": { "url": ( "https://api.sandbox.transferwise.tech/v1/" "validators/abartn" ), "params": [ { "key": "abartn", "parameterName": "abartnF", "required": True, } ], }, "valuesAllowed": None, } ], }, { "name": "Account number", "group": [ { "key": "accountNumber", "name": "Account number", "type": "text", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "12345678", "minLength": 4, "maxLength": 17, "validationRegexp": "^\\d{4,17}$", "validationAsync": None, "valuesAllowed": None, } ], }, { "name": "Account type", "group": [ { "key": "accountType", "name": "Account type", "type": "radio", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "CHECKING", "minLength": None, "maxLength": None, "validationRegexp": None, "validationAsync": None, "valuesAllowed": [ {"key": "CHECKING", "name": "Checking"}, {"key": "SAVINGS", "name": "Savings"}, ], } ], }, { "name": "Country", "group": [ { "key": "address.country", "name": "Country", "type": "select", "refreshRequirementsOnChange": True, "required": True, "displayFormat": None, "example": "", "minLength": None, "maxLength": None, "validationRegexp": None, "validationAsync": None, "valuesAllowed": [ {"key": "GB", "name": "United Kingdom"}, {"key": "US", "name": "United States"}, ], } ], }, { "name": "City", "group": [ { "key": "address.city", "name": "City", "type": "text", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "", "minLength": 1, "maxLength": 255, "validationRegexp": "^.{1,255}$", "validationAsync": None, "valuesAllowed": None, } ], }, { "name": "Address", "group": [ { "key": "address.firstLine", "name": "Address", "type": "text", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "", "minLength": 1, "maxLength": 255, "validationRegexp": "^.{1,255}$", "validationAsync": None, "valuesAllowed": None, } ], }, { "name": "State", "group": [ { "key": "address.state", "name": "State", "type": "select", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "", "minLength": None, "maxLength": None, "validationRegexp": None, "validationAsync": None, "valuesAllowed": [ {"key": "AB", "name": "Alberta"}, {"key": "BC", "name": "British Columbia"}, {"key": "MB", "name": "Manitoba"}, {"key": "NB", "name": "New Brunswick"}, {"key": "NL", "name": "Newfoundland and Labrador"}, {"key": "NT", "name": "Northwest Territories"}, {"key": "NS", "name": "Nova Scotia"}, {"key": "NU", "name": "Nunavut"}, {"key": "ON", "name": "Ontario"}, {"key": "PE", "name": "Prince Edward Island"}, {"key": "QC", "name": "Quebec"}, {"key": "SK", "name": "Saskatchewan"}, {"key": "YT", "name": "Yukon"}, ], } ], }, { "name": "Post Code", "group": [ { "key": "address.postCode", "name": "Post Code", "type": "text", "refreshRequirementsOnChange": False, "required": True, "displayFormat": None, "example": "", "minLength": None, "maxLength": 32, "validationRegexp": ( "[ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy][0-9]" "[ABCEGHJKLMNPRSTVWXYZabceghjklmnprstvwxyz] " "?[0-9][ABCEGHJKLMNPRSTVWXYZabceghjklmnprstvwxyz]" "[0-9]" ), "validationAsync": None, "valuesAllowed": None, } ], }, ], } ] FIELD_VALIDATION_RESPONSE = {"validation": "success"} REFRESH_ACCESS_TOKEN_RESPONSE = { "access_token": "be69d566-971e-4e15-9648-85a486195863", "token_type": "bearer", "refresh_token": "1d0ec7b9-b569-426d-a18d-8dead5b6a3cc", "expires_in": 43199, "scope": "transfers", } CLIENT_ACCESS_TOKEN_RESPONSE = { "access_token": "be69d566-971e-4e15-9648-85a486195863", "token_type": "bearer", "expires_in": 43199, "scope": "transfers", } WEBHOOK_SUBSCRIPTION_RESPONSE = { "id": "72195556-e5cb-495e-a010-b37a4f2a3043", "name": "Webhook Subscription #1", "delivery": {"version": "1.0.0", "url": "https://your.webhook.url/12345"}, "trigger_on": "transfers#state-change", "scope": {"domain": "application", "id": "123"}, "created_by": {"type": "application", "id": "123"}, "created_at": "2019-10-10T13:55:57Z", } QUOTE_REQUESTED_PARAMS = { "recipient_id": 123123, "collaborator_id": 1, "profile": "123fffa33", "sourceCurrency": "EUR", "targetCurrency": "GBP", "targetAmount": None, "sourceAmount": 100.0, } QUOTE_RESPONSE = { "id": "11144c35-9fe8-4c32-b7fd-d05c2a7734bf", "sourceCurrency": "USD", "targetCurrency": "USD", "sourceAmount": 100, "payOut": "BANK_TRANSFER", "rate": 1.30445, "createdTime": "2019-04-05T13:18:58Z", "user": 55, "profile": 101, "rateType": "FIXED", "rateExpirationTime": "2019-04-08T13:18:57Z", "guaranteedTargetAmountAllowed": True, "targetAmountAllowed": True, "guaranteedTargetAmount": False, "providedAmountType": "SOURCE", "paymentOptions": [ { "disabled": False, "estimatedDelivery": "2019-04-08T12:30:00Z", "formattedEstimatedDelivery": "by Apr 8", "estimatedDeliveryDelays": [], "fee": {"transferwise": 0.92, "payIn": 0.1, "discount": 0, "total": 0.92}, "sourceAmount": 100, "targetAmount": 129.24, "sourceCurrency": "USD", "targetCurrency": "USD", "payIn": "BANK_TRANSFER", "payOut": "BANK_TRANSFER", "allowedProfileTypes": ["PERSONAL", "BUSINESS"], "payInProduct": "CHEAP", "feePercentage": 0.0092, }, { "disabled": True, "estimatedDelivery": None, "formattedEstimatedDelivery": None, "estimatedDeliveryDelays": [], "fee": {"transferwise": 1.11, "payIn": 0, "discount": 0, "total": 1.11}, "sourceAmount": 100, "targetAmount": 129, "sourceCurrency": "USD", "targetCurrency": "USD", "payIn": "BALANCE", "payOut": "BANK_TRANSFER", "allowedProfileTypes": ["PERSONAL", "BUSINESS"], "disabledReason": { "code": "error.payInmethod.disabled", "message": "Open a borderless account" "and add funds to instantly pay for your transfers.", }, "payInProduct": "BALANCE", "feePercentage": 0.0111, }, ], "status": "PENDING", "expirationTime": "2019-04-05T13:48:58Z", "notices": [ { "text": "You can have a maximum of 3 open transfers with a" "guaranteed rate. After that, they will be " "transferred using the live rate. Complete " "or cancel your other transfers to regain " "the use of guaranteed rate.", "link": None, "type": "WARNING", } ], } BATCH_REQUESTED_PARAMS = {"sourceCurrency": "GBP", "name": "Batch Name"} BATCH_RESPONSE = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 0, "name": "my-batch-group", "sourceCurrency": "USD", "status": "NEW", "transferIds": [], "payInDetails": [], } BATCH_RESPONSE_JPY = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 0, "name": "my-batch-group", "sourceCurrency": "JPY", "status": "NEW", "transferIds": [], "payInDetails": [], } BATCH_RESPONSE_INFO_JPY = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 0, "name": "my-batch-group", "sourceCurrency": "JPY", "status": "NEW", "transferIds": [ 468956, ], "payInDetails": None, "numOfFailedTransfers": 0, "numTotalRequestedTransfers": 1, } BATCH_RESPONSE_INFO = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 0, "name": "my-batch-group", "sourceCurrency": "USD", "status": "NEW", "transferIds": [ 468956, ], "payInDetails": None, "numOfFailedTransfers": 0, "numTotalRequestedTransfers": 1, } BATCH_COMPLETED_RESPONSE = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 1, "name": "my-batch-group", "sourceCurrency": "USD", "status": "COMPLETED", "transferIds": [123, 456], "payInDetails": [ { "type": "bank_transfer", "reference": "XYZ123", "amount": 123.45, "currency": "USD", "name": "TransferWise", "bankCode": "231470", "accountNumber": "77643994", "iban": None, } ], } BATCH_CANCELLED_RESPONSE = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 3, "name": "my-batch-group", "sourceCurrency": "USD", "status": "MARKED_FOR_CANCELLATION", "transferIds": [123], "payInDetails": None, } BATCH_COMPLETED_RESPONSE_JPY = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 1, "name": "my-batch-group", "sourceCurrency": "JPY", "status": "COMPLETED", "transferIds": [123, 456], "payInDetails": [ { "type": "bank_transfer", "reference": "XYZ123", "amount": 123.45, "currency": "JPY", "name": "ワイズ ペイメンツ ジヤパン(カ (translation: WISE" " PAYMENTS JAPAN KABUSHIKIGAISHA) " "三菱UFJ銀行 / MUFG Bank, Ltd. / ミツビシユーエフジエイ", "bankCode": "恵比寿支店 / EBISU / エビス", "accountNumber": "0785985", "accountType": "普通 / Futsuu / フツウ", } ], } BATCH_COMPLETED_RESPONSE_DKK = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 1, "name": "my-batch-group", "sourceCurrency": "DKK", "status": "COMPLETED", "transferIds": [123, 456], "payInDetails": [ { "type": "bank_transfer", "reference": "XYZ123", "amount": 123.45, "currency": "DKK", "name": None, "bankCode": None, "accountNumber": None, } ], } BATCH_CANCELLED_RESPONSE = { "id": "54a6bc09-cef9-49a8-9041-f1f0c654cd88", "version": 12345, "name": "my-batch-group", "sourceCurrency": "GBP", "status": "MARKED_FOR_CANCELLATION", "transferIds": [123, 456], "payInReferences": [], } BATCH_TRANSFER_REQUESTED_PARAMS = { "targetAccount": 12341234, "quoteUuid": "7df24b5c-ced1-425e-bc57-f993aa07b942", "customerTransactionId": "784d48fd-0f1a-49c8-bf11-fb0998714352", "details": { "reference": "to my friend", "transferPurpose": "verification.transfers.purpose.pay.bills", "sourceOfFunds": "verification.source.of.funds.other", }, } BATCH_TRANSFER_RESPONSE = { "id": 468956, "user": 123, "targetAccount": 11112222, "collaborator_id": 10, "sourceAccount": None, "quoteUuid": "7df24b5c-ced1-425e-bc57-f993aa07b942", "status": "incoming_payment_waiting", "reference": "to my friend", "rate": 0.9065, "created": "2018-08-28 07:43:55", "business": 123, "transferRequest": None, "details": {"reference": "to my friend"}, "hasActiveIssues": False, "sourceCurrency": "USD", "sourceValue": 661.89, "targetCurrency": "USD", "targetValue": 600, "customerTransactionId": "784d48fd-0f1a-49c8-bf11-fb0998714352", } CREATE_PAYMENT_PAYLOAD = { "profile_id": 4497, "sourceCurrency": "USD", "targetCurrency": "USD", "name": "Batch 666", "transfers": [ { "targetAccount": 11112222, "collaborator_id": 1, "quoteUuid": "81b5e5b0-e7d8-4112-aad9-b9189d53dcb2", "details": { "reference": "13926297", "transferPurpose": "Other", "sourceOfFunds": "Salary", }, } ], } CREATE_PAYMENT_PAYLOAD_JPY = { "profile_id": 4497, "sourceCurrency": "JPY", "name": "Batch 666", "transfers": [ { "targetAccount": 1, "collaborator_id": 1, "quoteUuid": "81b5e5b0-e7d8-4112-aad9-b9189d53dcb2", "details": { "reference": "13926297", "transferPurpose": "Other", "sourceOfFunds": "Salary", }, } ], } SAVE_TRANSACTIONS_RESPONSE = [ { "source_amount": 50.0, "target_amount": 50.0, "transferwise_batch_id": 5, "source_currency": "USD", "target_currency": "USD", "profile_id": 1, "quote_id": "81b5e5b0-e7d8-4112-aad9-b9189d53dcb2", "recipient_id": 1, "collaborator_id": 10, "status": "COMPLETED", "id": 1, "transfer_id": 134, "created_date": "2020-10-08T12:34:56", }, { "source_amount": 100.0, "target_amount": 100.0, "amount": 100.0, "transferwise_batch_id": 5, "source_currency": "USD", "target_currency": "USD", "profile_id": 2, "quote_id": "81b5e5b0-e7d8-4112-aad9-b9189d53dcb2", "recipient_id": 2, "collaborator_id": 10, "status": "COMPLETED", "id": 2, "transfer_id": 134, "created_date": "2020-10-08T12:34:56", }, ] EXPECTED_SAVE_TRANSFERWISE_TRANSACTIONS_PAYLOAD = [ { "profile_id": 4497, "recipient_id": 11112222, "collaborator_id": 1, "transferwise_batch_id": 6, "transfer_id": 468956, "quote_id": "7df24b5c-ced1-425e-bc57-f993aa07b942", "target_currency": "USD", "target_amount": 129.24, "source_currency": "USD", "source_amount": 100, "status": "incoming_payment_waiting", "wire_fee": 0.1, "transferwise_fee": 0.92, "conversion_rate": 0.9065, } ] EXPECTED_TRANSACTIONS_PAYLOAD = [ { "profile_id": 4497, "recipient_id": 12341234, "transfer_id": 468956, "quote_id": "7df24b5c-ced1-425e-bc57-f993aa07b942", "target_currency": "GBP", "target_amount": 600, "source_currency": "EUR", "source_amount": 661.89, "status": "incoming_payment_waiting", } ] TRANSFER_REQUIREMENTS_RESPONSE = [ { "type": "transfer", "fields": [ { "name": "Transfer reference", "group": [ { "key": "reference", "name": "Transfer reference", "type": "text", "refreshRequirementsOnChange": False, "required": False, "displayFormat": None, "example": None, "minLength": None, "maxLength": 10, "validationRegexp": "[a-zA-Z0-9- ]*", "validationAsync": None, "valuesAllowed": None, } ], }, ], } ]