From bdf3a022d53753a43bde4a2973049edb019014d4 Mon Sep 17 00:00:00 2001 From: Yitian Xue Date: Wed, 4 Dec 2024 11:30:35 -0500 Subject: [PATCH] [BANK-3352] support BRL fx (#377) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Screenshot 2024-12-02 at 3 57 09 PM Screenshot 2024-12-02 at 3 59 32 PM --- layouts/default.vue | 4 + lib/mocksApi.ts | 17 ++++ .../debug/businessAccount/payouts/create.vue | 10 +- pages/debug/payments/mocks/pix.vue | 99 +++++++++++++++++++ plugins/mocksApi.ts | 2 + 5 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 pages/debug/payments/mocks/pix.vue diff --git a/layouts/default.vue b/layouts/default.vue index f0da18a5..03446c69 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -314,6 +314,10 @@ export default class DefaultLayoutsClass extends Vue { title: 'POST /mocks/payments/wire', to: '/debug/payments/mocks/wire', }, + { + title: 'POST /mocks/payments/pix', + to: '/debug/payments/mocks/pix', + }, { title: 'POST /businessAccount/banks/cbit', to: '/debug/businessAccount/cbitAccounts/create', diff --git a/lib/mocksApi.ts b/lib/mocksApi.ts index 3c38d884..3de612f1 100644 --- a/lib/mocksApi.ts +++ b/lib/mocksApi.ts @@ -16,6 +16,14 @@ export interface CreateMockPushPaymentPayload { rail: string } +export interface CreateMockPixPushPaymentPayload { + trackingRef: string + accountNumber: string + amount: { + amount: string + } +} + export interface CreateMockChargebackPayload { paymentId: string } @@ -59,6 +67,14 @@ function createMockWirePayment(payload: CreateMockPushPaymentPayload) { return instance.post(url, payload) } +/** + * Trigger pix payment + */ +function createMockPixPyament(payload: CreateMockPixPushPaymentPayload) { + const url = '/v1/mocks/payments/pix' + return instance.post(url, payload) +} + /** * Create a mock chargeback * @param {*} payload @@ -72,4 +88,5 @@ export default { getInstance, createMockWirePayment, createMockChargeback, + createMockPixPyament, } diff --git a/pages/debug/businessAccount/payouts/create.vue b/pages/debug/businessAccount/payouts/create.vue index 23efc81f..2dbed647 100644 --- a/pages/debug/businessAccount/payouts/create.vue +++ b/pages/debug/businessAccount/payouts/create.vue @@ -88,14 +88,16 @@ export default class CreatePayoutClass extends Vue { } required = [(v: string) => !!v || 'Field is required'] - destinationType = ['wire', 'cbit', 'xpay', 'rtp', 'rtgs', 'sepa'] + destinationType = ['wire', 'cbit', 'xpay', 'rtp', 'rtgs', 'sepa', 'pix'] wireCurrencyTypes = ['USD', 'EUR'] cbitCurrencyTypes = ['USD'] xpayCurrencyTypes = ['USD'] rtpCurrencyTypes = ['USD'] rtgsCurrencyTypes = ['USD', 'EUR'] sepaCurrencyTypes = ['EUR'] + pixCurrencyTypes = ['USD'] fxCurrencyTypes = ['', 'SGD', 'MXN'] + pixFxCurrencyTypes = ['BRL'] currencyTypes = new Map([ ['wire', this.wireCurrencyTypes], ['cbit', this.cbitCurrencyTypes], @@ -103,9 +105,13 @@ export default class CreatePayoutClass extends Vue { ['rtp', this.rtpCurrencyTypes], ['rtgs', this.rtgsCurrencyTypes], ['sepa', this.sepaCurrencyTypes], + ['pix', this.pixCurrencyTypes], ]) - toCurrencyTypes = new Map([['USDwire', this.fxCurrencyTypes]]) + toCurrencyTypes = new Map([ + ['USDwire', this.fxCurrencyTypes], + ['USDpix', this.pixFxCurrencyTypes], + ]) error = {} loading = false diff --git a/pages/debug/payments/mocks/pix.vue b/pages/debug/payments/mocks/pix.vue new file mode 100644 index 00000000..ce7d7ccc --- /dev/null +++ b/pages/debug/payments/mocks/pix.vue @@ -0,0 +1,99 @@ + + + diff --git a/plugins/mocksApi.ts b/plugins/mocksApi.ts index 5fe6d152..7a362641 100644 --- a/plugins/mocksApi.ts +++ b/plugins/mocksApi.ts @@ -1,5 +1,6 @@ import mocksApi, { CreateMockChargebackPayload, + CreateMockPixPushPaymentPayload, CreateMockPushPaymentPayload, } from '@/lib/mocksApi' @@ -9,6 +10,7 @@ declare module 'vue/types/vue' { getInstance: any createMockChargeback: (payload: CreateMockChargebackPayload) => any createMockWirePayment: (payload: CreateMockPushPaymentPayload) => any + createMockPixPyament: (payload: CreateMockPixPushPaymentPayload) => any } } }