From 8451018f21528cabc88dceb1a22d6e40e4e790e3 Mon Sep 17 00:00:00 2001 From: Zero Date: Fri, 7 Jul 2023 08:28:40 -0600 Subject: [PATCH 1/5] recipient account --- .../RecipientAccountTest-test_basic_crud_.yml | 351 ++++++++++++++++++ test/integration/RecipientAccountTest.rb | 78 ++-- 2 files changed, 391 insertions(+), 38 deletions(-) create mode 100644 test/fixtures/RecipientAccountTest-test_basic_crud_.yml diff --git a/test/fixtures/RecipientAccountTest-test_basic_crud_.yml b/test/fixtures/RecipientAccountTest-test_basic_crud_.yml new file mode 100644 index 0000000..de814d9 --- /dev/null +++ b/test/fixtures/RecipientAccountTest-test_basic_crud_.yml @@ -0,0 +1,351 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.create0d099a65-ea79-4227-b59a-f0a3117e8fed@example.com"}' + headers: + X-Pr-Timestamp: + - '1688740017' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:26:58 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '599' + X-Rate-Limit-Reset: + - '1688740078' + Vary: + - Origin + Etag: + - W/"4ef-gARTFwHm16iQtV2ign2iBEvF6Yc" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-CtyWGDSCD97PYfoaGP4BJW","referenceId":"R-CtyWGDSCD97PYfoaGP4BJW","parentRecipientId":null,"email":"test.create0d099a65-ea79-4227-b59a-f0a3117e8fed@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:26:58.044Z","createdAt":"2023-07-07T14:26:58.044Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/003103a787e845a8a946ce765e860534?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:26:58 GMT +- request: + method: post + uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts + body: + encoding: UTF-8 + string: '{"type":"bank-transfer","currency":"EUR","country":"DE","iban":"DE89 + 3704 0044 0532 0130 00"}' + headers: + X-Pr-Timestamp: + - '1688740018' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:26:58 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '657' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '598' + X-Rate-Limit-Reset: + - '1688740078' + Vary: + - Origin + Etag: + - W/"291-FhE+8aTIdwBwmXaMEQEWo+Fg4ig" + body: + encoding: UTF-8 + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-BawoXz1hwCCEccbtVDcacH","recipientId":"R-CtyWGDSCD97PYfoaGP4BJW","recipientAccountId":"A-BawoXz1hwCCEccbtVDcacH","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' + recorded_at: Fri, 07 Jul 2023 14:26:58 GMT +- request: + method: patch + uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts/A-BawoXz1hwCCEccbtVDcacH + body: + encoding: UTF-8 + string: '{"primary":true}' + headers: + X-Pr-Timestamp: + - '1688740018' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:26:59 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '657' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '597' + X-Rate-Limit-Reset: + - '1688740078' + Vary: + - Origin + Etag: + - W/"291-FhE+8aTIdwBwmXaMEQEWo+Fg4ig" + body: + encoding: UTF-8 + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-BawoXz1hwCCEccbtVDcacH","recipientId":"R-CtyWGDSCD97PYfoaGP4BJW","recipientAccountId":"A-BawoXz1hwCCEccbtVDcacH","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' + recorded_at: Fri, 07 Jul 2023 14:26:59 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts/A-BawoXz1hwCCEccbtVDcacH + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688740019' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:26:59 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '657' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '596' + X-Rate-Limit-Reset: + - '1688740078' + Vary: + - Origin + Etag: + - W/"291-FhE+8aTIdwBwmXaMEQEWo+Fg4ig" + body: + encoding: UTF-8 + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-BawoXz1hwCCEccbtVDcacH","recipientId":"R-CtyWGDSCD97PYfoaGP4BJW","recipientAccountId":"A-BawoXz1hwCCEccbtVDcacH","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' + recorded_at: Fri, 07 Jul 2023 14:26:59 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts/A-BawoXz1hwCCEccbtVDcacH + body: + encoding: UTF-8 + string: '' + headers: + X-Pr-Timestamp: + - '1688740019' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:27:00 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '595' + X-Rate-Limit-Reset: + - '1688740078' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:27:00 GMT +recorded_with: VCR 6.2.0 diff --git a/test/integration/RecipientAccountTest.rb b/test/integration/RecipientAccountTest.rb index 59c6fdf..cd0c1a7 100755 --- a/test/integration/RecipientAccountTest.rb +++ b/test/integration/RecipientAccountTest.rb @@ -5,44 +5,46 @@ class RecipientAccountTest < Test::Unit::TestCase # rubocop:disable Metrics/MethodLength def test_basic_crud - recipient = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com" - ) - recipient_account = @client.recipient_account.create( - recipient.id, type: 'bank-transfer', - currency: 'EUR', - country: 'DE', - iban: 'DE89 3704 0044 0532 0130 00' - ) - - assert_not_nil(recipient_account) - assert_equal(recipient_account.type, 'bank-transfer') - assert_equal(recipient_account.currency, 'EUR') - - recipient_account = @client.recipient_account.update( - recipient.id, recipient_account.id, - primary: true - ) - - assert_not_nil(recipient_account) - assert_equal(recipient_account.type, 'bank-transfer') - assert_equal(recipient_account.currency, 'EUR') - assert_equal(recipient_account.primary, true) - - recipient_account = @client.recipient_account.find( - recipient.id, recipient_account.id - ) - - assert_not_nil(recipient_account) - - response = @client.recipient_account.delete( - recipient.id, recipient_account.id - ) - - assert_true(response) + with_vcr do + recipient = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com" + ) + recipient_account = @client.recipient_account.create( + recipient.id, type: 'bank-transfer', + currency: 'EUR', + country: 'DE', + iban: 'DE89 3704 0044 0532 0130 00' + ) + + assert_not_nil(recipient_account) + assert_equal(recipient_account.type, 'bank-transfer') + assert_equal(recipient_account.currency, 'EUR') + + recipient_account = @client.recipient_account.update( + recipient.id, recipient_account.id, + primary: true + ) + + assert_not_nil(recipient_account) + assert_equal(recipient_account.type, 'bank-transfer') + assert_equal(recipient_account.currency, 'EUR') + assert_equal(recipient_account.primary, true) + + recipient_account = @client.recipient_account.find( + recipient.id, recipient_account.id + ) + + assert_not_nil(recipient_account) + + response = @client.recipient_account.delete( + recipient.id, recipient_account.id + ) + + assert_true(response) + end end # rubocop:enable Metrics/MethodLength end From b04b37c7c82a25f4ef103706993817e2e969c423 Mon Sep 17 00:00:00 2001 From: Zero Date: Fri, 7 Jul 2023 08:49:10 -0600 Subject: [PATCH 2/5] improve file mgmt --- .../test_basic_crud.yml} | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) rename test/fixtures/{RecipientAccountTest-test_basic_crud_.yml => RecipientAccountTest/test_basic_crud.yml} (81%) diff --git a/test/fixtures/RecipientAccountTest-test_basic_crud_.yml b/test/fixtures/RecipientAccountTest/test_basic_crud.yml similarity index 81% rename from test/fixtures/RecipientAccountTest-test_basic_crud_.yml rename to test/fixtures/RecipientAccountTest/test_basic_crud.yml index de814d9..428d729 100644 --- a/test/fixtures/RecipientAccountTest-test_basic_crud_.yml +++ b/test/fixtures/RecipientAccountTest/test_basic_crud.yml @@ -5,10 +5,10 @@ http_interactions: uri: https://api.trolley.com/v1/recipients/ body: encoding: UTF-8 - string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.create0d099a65-ea79-4227-b59a-f0a3117e8fed@example.com"}' + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.create4237ca96-b313-4061-ad7b-7fa462a32d18@example.com"}' headers: X-Pr-Timestamp: - - '1688740017' + - '1688741330' Content-Type: - application/json Accept-Encoding: @@ -23,7 +23,7 @@ http_interactions: message: OK headers: Date: - - Fri, 07 Jul 2023 14:26:58 GMT + - Fri, 07 Jul 2023 14:48:51 GMT Content-Type: - application/json; charset=utf-8 Content-Length: @@ -59,26 +59,26 @@ http_interactions: X-Rate-Limit-Remaining: - '599' X-Rate-Limit-Reset: - - '1688740078' + - '1688741391' Vary: - Origin Etag: - - W/"4ef-gARTFwHm16iQtV2ign2iBEvF6Yc" + - W/"4ef-6jsofikZdpsuTHcS+HDYKlPAo2c" body: encoding: UTF-8 - string: '{"ok":true,"recipient":{"id":"R-CtyWGDSCD97PYfoaGP4BJW","referenceId":"R-CtyWGDSCD97PYfoaGP4BJW","parentRecipientId":null,"email":"test.create0d099a65-ea79-4227-b59a-f0a3117e8fed@example.com","name":"Tom - Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:26:58.044Z","createdAt":"2023-07-07T14:26:58.044Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/003103a787e845a8a946ce765e860534?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' - recorded_at: Fri, 07 Jul 2023 14:26:58 GMT + string: '{"ok":true,"recipient":{"id":"R-3jNqCdbdaNuq5wq9vXNMgf","referenceId":"R-3jNqCdbdaNuq5wq9vXNMgf","parentRecipientId":null,"email":"test.create4237ca96-b313-4061-ad7b-7fa462a32d18@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:48:51.568Z","createdAt":"2023-07-07T14:48:51.568Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/cef4f020db92bec5aee19de9e10f6cf9?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:48:51 GMT - request: method: post - uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts + uri: https://api.trolley.com/v1/recipients/R-3jNqCdbdaNuq5wq9vXNMgf/accounts body: encoding: UTF-8 string: '{"type":"bank-transfer","currency":"EUR","country":"DE","iban":"DE89 3704 0044 0532 0130 00"}' headers: X-Pr-Timestamp: - - '1688740018' + - '1688741331' Content-Type: - application/json Accept-Encoding: @@ -93,7 +93,7 @@ http_interactions: message: OK headers: Date: - - Fri, 07 Jul 2023 14:26:58 GMT + - Fri, 07 Jul 2023 14:48:52 GMT Content-Type: - application/json; charset=utf-8 Content-Length: @@ -129,26 +129,26 @@ http_interactions: X-Rate-Limit-Remaining: - '598' X-Rate-Limit-Reset: - - '1688740078' + - '1688741391' Vary: - Origin Etag: - - W/"291-FhE+8aTIdwBwmXaMEQEWo+Fg4ig" + - W/"291-yIB0SU69W9RqSJN1VCizaVu7w8Y" body: encoding: UTF-8 - string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-BawoXz1hwCCEccbtVDcacH","recipientId":"R-CtyWGDSCD97PYfoaGP4BJW","recipientAccountId":"A-BawoXz1hwCCEccbtVDcacH","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-JDBbcfDB9gjk8RipHt93qi","recipientId":"R-3jNqCdbdaNuq5wq9vXNMgf","recipientAccountId":"A-JDBbcfDB9gjk8RipHt93qi","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' - recorded_at: Fri, 07 Jul 2023 14:26:58 GMT + recorded_at: Fri, 07 Jul 2023 14:48:52 GMT - request: method: patch - uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts/A-BawoXz1hwCCEccbtVDcacH + uri: https://api.trolley.com/v1/recipients/R-3jNqCdbdaNuq5wq9vXNMgf/accounts/A-JDBbcfDB9gjk8RipHt93qi body: encoding: UTF-8 string: '{"primary":true}' headers: X-Pr-Timestamp: - - '1688740018' + - '1688741332' Content-Type: - application/json Accept-Encoding: @@ -163,7 +163,7 @@ http_interactions: message: OK headers: Date: - - Fri, 07 Jul 2023 14:26:59 GMT + - Fri, 07 Jul 2023 14:48:52 GMT Content-Type: - application/json; charset=utf-8 Content-Length: @@ -199,26 +199,26 @@ http_interactions: X-Rate-Limit-Remaining: - '597' X-Rate-Limit-Reset: - - '1688740078' + - '1688741391' Vary: - Origin Etag: - - W/"291-FhE+8aTIdwBwmXaMEQEWo+Fg4ig" + - W/"291-yIB0SU69W9RqSJN1VCizaVu7w8Y" body: encoding: UTF-8 - string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-BawoXz1hwCCEccbtVDcacH","recipientId":"R-CtyWGDSCD97PYfoaGP4BJW","recipientAccountId":"A-BawoXz1hwCCEccbtVDcacH","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-JDBbcfDB9gjk8RipHt93qi","recipientId":"R-3jNqCdbdaNuq5wq9vXNMgf","recipientAccountId":"A-JDBbcfDB9gjk8RipHt93qi","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' - recorded_at: Fri, 07 Jul 2023 14:26:59 GMT + recorded_at: Fri, 07 Jul 2023 14:48:52 GMT - request: method: get - uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts/A-BawoXz1hwCCEccbtVDcacH + uri: https://api.trolley.com/v1/recipients/R-3jNqCdbdaNuq5wq9vXNMgf/accounts/A-JDBbcfDB9gjk8RipHt93qi body: encoding: US-ASCII string: '' headers: X-Pr-Timestamp: - - '1688740019' + - '1688741332' Content-Type: - application/json Accept-Encoding: @@ -233,7 +233,7 @@ http_interactions: message: OK headers: Date: - - Fri, 07 Jul 2023 14:26:59 GMT + - Fri, 07 Jul 2023 14:48:53 GMT Content-Type: - application/json; charset=utf-8 Content-Length: @@ -269,26 +269,26 @@ http_interactions: X-Rate-Limit-Remaining: - '596' X-Rate-Limit-Reset: - - '1688740078' + - '1688741391' Vary: - Origin Etag: - - W/"291-FhE+8aTIdwBwmXaMEQEWo+Fg4ig" + - W/"291-yIB0SU69W9RqSJN1VCizaVu7w8Y" body: encoding: UTF-8 - string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-BawoXz1hwCCEccbtVDcacH","recipientId":"R-CtyWGDSCD97PYfoaGP4BJW","recipientAccountId":"A-BawoXz1hwCCEccbtVDcacH","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-JDBbcfDB9gjk8RipHt93qi","recipientId":"R-3jNqCdbdaNuq5wq9vXNMgf","recipientAccountId":"A-JDBbcfDB9gjk8RipHt93qi","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' - recorded_at: Fri, 07 Jul 2023 14:26:59 GMT + recorded_at: Fri, 07 Jul 2023 14:48:53 GMT - request: method: delete - uri: https://api.trolley.com/v1/recipients/R-CtyWGDSCD97PYfoaGP4BJW/accounts/A-BawoXz1hwCCEccbtVDcacH + uri: https://api.trolley.com/v1/recipients/R-3jNqCdbdaNuq5wq9vXNMgf/accounts/A-JDBbcfDB9gjk8RipHt93qi body: encoding: UTF-8 string: '' headers: X-Pr-Timestamp: - - '1688740019' + - '1688741333' Content-Type: - application/json Accept-Encoding: @@ -303,7 +303,7 @@ http_interactions: message: OK headers: Date: - - Fri, 07 Jul 2023 14:27:00 GMT + - Fri, 07 Jul 2023 14:48:53 GMT Content-Type: - application/json; charset=utf-8 Content-Length: @@ -339,7 +339,7 @@ http_interactions: X-Rate-Limit-Remaining: - '595' X-Rate-Limit-Reset: - - '1688740078' + - '1688741391' Vary: - Origin Etag: @@ -347,5 +347,5 @@ http_interactions: body: encoding: UTF-8 string: '{"ok":true}' - recorded_at: Fri, 07 Jul 2023 14:27:00 GMT + recorded_at: Fri, 07 Jul 2023 14:48:53 GMT recorded_with: VCR 6.2.0 From 64f930fedb78b476141dbc816952b55ef2349473 Mon Sep 17 00:00:00 2001 From: Zero Date: Fri, 7 Jul 2023 08:53:03 -0600 Subject: [PATCH 3/5] recipient test --- test/fixtures/RecipientTest/test_account.yml | 499 +++++++++++++++++ test/fixtures/RecipientTest/test_create.yml | 72 +++ .../RecipientTest/test_delete_multiple.yml | 347 ++++++++++++ .../fixtures/RecipientTest/test_find_logs.yml | 278 ++++++++++ .../RecipientTest/test_find_payments.yml | 512 ++++++++++++++++++ .../fixtures/RecipientTest/test_lifecycle.yml | 347 ++++++++++++ test/integration/RecipientTest.rb | 274 +++++----- 7 files changed, 2198 insertions(+), 131 deletions(-) create mode 100644 test/fixtures/RecipientTest/test_account.yml create mode 100644 test/fixtures/RecipientTest/test_create.yml create mode 100644 test/fixtures/RecipientTest/test_delete_multiple.yml create mode 100644 test/fixtures/RecipientTest/test_find_logs.yml create mode 100644 test/fixtures/RecipientTest/test_find_payments.yml create mode 100644 test/fixtures/RecipientTest/test_lifecycle.yml diff --git a/test/fixtures/RecipientTest/test_account.yml b/test/fixtures/RecipientTest/test_account.yml new file mode 100644 index 0000000..992c9b9 --- /dev/null +++ b/test/fixtures/RecipientTest/test_account.yml @@ -0,0 +1,499 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.createb8e6424e-a94f-404f-aa8e-e2623e931a5b@example.com","address":{"street1":"123 + Wolfstrasse","city":"Berlin","country":"DE","postalCode":"123123"}}' + headers: + X-Pr-Timestamp: + - '1688741558' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:39 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1290' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '599' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"50a-4eU/38c63p2woJQwtHM/crnjG18" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-9nkDE4BNDGCe3MMtzLTw7v","referenceId":"R-9nkDE4BNDGCe3MMtzLTw7v","parentRecipientId":null,"email":"test.createb8e6424e-a94f-404f-aa8e-e2623e931a5b@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:39.005Z","createdAt":"2023-07-07T14:52:39.005Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"123 + Wolfstrasse","street2":"","city":"Berlin","postalCode":"123123","country":"DE","region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/38efd0723a83df3b704d0470331ab9a2?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":"sepa","routeMinimum":"0","estimatedFees":"3","accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:39 GMT +- request: + method: post + uri: https://api.trolley.com/v1/recipients/R-9nkDE4BNDGCe3MMtzLTw7v/accounts + body: + encoding: UTF-8 + string: '{"type":"bank-transfer","currency":"EUR","country":"DE","iban":"DE89 + 3704 0044 0532 0130 00"}' + headers: + X-Pr-Timestamp: + - '1688741559' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:39 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '657' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '598' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"291-K78s3IM/wcdK6HFayAU/rtKVR+0" + body: + encoding: UTF-8 + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-SPpLxm3exkDB2eSxBSCSjS","recipientId":"R-9nkDE4BNDGCe3MMtzLTw7v","recipientAccountId":"A-SPpLxm3exkDB2eSxBSCSjS","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' + recorded_at: Fri, 07 Jul 2023 14:52:39 GMT +- request: + method: post + uri: https://api.trolley.com/v1/recipients/R-9nkDE4BNDGCe3MMtzLTw7v/accounts + body: + encoding: UTF-8 + string: '{"type":"bank-transfer","currency":"EUR","country":"FR","iban":"FR14 + 2004 1010 0505 0001 3M02 606"}' + headers: + X-Pr-Timestamp: + - '1688741559' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:40 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '657' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '597' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"291-n0JpdXtk/P5333GduHaZyEoiYUU" + body: + encoding: UTF-8 + string: '{"ok":true,"account":{"status":"inactive","type":"bank-transfer","primary":false,"currency":"EUR","id":"A-KdXAWZgbAtNhSQFaU72GCf","recipientId":"R-9nkDE4BNDGCe3MMtzLTw7v","recipientAccountId":"A-KdXAWZgbAtNhSQFaU72GCf","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"FR","iban":"*************************06","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"PSSTFRPPLIL","branchId":"","bankId":"","bankName":"La Banque + Postale","bankAddress":"3 R Paul Duez","bankCity":"Lille","bankRegionCode":"Hauts-de-France","bankPostalCode":"59900 + Cedex 9","routeType":"sepa","recipientFees":"2"}}' + recorded_at: Fri, 07 Jul 2023 14:52:40 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-9nkDE4BNDGCe3MMtzLTw7v/accounts/A-KdXAWZgbAtNhSQFaU72GCf + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741560' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:40 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '657' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '596' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"291-n0JpdXtk/P5333GduHaZyEoiYUU" + body: + encoding: UTF-8 + string: '{"ok":true,"account":{"status":"inactive","type":"bank-transfer","primary":false,"currency":"EUR","id":"A-KdXAWZgbAtNhSQFaU72GCf","recipientId":"R-9nkDE4BNDGCe3MMtzLTw7v","recipientAccountId":"A-KdXAWZgbAtNhSQFaU72GCf","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"FR","iban":"*************************06","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"PSSTFRPPLIL","branchId":"","bankId":"","bankName":"La Banque + Postale","bankAddress":"3 R Paul Duez","bankCity":"Lille","bankRegionCode":"Hauts-de-France","bankPostalCode":"59900 + Cedex 9","routeType":"sepa","recipientFees":"2"}}' + recorded_at: Fri, 07 Jul 2023 14:52:40 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-9nkDE4BNDGCe3MMtzLTw7v/accounts/ + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741560' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:40 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1296' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '595' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"510-eA4cu480S15ynL0bNKHOCBKV3cw" + body: + encoding: UTF-8 + string: '{"ok":true,"accounts":[{"status":"inactive","type":"bank-transfer","primary":false,"currency":"EUR","id":"A-KdXAWZgbAtNhSQFaU72GCf","recipientId":"R-9nkDE4BNDGCe3MMtzLTw7v","recipientAccountId":"A-KdXAWZgbAtNhSQFaU72GCf","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"FR","iban":"*************************06","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"PSSTFRPPLIL","branchId":"","bankId":"","bankName":"La Banque + Postale","bankAddress":"3 R Paul Duez","bankCity":"Lille","bankRegionCode":"Hauts-de-France","bankPostalCode":"59900 + Cedex 9","routeType":"sepa","recipientFees":"2"},{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-SPpLxm3exkDB2eSxBSCSjS","recipientId":"R-9nkDE4BNDGCe3MMtzLTw7v","recipientAccountId":"A-SPpLxm3exkDB2eSxBSCSjS","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}]}' + recorded_at: Fri, 07 Jul 2023 14:52:41 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/recipients/R-9nkDE4BNDGCe3MMtzLTw7v/accounts/A-KdXAWZgbAtNhSQFaU72GCf + body: + encoding: UTF-8 + string: '' + headers: + X-Pr-Timestamp: + - '1688741561' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:41 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '594' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:52:41 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-9nkDE4BNDGCe3MMtzLTw7v/accounts/ + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741561' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:41 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '660' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '593' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"294-Jkj7xB6/lo5btHjPZVL4xl+jPeg" + body: + encoding: UTF-8 + string: '{"ok":true,"accounts":[{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-SPpLxm3exkDB2eSxBSCSjS","recipientId":"R-9nkDE4BNDGCe3MMtzLTw7v","recipientAccountId":"A-SPpLxm3exkDB2eSxBSCSjS","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}]}' + recorded_at: Fri, 07 Jul 2023 14:52:42 GMT +recorded_with: VCR 6.2.0 diff --git a/test/fixtures/RecipientTest/test_create.yml b/test/fixtures/RecipientTest/test_create.yml new file mode 100644 index 0000000..5e96b38 --- /dev/null +++ b/test/fixtures/RecipientTest/test_create.yml @@ -0,0 +1,72 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.create624e2883-d634-4b73-a83c-3d0708c2caca@example.com"}' + headers: + X-Pr-Timestamp: + - '1688741562' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:42 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '592' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-BNbOBtPZteTxvpiS16nJT1djA7M" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-Up5Cgq3FmANtFcZt3oVH6G","referenceId":"R-Up5Cgq3FmANtFcZt3oVH6G","parentRecipientId":null,"email":"test.create624e2883-d634-4b73-a83c-3d0708c2caca@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:42.381Z","createdAt":"2023-07-07T14:52:42.381Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/19fbda248217ef7dce65e6679a8b0e77?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:42 GMT +recorded_with: VCR 6.2.0 diff --git a/test/fixtures/RecipientTest/test_delete_multiple.yml b/test/fixtures/RecipientTest/test_delete_multiple.yml new file mode 100644 index 0000000..b5ae609 --- /dev/null +++ b/test/fixtures/RecipientTest/test_delete_multiple.yml @@ -0,0 +1,347 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.create07f52829-4736-47d0-ada8-4885e39786e3@example.com"}' + headers: + X-Pr-Timestamp: + - '1688741562' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:42 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '591' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-LM5+QFfc7FfEHQjerM7yULvfVCc" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-YHLKWXRKs5oiGz6bzmbp4r","referenceId":"R-YHLKWXRKs5oiGz6bzmbp4r","parentRecipientId":null,"email":"test.create07f52829-4736-47d0-ada8-4885e39786e3@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:42.863Z","createdAt":"2023-07-07T14:52:42.863Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/761d5359c30dbb7a2827da16bc845edc?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:43 GMT +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.createe90b2735-3a07-4ce5-b58e-82024aa27bca@example.com"}' + headers: + X-Pr-Timestamp: + - '1688741563' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:43 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '590' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-gE/zQsfRnrAIMdaTytnuNHjHTG0" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-U27xuZBFJ8Th3hiHoQ3MXt","referenceId":"R-U27xuZBFJ8Th3hiHoQ3MXt","parentRecipientId":null,"email":"test.createe90b2735-3a07-4ce5-b58e-82024aa27bca@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:43.361Z","createdAt":"2023-07-07T14:52:43.361Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/7f79429dc0404ccb907c51a284ec8564?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:43 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"ids":["R-YHLKWXRKs5oiGz6bzmbp4r","R-U27xuZBFJ8Th3hiHoQ3MXt"]}' + headers: + X-Pr-Timestamp: + - '1688741563' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:43 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '589' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:52:44 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-YHLKWXRKs5oiGz6bzmbp4r + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741564' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:44 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1235' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '588' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4d3-8Chmt0wHO0No3g1gdxuG8OtRazY" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-YHLKWXRKs5oiGz6bzmbp4r","referenceId":"R-YHLKWXRKs5oiGz6bzmbp4r","parentRecipientId":null,"email":"test.create07f52829-4736-47d0-ada8-4885e39786e3@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"archived","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:43.908Z","createdAt":"2023-07-07T14:52:42.863Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/761d5359c30dbb7a2827da16bc845edc?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:44 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-U27xuZBFJ8Th3hiHoQ3MXt + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741564' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:44 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1235' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '587' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4d3-JuxHV1I2tOBBgu/vHp/pgG8nK3s" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-U27xuZBFJ8Th3hiHoQ3MXt","referenceId":"R-U27xuZBFJ8Th3hiHoQ3MXt","parentRecipientId":null,"email":"test.createe90b2735-3a07-4ce5-b58e-82024aa27bca@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"archived","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:43.907Z","createdAt":"2023-07-07T14:52:43.361Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/7f79429dc0404ccb907c51a284ec8564?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:45 GMT +recorded_with: VCR 6.2.0 diff --git a/test/fixtures/RecipientTest/test_find_logs.yml b/test/fixtures/RecipientTest/test_find_logs.yml new file mode 100644 index 0000000..2559422 --- /dev/null +++ b/test/fixtures/RecipientTest/test_find_logs.yml @@ -0,0 +1,278 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.create349b70bc-35a6-40ef-a708-1d72c6d5be9d@example.com"}' + headers: + X-Pr-Timestamp: + - '1688741565' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:45 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '586' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-/BHfdmLGdFUwWpCqRb4a40VDiiY" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-2EjyvsDtuv56CVF7oDwHrw","referenceId":"R-2EjyvsDtuv56CVF7oDwHrw","parentRecipientId":null,"email":"test.create349b70bc-35a6-40ef-a708-1d72c6d5be9d@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:45.334Z","createdAt":"2023-07-07T14:52:45.334Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/33af08c0d9db2976ae50ca70eb379bae?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:45 GMT +- request: + method: patch + uri: https://api.trolley.com/v1/recipients/R-2EjyvsDtuv56CVF7oDwHrw + body: + encoding: UTF-8 + string: '{"firstName":"John"}' + headers: + X-Pr-Timestamp: + - '1688741565' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:45 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1265' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '585' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4f1-2BVFC6S29Z09YJ35TfipFRqnsUY" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-2EjyvsDtuv56CVF7oDwHrw","referenceId":"R-2EjyvsDtuv56CVF7oDwHrw","parentRecipientId":null,"email":"test.create349b70bc-35a6-40ef-a708-1d72c6d5be9d@example.com","name":"John + Jones","lastName":"Jones","firstName":"John","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:45.819Z","createdAt":"2023-07-07T14:52:45.334Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/33af08c0d9db2976ae50ca70eb379bae?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:46 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-2EjyvsDtuv56CVF7oDwHrw/logs + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741566' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:46 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '2057' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '584' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"809-ycF+rs19XpoTXuU9rwvOVa34kwk" + body: + encoding: UTF-8 + string: '{"ok":true,"recipientLogs":[{"via":"apikey","ipAddress":"168.232.29.174","userId":"ASC7AsydGC5RTBMF6MH4C5NQ","type":"create","fields":[{"name":"guid","oldValue":null,"newValue":"R-2EjyvsDtuv56CVF7oDwHrw"},{"name":"referenceId","oldValue":null,"newValue":"R-2EjyvsDtuv56CVF7oDwHrw"},{"name":"status","oldValue":null,"newValue":"incomplete"},{"name":"enabledStatus","oldValue":null,"newValue":"enabled"},{"name":"email","oldValue":null,"newValue":"test.create349b70bc-35a6-40ef-a708-1d72c6d5be9d@example.com"},{"name":"name","oldValue":null,"newValue":"Tom + Jones"},{"name":"firstName","oldValue":null,"newValue":"Tom"},{"name":"lastName","oldValue":null,"newValue":"Jones"},{"name":"legalName","oldValue":null,"newValue":""},{"name":"occupation","oldValue":null,"newValue":""},{"name":"type","oldValue":null,"newValue":"individual"},{"name":"language","oldValue":null,"newValue":"en"},{"name":"complianceStatus","oldValue":null,"newValue":"pending"},{"name":"taxDeliveryType","oldValue":null,"newValue":"mail"},{"name":"phone","oldValue":null,"newValue":""},{"name":"phoneValidated","oldValue":null,"newValue":false},{"name":"testMode","oldValue":null,"newValue":true},{"name":"isPortalUser","oldValue":null,"newValue":false},{"name":"contactEmails","oldValue":null,"newValue":"[]"},{"name":"street1","oldValue":null,"newValue":""},{"name":"street2","oldValue":null,"newValue":""},{"name":"city","oldValue":null,"newValue":""},{"name":"postalCode","oldValue":null,"newValue":""},{"name":"tags","oldValue":null,"newValue":"[]"},{"name":"idvStatus","oldValue":null,"newValue":"manual"},{"name":"birthplace","oldValue":null,"newValue":"{\"country\":null,\"region\":null,\"city\":null}"},{"name":"governmentIds","oldValue":null,"newValue":"[]"},{"name":"citizenships","oldValue":null,"newValue":"[]"},{"name":"payoutMethod","oldValue":null,"newValue":"bank-transfer"},{"name":"canPay","oldValue":null,"newValue":false},{"name":"taxFormStatus","oldValue":null,"newValue":"missing"}],"createdAt":"2023-07-07T14:52:45.901Z"}],"meta":{"page":1,"pages":1,"records":1}}' + recorded_at: Fri, 07 Jul 2023 14:52:46 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/recipients/R-2EjyvsDtuv56CVF7oDwHrw + body: + encoding: UTF-8 + string: '' + headers: + X-Pr-Timestamp: + - '1688741566' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:46 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '583' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:52:46 GMT +recorded_with: VCR 6.2.0 diff --git a/test/fixtures/RecipientTest/test_find_payments.yml b/test/fixtures/RecipientTest/test_find_payments.yml new file mode 100644 index 0000000..31deb93 --- /dev/null +++ b/test/fixtures/RecipientTest/test_find_payments.yml @@ -0,0 +1,512 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.created266fa63-752b-4a26-8679-2faf52b51801@example.com"}' + headers: + X-Pr-Timestamp: + - '1688741566' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:47 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '582' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-YEtCSc3uEfCHQA/II+/UFbFoV/g" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-4WeMhvokhsgTmtPd7kZWtt","referenceId":"R-4WeMhvokhsgTmtPd7kZWtt","parentRecipientId":null,"email":"test.created266fa63-752b-4a26-8679-2faf52b51801@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:47.205Z","createdAt":"2023-07-07T14:52:47.205Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/e4afbf51fd658ec0c4beb69c834cfd08?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:47 GMT +- request: + method: post + uri: https://api.trolley.com/v1/recipients/R-4WeMhvokhsgTmtPd7kZWtt/accounts + body: + encoding: UTF-8 + string: '{"type":"bank-transfer","currency":"EUR","country":"DE","iban":"DE89 + 3704 0044 0532 0130 00"}' + headers: + X-Pr-Timestamp: + - '1688741567' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:47 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '657' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '581' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"291-T/3xIS3uCsmaSdJtkugC+0iMYEE" + body: + encoding: UTF-8 + string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}' + recorded_at: Fri, 07 Jul 2023 14:52:47 GMT +- request: + method: post + uri: https://api.trolley.com/v1/batches/ + body: + encoding: UTF-8 + string: '{"sourceCurrency":"USD","description":"Integration Test Payments","payments":[{"targetAmount":"10.00","targetCurrency":"EUR","recipient":{"id":"R-4WeMhvokhsgTmtPd7kZWtt"}},{"sourceAmount":"10.00","recipient":{"id":"R-4WeMhvokhsgTmtPd7kZWtt"}}]}' + headers: + X-Pr-Timestamp: + - '1688741567' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:48 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '10384' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '580' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"2890-ymg/9q6DRe4vP9+O6DBVpVEQIR8" + body: + encoding: UTF-8 + string: '{"ok":true,"batch":{"id":"B-81AuTAM8LVjrA8cavGrVhM","status":"open","tags":[],"amount":"26.88","currency":"USD","totalPayments":2,"description":"Integration + Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:52:48.171Z","updatedAt":"2023-07-07T14:52:48.423Z","quoteExpiredAt":null,"payments":{"payments":[{"id":"P-FBshMK9eXPCPPZufTpTeUY","recipient":{"id":"R-4WeMhvokhsgTmtPd7kZWtt","referenceId":"R-4WeMhvokhsgTmtPd7kZWtt","parentRecipientId":null,"email":"test.created266fa63-752b-4a26-8679-2faf52b51801@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:47.695Z","createdAt":"2023-07-07T14:52:47.205Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/e4afbf51fd658ec0c4beb69c834cfd08?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}],"payoutMethod":"bank-transfer","primaryCurrency":"EUR","riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"countryCode":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null},"status":"pending","isSupplyPayment":true,"coverFees":true,"returnedAmount":"0.00","category":"services","amount":"10.00","currency":"EUR","sourceAmount":"10.88","sourceCurrency":"USD","targetAmount":"0.00","targetCurrency":"EUR","taxReportable":true,"taxBasisAmount":"10.00","taxBasisCurrency":"EUR","withholdingAmount":"0.00","withholdingCurrency":"EUR","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","exchangeRate":"0","fees":"4.00","recipientFees":"0.00","fxRate":"2.5","memo":"","externalId":"","processedAt":null,"createdAt":"2023-07-07T14:52:48.217Z","updatedAt":"2023-07-07T14:52:48.217Z","forceUsTaxActivity":false,"batch":{"id":"B-81AuTAM8LVjrA8cavGrVhM","status":"open","tags":[],"amount":"26.88","currency":"USD","totalPayments":2,"description":"Integration + Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:52:48.171Z","updatedAt":"2023-07-07T14:52:48.423Z","quoteExpiredAt":null},"checkNumber":null,"tags":[],"merchantFees":"4.00","compliance":{"status":"pending","checkedAt":null},"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"},"payoutMethod":"bank-transfer","methodDisplay":"Bank + Transfer","initiatedAt":null,"settledAt":null,"returnedAt":null,"returnedReason":[],"returnedNote":null,"estimatedDeliveryAt":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","taxes":[{"id":"OP-WuQQg98fA2oLyVPr3a8pjU","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","taxFormId":null,"entered":{"value":"10.00","currency":"EUR"},"withholding":{"value":"0.00","currency":"EUR"},"equivalentWithholding":{"value":"0.00","currency":"USD"},"amount":"10.00","currency":"EUR","withholdingAmount":"0.00","withholdingCurrency":"EUR","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","paymentId":"P-FBshMK9eXPCPPZufTpTeUY","externalId":null,"memo":"","payoutMethod":"bank-transfer","tags":[],"taxReportable":true,"category":"services","processedAt":"2023-07-07T14:52:48.194Z","forceUsTaxActivity":false,"taxWithholdingReason":null,"equivalentUntaxedAmount":{"value":"10.89","currency":"USD"},"modifiedSinceCreation":false,"taxPaidByWithholdingAgents":"0","status":"internal","enteredAmount":{"value":"10.00","currency":"EUR"},"updatedAt":"2023-07-07T14:52:48.210Z","createdAt":"2023-07-07T14:52:48.194Z","deletedAt":null,"dac7Meta":null}],"errors":["recipient-not-active","incomplete"],"routeMinimum":"0","routeType":"sepa"},{"id":"P-Hxrp5FJL6o9hZHPSTXH6cF","recipient":{"id":"R-4WeMhvokhsgTmtPd7kZWtt","referenceId":"R-4WeMhvokhsgTmtPd7kZWtt","parentRecipientId":null,"email":"test.created266fa63-752b-4a26-8679-2faf52b51801@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:47.695Z","createdAt":"2023-07-07T14:52:47.205Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/e4afbf51fd658ec0c4beb69c834cfd08?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}],"payoutMethod":"bank-transfer","primaryCurrency":"EUR","riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"countryCode":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null},"status":"pending","isSupplyPayment":false,"coverFees":false,"returnedAmount":"0.00","category":"services","amount":"10.00","currency":"USD","sourceAmount":"10.00","sourceCurrency":"USD","targetAmount":"0.00","targetCurrency":"EUR","taxReportable":true,"taxBasisAmount":"10.00","taxBasisCurrency":"USD","withholdingAmount":"0.00","withholdingCurrency":"USD","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","exchangeRate":"0","fees":"4.00","recipientFees":"2.00","fxRate":"2.5","memo":"","externalId":"","processedAt":null,"createdAt":"2023-07-07T14:52:48.213Z","updatedAt":"2023-07-07T14:52:48.213Z","forceUsTaxActivity":false,"batch":{"id":"B-81AuTAM8LVjrA8cavGrVhM","status":"open","tags":[],"amount":"26.88","currency":"USD","totalPayments":2,"description":"Integration + Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:52:48.171Z","updatedAt":"2023-07-07T14:52:48.423Z","quoteExpiredAt":null},"checkNumber":null,"tags":[],"merchantFees":"2.00","compliance":{"status":"pending","checkedAt":null},"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"},"payoutMethod":"bank-transfer","methodDisplay":"Bank + Transfer","initiatedAt":null,"settledAt":null,"returnedAt":null,"returnedReason":[],"returnedNote":null,"estimatedDeliveryAt":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","taxes":[{"id":"OP-WBqLGmCtnoQLJ8Cp2U1skB","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","taxFormId":null,"entered":{"value":"10.00","currency":"USD"},"withholding":{"value":"0.00","currency":"USD"},"equivalentWithholding":{"value":"0.00","currency":"USD"},"amount":"10.00","currency":"USD","withholdingAmount":"0.00","withholdingCurrency":"USD","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","paymentId":"P-Hxrp5FJL6o9hZHPSTXH6cF","externalId":null,"memo":"","payoutMethod":"bank-transfer","tags":[],"taxReportable":true,"category":"services","processedAt":"2023-07-07T14:52:48.191Z","forceUsTaxActivity":false,"taxWithholdingReason":null,"equivalentUntaxedAmount":{"value":"10.00","currency":"USD"},"modifiedSinceCreation":false,"taxPaidByWithholdingAgents":"0","status":"internal","enteredAmount":{"value":"10.00","currency":"USD"},"updatedAt":"2023-07-07T14:52:48.206Z","createdAt":"2023-07-07T14:52:48.191Z","deletedAt":null,"dac7Meta":null}],"errors":["recipient-not-active","incomplete"],"routeMinimum":"0","routeType":"sepa"}],"meta":{"page":1,"pages":1,"records":2}}}}' + recorded_at: Fri, 07 Jul 2023 14:52:48 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-4WeMhvokhsgTmtPd7kZWtt/payments?page=1&pageSize=10 + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741568' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:49 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '10076' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '579' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"275c-hI/tKcwxIJUBfreMPksVwydtXr4" + body: + encoding: UTF-8 + string: '{"ok":true,"payments":[{"id":"P-FBshMK9eXPCPPZufTpTeUY","recipient":{"id":"R-4WeMhvokhsgTmtPd7kZWtt","referenceId":"R-4WeMhvokhsgTmtPd7kZWtt","parentRecipientId":null,"email":"test.created266fa63-752b-4a26-8679-2faf52b51801@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:47.695Z","createdAt":"2023-07-07T14:52:47.205Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/e4afbf51fd658ec0c4beb69c834cfd08?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}],"payoutMethod":"bank-transfer","primaryCurrency":"EUR","riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"countryCode":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null},"status":"pending","isSupplyPayment":true,"coverFees":true,"returnedAmount":"0.00","category":"services","amount":"10.00","currency":"EUR","sourceAmount":"10.88","sourceCurrency":"USD","targetAmount":"0.00","targetCurrency":"EUR","taxReportable":true,"taxBasisAmount":"10.00","taxBasisCurrency":"EUR","withholdingAmount":"0.00","withholdingCurrency":"EUR","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","exchangeRate":"0","fees":"4.00","recipientFees":"0.00","fxRate":"2.5","memo":"","externalId":"","processedAt":null,"createdAt":"2023-07-07T14:52:48.217Z","updatedAt":"2023-07-07T14:52:48.217Z","forceUsTaxActivity":false,"batch":{"id":"B-81AuTAM8LVjrA8cavGrVhM","status":"open","tags":[],"amount":"26.88","currency":"USD","totalPayments":2,"description":"Integration + Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:52:48.171Z","updatedAt":"2023-07-07T14:52:48.423Z","quoteExpiredAt":null},"checkNumber":null,"tags":[],"merchantFees":"4.00","compliance":{"status":"pending","checkedAt":null},"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"},"payoutMethod":"bank-transfer","methodDisplay":"Bank + Transfer","initiatedAt":null,"settledAt":null,"returnedAt":null,"returnedReason":[],"returnedNote":null,"estimatedDeliveryAt":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","taxes":[{"id":"OP-WuQQg98fA2oLyVPr3a8pjU","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","taxFormId":null,"entered":{"value":"10.00","currency":"EUR"},"withholding":{"value":"0.00","currency":"EUR"},"equivalentWithholding":{"value":"0.00","currency":"USD"},"amount":"10.00","currency":"EUR","withholdingAmount":"0.00","withholdingCurrency":"EUR","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","paymentId":"P-FBshMK9eXPCPPZufTpTeUY","externalId":null,"memo":"","payoutMethod":"bank-transfer","tags":[],"taxReportable":true,"category":"services","processedAt":"2023-07-07T14:52:48.194Z","forceUsTaxActivity":false,"taxWithholdingReason":null,"equivalentUntaxedAmount":{"value":"10.89","currency":"USD"},"modifiedSinceCreation":false,"taxPaidByWithholdingAgents":"0","status":"internal","enteredAmount":{"value":"10.00","currency":"EUR"},"updatedAt":"2023-07-07T14:52:48.210Z","createdAt":"2023-07-07T14:52:48.194Z","deletedAt":null,"dac7Meta":null}],"errors":["recipient-not-active","incomplete"],"routeMinimum":"0","routeType":"sepa"},{"id":"P-Hxrp5FJL6o9hZHPSTXH6cF","recipient":{"id":"R-4WeMhvokhsgTmtPd7kZWtt","referenceId":"R-4WeMhvokhsgTmtPd7kZWtt","parentRecipientId":null,"email":"test.created266fa63-752b-4a26-8679-2faf52b51801@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:47.695Z","createdAt":"2023-07-07T14:52:47.205Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/e4afbf51fd658ec0c4beb69c834cfd08?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}],"payoutMethod":"bank-transfer","primaryCurrency":"EUR","riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"countryCode":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null},"status":"pending","isSupplyPayment":false,"coverFees":false,"returnedAmount":"0.00","category":"services","amount":"10.00","currency":"USD","sourceAmount":"10.00","sourceCurrency":"USD","targetAmount":"0.00","targetCurrency":"EUR","taxReportable":true,"taxBasisAmount":"10.00","taxBasisCurrency":"USD","withholdingAmount":"0.00","withholdingCurrency":"USD","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","exchangeRate":"0","fees":"4.00","recipientFees":"2.00","fxRate":"2.5","memo":"","externalId":"","processedAt":null,"createdAt":"2023-07-07T14:52:48.213Z","updatedAt":"2023-07-07T14:52:48.213Z","forceUsTaxActivity":false,"batch":{"id":"B-81AuTAM8LVjrA8cavGrVhM","status":"open","tags":[],"amount":"26.88","currency":"USD","totalPayments":2,"description":"Integration + Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:52:48.171Z","updatedAt":"2023-07-07T14:52:48.423Z","quoteExpiredAt":null},"checkNumber":null,"tags":[],"merchantFees":"2.00","compliance":{"status":"pending","checkedAt":null},"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-6QHpGfMBduzArWnRPaGbph","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","recipientAccountId":"A-6QHpGfMBduzArWnRPaGbph","disabledAt":null,"recipientReferenceId":"R-4WeMhvokhsgTmtPd7kZWtt","deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom + Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank + AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"},"payoutMethod":"bank-transfer","methodDisplay":"Bank + Transfer","initiatedAt":null,"settledAt":null,"returnedAt":null,"returnedReason":[],"returnedNote":null,"estimatedDeliveryAt":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","taxes":[{"id":"OP-WBqLGmCtnoQLJ8Cp2U1skB","recipientId":"R-4WeMhvokhsgTmtPd7kZWtt","taxFormId":null,"entered":{"value":"10.00","currency":"USD"},"withholding":{"value":"0.00","currency":"USD"},"equivalentWithholding":{"value":"0.00","currency":"USD"},"amount":"10.00","currency":"USD","withholdingAmount":"0.00","withholdingCurrency":"USD","equivalentWithholdingAmount":"0.00","equivalentWithholdingCurrency":"USD","paymentId":"P-Hxrp5FJL6o9hZHPSTXH6cF","externalId":null,"memo":"","payoutMethod":"bank-transfer","tags":[],"taxReportable":true,"category":"services","processedAt":"2023-07-07T14:52:48.191Z","forceUsTaxActivity":false,"taxWithholdingReason":null,"equivalentUntaxedAmount":{"value":"10.00","currency":"USD"},"modifiedSinceCreation":false,"taxPaidByWithholdingAgents":"0","status":"internal","enteredAmount":{"value":"10.00","currency":"USD"},"updatedAt":"2023-07-07T14:52:48.206Z","createdAt":"2023-07-07T14:52:48.191Z","deletedAt":null,"dac7Meta":null}],"errors":["recipient-not-active","incomplete"],"routeMinimum":"0","routeType":"sepa"}],"meta":{"page":1,"pages":1,"records":2}}' + recorded_at: Fri, 07 Jul 2023 14:52:49 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/batches/B-81AuTAM8LVjrA8cavGrVhM + body: + encoding: UTF-8 + string: '' + headers: + X-Pr-Timestamp: + - '1688741569' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:49 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '578' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:52:49 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/recipients/R-4WeMhvokhsgTmtPd7kZWtt/accounts/A-6QHpGfMBduzArWnRPaGbph + body: + encoding: UTF-8 + string: '' + headers: + X-Pr-Timestamp: + - '1688741569' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:50 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '577' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:52:50 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/recipients/R-4WeMhvokhsgTmtPd7kZWtt + body: + encoding: UTF-8 + string: '' + headers: + X-Pr-Timestamp: + - '1688741570' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:50 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '576' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:52:50 GMT +recorded_with: VCR 6.2.0 diff --git a/test/fixtures/RecipientTest/test_lifecycle.yml b/test/fixtures/RecipientTest/test_lifecycle.yml new file mode 100644 index 0000000..d744c1b --- /dev/null +++ b/test/fixtures/RecipientTest/test_lifecycle.yml @@ -0,0 +1,347 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.trolley.com/v1/recipients/ + body: + encoding: UTF-8 + string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.create50a9ae30-3e12-422d-afb5-cb1ad12b8f36@example.com"}' + headers: + X-Pr-Timestamp: + - '1688741570' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:51 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '575' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-/HAcVDifh0winYlZjGYUzD4Vlfk" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-KoYN6EFnFVBpr6LjQvZiUM","referenceId":"R-KoYN6EFnFVBpr6LjQvZiUM","parentRecipientId":null,"email":"test.create50a9ae30-3e12-422d-afb5-cb1ad12b8f36@example.com","name":"Tom + Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:51.142Z","createdAt":"2023-07-07T14:52:51.142Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/781825e57457fd0b8197c1786678dc05?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:51 GMT +- request: + method: patch + uri: https://api.trolley.com/v1/recipients/R-KoYN6EFnFVBpr6LjQvZiUM + body: + encoding: UTF-8 + string: '{"firstName":"Bob"}' + headers: + X-Pr-Timestamp: + - '1688741571' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:51 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '574' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-ewA+g1ibNxKdgeBaEASSSoW+JQU" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-KoYN6EFnFVBpr6LjQvZiUM","referenceId":"R-KoYN6EFnFVBpr6LjQvZiUM","parentRecipientId":null,"email":"test.create50a9ae30-3e12-422d-afb5-cb1ad12b8f36@example.com","name":"Bob + Jones","lastName":"Jones","firstName":"Bob","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:51.616Z","createdAt":"2023-07-07T14:52:51.142Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/781825e57457fd0b8197c1786678dc05?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:51 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-KoYN6EFnFVBpr6LjQvZiUM + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741571' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:52 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1263' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '573' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4ef-ewA+g1ibNxKdgeBaEASSSoW+JQU" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-KoYN6EFnFVBpr6LjQvZiUM","referenceId":"R-KoYN6EFnFVBpr6LjQvZiUM","parentRecipientId":null,"email":"test.create50a9ae30-3e12-422d-afb5-cb1ad12b8f36@example.com","name":"Bob + Jones","lastName":"Jones","firstName":"Bob","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:51.616Z","createdAt":"2023-07-07T14:52:51.142Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/781825e57457fd0b8197c1786678dc05?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:52 GMT +- request: + method: delete + uri: https://api.trolley.com/v1/recipients/R-KoYN6EFnFVBpr6LjQvZiUM + body: + encoding: UTF-8 + string: '' + headers: + X-Pr-Timestamp: + - '1688741572' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:52 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '11' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '572' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys" + body: + encoding: UTF-8 + string: '{"ok":true}' + recorded_at: Fri, 07 Jul 2023 14:52:52 GMT +- request: + method: get + uri: https://api.trolley.com/v1/recipients/R-KoYN6EFnFVBpr6LjQvZiUM + body: + encoding: US-ASCII + string: '' + headers: + X-Pr-Timestamp: + - '1688741572' + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 07 Jul 2023 14:52:53 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '1235' + Connection: + - keep-alive + Cache-Control: + - no-store, no-cache + Content-Security-Policy: + - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' + https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src + ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' + X-Dns-Prefetch-Control: + - 'off' + Expect-Ct: + - max-age=0 + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + X-Download-Options: + - noopen + X-Content-Type-Options: + - nosniff + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - no-referrer + X-Xss-Protection: + - '0' + Access-Control-Allow-Origin: + - "*" + X-Rate-Limit-Limit: + - '600' + X-Rate-Limit-Remaining: + - '571' + X-Rate-Limit-Reset: + - '1688741619' + Vary: + - Origin + Etag: + - W/"4d3-qUNKgvMPZsJ2B+0KtJkNglb0kpg" + body: + encoding: UTF-8 + string: '{"ok":true,"recipient":{"id":"R-KoYN6EFnFVBpr6LjQvZiUM","referenceId":"R-KoYN6EFnFVBpr6LjQvZiUM","parentRecipientId":null,"email":"test.create50a9ae30-3e12-422d-afb5-cb1ad12b8f36@example.com","name":"Bob + Jones","lastName":"Jones","firstName":"Bob","legalName":"","type":"individual","status":"archived","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:52:52.556Z","createdAt":"2023-07-07T14:52:51.142Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"","street2":"","city":"","postalCode":"","country":null,"region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/781825e57457fd0b8197c1786678dc05?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":null,"routeMinimum":null,"estimatedFees":null,"accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}' + recorded_at: Fri, 07 Jul 2023 14:52:53 GMT +recorded_with: VCR 6.2.0 diff --git a/test/integration/RecipientTest.rb b/test/integration/RecipientTest.rb index 117e5ff..3c75490 100644 --- a/test/integration/RecipientTest.rb +++ b/test/integration/RecipientTest.rb @@ -4,155 +4,167 @@ class RecipientTest < Test::Unit::TestCase include TestHelper def test_create - response = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com" - ) - assert_not_nil(response) - assert_equal(response.firstName, 'Tom') - assert_equal(response.lastName, 'Jones') - assert_not_nil(response.id) + with_vcr do + response = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com" + ) + assert_not_nil(response) + assert_equal(response.firstName, 'Tom') + assert_equal(response.lastName, 'Jones') + assert_not_nil(response.id) + end end def test_lifecycle - recipient = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com" - ) - assert_not_nil(recipient) - assert_equal(recipient.firstName, 'Tom') - assert_equal(recipient.status, 'incomplete') - - response = @client.recipient.update(recipient.id, firstName: 'Bob') - assert_true(response) - - recipient = @client.recipient.find(recipient.id) - assert_equal(recipient.firstName, 'Bob') - - response = @client.recipient.delete(recipient.id) - assert_true(response) - - recipient = @client.recipient.find(recipient.id) - assert_equal(recipient.status, 'archived') + with_vcr do + recipient = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com" + ) + assert_not_nil(recipient) + assert_equal(recipient.firstName, 'Tom') + assert_equal(recipient.status, 'incomplete') + + response = @client.recipient.update(recipient.id, firstName: 'Bob') + assert_true(response) + + recipient = @client.recipient.find(recipient.id) + assert_equal(recipient.firstName, 'Bob') + + response = @client.recipient.delete(recipient.id) + assert_true(response) + + recipient = @client.recipient.find(recipient.id) + assert_equal(recipient.status, 'archived') + end end def test_account - recipient = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com", - address: { - street1: '123 Wolfstrasse', - city: 'Berlin', - country: 'DE', - postalCode: '123123' - } - ) - assert_not_nil(recipient) - assert_equal(recipient.firstName, 'Tom') - assert_equal(recipient.lastName, 'Jones') - assert_not_nil(recipient.id) - assert_true(recipient.routeMinimum.to_i >= 0) - - account = @client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'DE', iban: 'DE89 3704 0044 0532 0130 00') - assert_not_nil(account) - - account = @client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'FR', iban: 'FR14 2004 1010 0505 0001 3M02 606') - assert_not_nil(account) - - findAccount = @client.recipient_account.find(recipient.id, account.id) - assert_equal(account.id, findAccount.id) - - accountList = @client.recipient_account.all(recipient.id) - assert_equal(2, accountList.count) - assert_equal(accountList[0].currency, 'EUR') - - result = @client.recipient_account.delete(recipient.id, account.id) - assert_true(result) - - accountList = @client.recipient_account.all(recipient.id) - assert_equal(1, accountList.count) + with_vcr do + recipient = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com", + address: { + street1: '123 Wolfstrasse', + city: 'Berlin', + country: 'DE', + postalCode: '123123' + } + ) + assert_not_nil(recipient) + assert_equal(recipient.firstName, 'Tom') + assert_equal(recipient.lastName, 'Jones') + assert_not_nil(recipient.id) + assert_true(recipient.routeMinimum.to_i >= 0) + + account = @client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'DE', iban: 'DE89 3704 0044 0532 0130 00') + assert_not_nil(account) + + account = @client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'FR', iban: 'FR14 2004 1010 0505 0001 3M02 606') + assert_not_nil(account) + + findAccount = @client.recipient_account.find(recipient.id, account.id) + assert_equal(account.id, findAccount.id) + + accountList = @client.recipient_account.all(recipient.id) + assert_equal(2, accountList.count) + assert_equal(accountList[0].currency, 'EUR') + + result = @client.recipient_account.delete(recipient.id, account.id) + assert_true(result) + + accountList = @client.recipient_account.all(recipient.id) + assert_equal(1, accountList.count) + end end def test_delete_multiple - recipient1 = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com" - ) - assert_not_nil(recipient1) - assert_equal(recipient1.firstName, 'Tom') - assert_equal(recipient1.status, 'incomplete') - - recipient2 = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com" - ) - assert_not_nil(recipient2) - assert_equal(recipient2.firstName, 'Tom') - assert_equal(recipient2.status, 'incomplete') - - response = @client.recipient.delete([recipient1.id, recipient2.id]) - assert_true(response) - - recipient1 = @client.recipient.find(recipient1.id) - assert_equal(recipient1.status, 'archived') - - recipient2 = @client.recipient.find(recipient2.id) - assert_equal(recipient2.status, 'archived') + with_vcr do + recipient1 = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com" + ) + assert_not_nil(recipient1) + assert_equal(recipient1.firstName, 'Tom') + assert_equal(recipient1.status, 'incomplete') + + recipient2 = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com" + ) + assert_not_nil(recipient2) + assert_equal(recipient2.firstName, 'Tom') + assert_equal(recipient2.status, 'incomplete') + + response = @client.recipient.delete([recipient1.id, recipient2.id]) + assert_true(response) + + recipient1 = @client.recipient.find(recipient1.id) + assert_equal(recipient1.status, 'archived') + + recipient2 = @client.recipient.find(recipient2.id) + assert_equal(recipient2.status, 'archived') + end end def test_find_logs - recipient = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com" - ) - assert_not_nil(recipient) - assert_equal(recipient.firstName, 'Tom') - assert_equal(recipient.status, 'incomplete') - - @client.recipient.update(recipient.id, firstName: 'John') - logs = @client.recipient.find_logs(recipient.id) - - assert_equal(logs.class, OpenStruct) - assert_boolean(true, @client.recipient.delete(recipient.id)) + with_vcr do + recipient = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com" + ) + assert_not_nil(recipient) + assert_equal(recipient.firstName, 'Tom') + assert_equal(recipient.status, 'incomplete') + + @client.recipient.update(recipient.id, firstName: 'John') + logs = @client.recipient.find_logs(recipient.id) + + assert_equal(logs.class, OpenStruct) + assert_boolean(true, @client.recipient.delete(recipient.id)) + end end def test_find_payments - recipient = @client.recipient.create( - type: 'individual', - firstName: 'Tom', - lastName: 'Jones', - email: "test.create#{uuid}@example.com" - ) - recipient_account = @client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'DE', iban: 'DE89 3704 0044 0532 0130 00') - - batch = @client.batch.create( - sourceCurrency: 'USD', description: 'Integration Test Payments', payments: [ + with_vcr do + recipient = @client.recipient.create( + type: 'individual', + firstName: 'Tom', + lastName: 'Jones', + email: "test.create#{uuid}@example.com" + ) + recipient_account = @client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'DE', iban: 'DE89 3704 0044 0532 0130 00') + + batch = @client.batch.create( + sourceCurrency: 'USD', description: 'Integration Test Payments', payments: [ { targetAmount: '10.00', targetCurrency: 'EUR', recipient: { id: recipient.id } }, { sourceAmount: '10.00', recipient: { id: recipient.id } } ] - ) - - payments = @client.recipient.find_payments(recipient.id) - assert_equal(payments.count, 2) - assert_equal(payments[0].recipient['id'], recipient.id) - assert_equal(payments[1].recipient['id'], recipient.id) - assert_equal(payments.map(&:amount), ['10.00', '10.00']) - - assert_boolean(true, @client.batch.delete(batch.id)) - assert_boolean(true, @client.recipient_account.delete(recipient.id, recipient_account.id)) - assert_boolean(true, @client.recipient.delete(recipient.id)) + ) + + payments = @client.recipient.find_payments(recipient.id) + assert_equal(payments.count, 2) + assert_equal(payments[0].recipient['id'], recipient.id) + assert_equal(payments[1].recipient['id'], recipient.id) + assert_equal(payments.map(&:amount), ['10.00', '10.00']) + + assert_boolean(true, @client.batch.delete(batch.id)) + assert_boolean(true, @client.recipient_account.delete(recipient.id, recipient_account.id)) + assert_boolean(true, @client.recipient.delete(recipient.id)) + end end end # rubocop:enable Metrics/ClassLength From 348b490e1a82d56e88791984453594c263dbd2b2 Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 8 Aug 2023 14:27:27 -0600 Subject: [PATCH 4/5] lints --- test/integration/RecipientAccountTest.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/RecipientAccountTest.rb b/test/integration/RecipientAccountTest.rb index cd0c1a7..6da67d9 100755 --- a/test/integration/RecipientAccountTest.rb +++ b/test/integration/RecipientAccountTest.rb @@ -4,6 +4,7 @@ class RecipientAccountTest < Test::Unit::TestCase include TestHelper # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/BlockLength def test_basic_crud with_vcr do recipient = @client.recipient.create( @@ -14,9 +15,9 @@ def test_basic_crud ) recipient_account = @client.recipient_account.create( recipient.id, type: 'bank-transfer', - currency: 'EUR', - country: 'DE', - iban: 'DE89 3704 0044 0532 0130 00' + currency: 'EUR', + country: 'DE', + iban: 'DE89 3704 0044 0532 0130 00' ) assert_not_nil(recipient_account) @@ -47,4 +48,5 @@ def test_basic_crud end end # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/BlockLength end From f9045541644cf0f72dd551eb476ddb74fa73ac9f Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 8 Aug 2023 18:04:39 -0600 Subject: [PATCH 5/5] lints --- test/integration/RecipientTest.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/integration/RecipientTest.rb b/test/integration/RecipientTest.rb index 3c75490..38ef673 100644 --- a/test/integration/RecipientTest.rb +++ b/test/integration/RecipientTest.rb @@ -1,5 +1,7 @@ require_relative '../test_helper' +# rubocop:disable Metrics/MethodLength +# rubocop:disable Metrics/BlockLength class RecipientTest < Test::Unit::TestCase include TestHelper @@ -150,9 +152,9 @@ def test_find_payments batch = @client.batch.create( sourceCurrency: 'USD', description: 'Integration Test Payments', payments: [ - { targetAmount: '10.00', targetCurrency: 'EUR', recipient: { id: recipient.id } }, - { sourceAmount: '10.00', recipient: { id: recipient.id } } - ] + { targetAmount: '10.00', targetCurrency: 'EUR', recipient: { id: recipient.id } }, + { sourceAmount: '10.00', recipient: { id: recipient.id } } + ] ) payments = @client.recipient.find_payments(recipient.id) @@ -168,3 +170,5 @@ def test_find_payments end end # rubocop:enable Metrics/ClassLength +# rubocop:enable Metrics/MethodLength +# rubocop:enable Metrics/BlockLength