Skip to content

Commit

Permalink
change path to sell
Browse files Browse the repository at this point in the history
  • Loading branch information
sumxu96 committed Oct 2, 2024
1 parent d6d2eee commit d26932c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/offramp/generateOffRampURL.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('generateOffRampURL', () => {
);

expect(url.origin).toEqual('https://pay.coinbase.com');
expect(url.pathname).toEqual('/v3/offramp/input');
expect(url.pathname).toEqual('/v3/sell/input');
expect(url.searchParams.get('appId')).toEqual('test');
});

Expand Down Expand Up @@ -70,7 +70,7 @@ describe('generateOffRampURL', () => {
);

expect(url.origin).toEqual('http://localhost:3000');
expect(url.pathname).toEqual('/v3/offramp/input');
expect(url.pathname).toEqual('/v3/sell/input');
expect(url.searchParams.get('appId')).toEqual('test');
});

Expand Down
2 changes: 1 addition & 1 deletion src/offramp/generateOffRampURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const generateOffRampURL = ({
...props
}: GenerateOffRampURLOptions): string => {
const url = new URL(host);
url.pathname = '/v3/offramp/input';
url.pathname = '/v3/sell/input';

(Object.keys(props) as (keyof typeof props)[]).forEach((key) => {
const value = props[key];
Expand Down
2 changes: 1 addition & 1 deletion src/utils/CBPayInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type CBPayInstanceConstructorArguments = {
const widgetRoutes: Record<WidgetType, string> = {
buy: '/buy',
checkout: '/checkout',
offramp: '/v3/offramp',
offramp: '/v3/sell',
};

export interface CBPayInstanceType {
Expand Down
12 changes: 6 additions & 6 deletions src/utils/CoinbasePixel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ describe('CoinbasePixel', () => {
instance.openExperience({
...defaultOpenOptions,
experienceLoggedIn: 'new_tab',
path: '/v3/offramp',
path: '/v3/sell',
});

expect(window.chrome.tabs.create).toHaveBeenCalledWith({
url: 'https://pay.coinbase.com/v3/offramp/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test',
url: 'https://pay.coinbase.com/v3/sell/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test',
});
});

Expand All @@ -146,11 +146,11 @@ describe('CoinbasePixel', () => {
instance.openExperience({
...defaultOpenOptions,
experienceLoggedIn: 'popup',
path: '/v3/offramp',
path: '/v3/sell',
});

expect(window.open).toHaveBeenCalledWith(
'https://pay.coinbase.com/v3/offramp/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test',
'https://pay.coinbase.com/v3/sell/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test',
'Coinbase',
'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, height=730,width=460',
);
Expand All @@ -174,11 +174,11 @@ describe('CoinbasePixel', () => {
instance.openExperience({
...defaultOpenOptions,
experienceLoggedIn: 'new_tab',
path: '/v3/offramp',
path: '/v3/sell',
});

expect(window.open).toHaveBeenCalledWith(
'https://pay.coinbase.com/v3/offramp/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test',
'https://pay.coinbase.com/v3/sell/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test',
'Coinbase',
undefined,
);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/CoinbasePixel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class CoinbasePixel {
const experience = experienceLoggedOut || experienceLoggedIn;

let url = '';
if (options.path === '/v3/offramp') {
if (options.path === '/v3/sell') {
url = generateOffRampURL({
appId: this.appId,
host: this.host,
Expand Down

0 comments on commit d26932c

Please sign in to comment.