Commit 67cdf6a1 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(wip): Payments

1 merge request!387WIP: Boost Campaigns (&24)
Pipeline #69480064 passed with stages
in 29 minutes and 14 seconds
......@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Web3WalletService } from '../../blockchain/web3-wallet.service';
import { OverlayModalService } from '../../../services/ux/overlay-modal';
import { GetMetamaskComponent } from '../../blockchain/metamask/getmetamask.component';
import { Campaign, CampaignPayment } from './campaigns.type';
import { Campaign, CampaignBudgetType, CampaignPayment } from './campaigns.type';
import { TokenContractService } from '../../blockchain/contracts/token-contract.service';
@Injectable()
......
......@@ -85,7 +85,7 @@ export class CampaignsService {
const data = { ...campaign };
if (payment) {
data['nonce'] = payment;
data['payment'] = payment;
}
return (await this.client.post(`api/v2/boost/campaigns`, data) as any).campaign;
......@@ -103,7 +103,7 @@ export class CampaignsService {
const data = { ...campaign };
if (payment) {
data['nonce'] = payment;
data['payment'] = payment;
}
return (await this.client.post(`api/v2/boost/campaigns/${campaign.urn}`, data) as any).campaign;
......
export type CampaignType = 'newsfeed' | 'content' | 'banner' | 'video';
export type CampaignBudgetType = 'tokens';
export type CampaignDeliveryStatus = 'pending' | 'created' | 'failed' | 'approved' | 'rejected' | 'revoked' | 'completed';
export type Campaign = {
......@@ -11,11 +12,12 @@ export type Campaign = {
start: number,
end: number,
budget: number,
budget_type: string,
budget_type: CampaignBudgetType,
// Engine
urn?: string,
checksum?: string,
payments?: any[],
// Client-side
client_guid?: string,
......
......@@ -83,9 +83,7 @@ export class BoostCampaignsCreatorComponent implements OnInit, OnDestroy {
this.detectChanges();
try {
const campaign = await this.service.get(this.urn);
this.campaign = campaign;
this.campaign = await this.service.get(this.urn);
} catch (e) {
console.error('BoostCampaignsCreatorComponent', e);
this.currentError = (e && e.message) || 'Unknown error. Check your browser console.';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment