Skip to content

Commit

Permalink
george / rm74876 / missing payment agent's phone number and url addre…
Browse files Browse the repository at this point in the history
…ss (binary-com#6337)

* fix(payment agent withdraw): fix pa's phone number and url address visibility in receipt

* style(payment agent withdraw): fix style for submit buttons

* test(payment agent withdraw): refactor tests

* test(payment agent store): fix tests
  • Loading branch information
heorhi-deriv committed Sep 14, 2022
1 parent e0e2ddd commit 55a816a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,21 @@
padding-left: 0;
}
}
.cashier__form-submit {
row-gap: 1rem;
}
}

& .cashier__form-submit {
text-align: center;
display: flex;
justify-content: center;
flex-flow: row;
align-items: center;
column-gap: 0.8rem;
margin: 2.4rem 0 3.2rem;

&-button {
margin: 0;
max-width: 18rem;

&:first-child {
margin-right: 0.4rem;
}
&:last-child {
margin-left: 0.4rem;
}
}
}
&__transferred-contact {
Expand Down
40 changes: 20 additions & 20 deletions packages/cashier/src/stores/__tests__/payment-agent-store.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ describe('PaymentAgentStore', () => {
max_withdrawal: '2000',
min_withdrawal: '10',
email: 'pa@example.com',
telephone: '+12345678',
url: 'http://www.pa.com',
phone_numbers: [{ phone_number: '+12345678' }],
urls: [{ url: 'http://www.pa.com' }],
supported_payment_methods: [{ payment_method: 'Visa' }],
},
{
Expand All @@ -23,26 +23,26 @@ describe('PaymentAgentStore', () => {
max_withdrawal: '2000',
min_withdrawal: '10',
email: 'pa@example.com',
telephone: '+12345678',
url: 'http://www.pa.com',
phone_numbers: [{ phone_number: '+12345678' }],
urls: [{ url: 'http://www.pa.com' }],
supported_payment_methods: [{ payment_method: 'Visa' }, { payment_method: 'Mastercard' }],
},
],
};
const mocked_payment_agents = [
{
email: 'pa@example.com',
phones: '+12345678',
phones: [{ phone_number: '+12345678' }],
name: 'Payment Agent of CR90000000',
supported_banks: [{ payment_method: 'Visa' }],
urls: 'http://www.pa.com',
urls: [{ url: 'http://www.pa.com' }],
},
{
email: 'pa@example.com',
phones: '+12345678',
phones: [{ phone_number: '+12345678' }],
name: 'Payment Agent of CR90000002',
supported_banks: [{ payment_method: 'Visa' }, { payment_method: 'Mastercard' }],
urls: 'http://www.pa.com',
urls: [{ url: 'http://www.pa.com' }],
},
];
const mocked_withdrawal_request = {
Expand Down Expand Up @@ -162,10 +162,10 @@ describe('PaymentAgentStore', () => {
expect.arrayContaining([
{
email: 'pa@example.com',
phones: '+12345678',
phones: [{ phone_number: '+12345678' }],
name: 'Payment Agent of CR90000000',
supported_banks: [{ payment_method: 'Visa' }],
urls: 'http://www.pa.com',
urls: [{ url: 'http://www.pa.com' }],
},
])
);
Expand All @@ -191,10 +191,10 @@ describe('PaymentAgentStore', () => {
expect.arrayContaining([
{
email: 'pa@example.com',
phones: '+12345678',
phones: [{ phone_number: '+12345678' }],
name: 'Payment Agent of CR90000002',
supported_banks: [{ payment_method: 'Visa' }, { payment_method: 'Mastercard' }],
urls: 'http://www.pa.com',
urls: [{ url: 'http://www.pa.com' }],
},
])
);
Expand Down Expand Up @@ -268,8 +268,8 @@ describe('PaymentAgentStore', () => {
max_withdrawal: '2000',
min_withdrawal: '10',
email: 'pa@example.com',
telephone: '+12345678',
url: 'http://www.pa.com',
phone_numbers: [{ phone_number: '+12345678' }],
urls: [{ url: 'http://www.pa.com' }],
};

payment_agent_store.addPaymentAgent(payment_agent);
Expand All @@ -281,8 +281,8 @@ describe('PaymentAgentStore', () => {
max_withdrawal: '2000',
min_withdrawal: '10',
email: 'pa@example.com',
phone: '+12345678',
url: 'http://www.pa.com',
phone: [{ phone_number: '+12345678' }],
url: [{ url: 'http://www.pa.com' }],
},
])
);
Expand All @@ -302,8 +302,8 @@ describe('PaymentAgentStore', () => {
max_withdrawal: '2000',
min_withdrawal: '10',
email: 'pa@example.com',
phone: '+12345678',
url: 'http://www.pa.com',
phone: [{ phone_number: '+12345678' }],
url: [{ url: 'http://www.pa.com' }],
},
])
);
Expand Down Expand Up @@ -384,8 +384,8 @@ describe('PaymentAgentStore', () => {
payment_agent_email: 'pa@example.com',
payment_agent_id: 'CR90000000',
payment_agent_name: 'Payment Agent of CR90000000',
payment_agent_phone: '+12345678',
payment_agent_url: 'http://www.pa.com',
payment_agent_phone: [{ phone_number: '+12345678' }],
payment_agent_url: [{ url: 'http://www.pa.com' }],
});
expect(payment_agent_store.is_withdraw_successful).toBeTruthy();
expect(payment_agent_store.is_try_withdraw_successful).toBeFalsy();
Expand Down
4 changes: 2 additions & 2 deletions packages/cashier/src/stores/payment-agent-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ export default class PaymentAgentStore {
max_withdrawal: payment_agent.max_withdrawal,
min_withdrawal: payment_agent.min_withdrawal,
email: payment_agent.email,
phone: payment_agent.telephone,
url: payment_agent.url,
phone: payment_agent.phone_numbers,
url: payment_agent.urls,
});
}

Expand Down

0 comments on commit 55a816a

Please sign in to comment.