Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response property was renamed from XXwallet to XXwalletId #25

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions components/MarketplaceInfoFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</v-col>
<v-col>
<v-text-field
v-model="marketplaceInfo.merchantWallet"
:value="value.merchantWallet"
v-model="marketplaceInfo.merchantWalletId"
:value="value.merchantWalletId"
label="Merchant Wallet"
@input="updateInfo"
/>
Expand All @@ -29,8 +29,8 @@
<v-row align="center">
<v-col>
<v-text-field
v-model="marketplaceInfo.endUserWallet"
:value="value.endUserWallet"
v-model="marketplaceInfo.endUserWalletId"
:value="value.endUserWalletId"
label="End User wallet"
@input="updateInfo"
/>
Expand All @@ -57,7 +57,7 @@ interface Merchant {
id: string
marketplaceId: string
merchantId: string
merchantWallet: string
merchantWalletId: string
createDate: number
}

Expand All @@ -68,9 +68,9 @@ export default class MarketplaceInfoFieldsClass extends Vue {
merchants: Merchant[] = []
merchantsLoading: boolean = true
marketplaceInfo: MarketplaceInfo = {
endUserWallet: '',
endUserWalletId: '',
merchantId: '',
merchantWallet: ''
merchantWalletId: ''
}

async mounted() {
Expand All @@ -91,34 +91,34 @@ export default class MarketplaceInfoFieldsClass extends Vue {

get merchantItems() {
return this.merchants.map((merchant: Merchant) => {
return merchant.merchantWallet
return merchant.merchantWalletId
})
}

selectMerchant(value: string) {
const merchant: Merchant | undefined = this.merchants.find((merchant) => {
return merchant.merchantWallet === value
return merchant.merchantWalletId === value
})

if (merchant) {
this.marketplaceInfo.merchantId = merchant.merchantId
this.marketplaceInfo.merchantWallet = merchant.merchantWallet
this.marketplaceInfo.merchantWalletId = merchant.merchantWalletId
this.updateInfo()
}
}

@Watch('value', { immediate: true, deep: true })
onValueChange(value: MarketplaceInfo) {
this.marketplaceInfo.endUserWallet = value.endUserWallet
this.marketplaceInfo.endUserWalletId = value.endUserWalletId
this.marketplaceInfo.merchantId = value.merchantId
this.marketplaceInfo.merchantWallet = value.merchantWallet
this.marketplaceInfo.merchantWalletId = value.merchantWalletId
}

updateInfo() {
this.$emit('input', {
merchantId: this.marketplaceInfo.merchantId,
merchantWallet: this.marketplaceInfo.merchantWallet,
endUserWallet: this.marketplaceInfo.endUserWallet
merchantWalletId: this.marketplaceInfo.merchantWalletId,
endUserWalletId: this.marketplaceInfo.endUserWalletId
})
}

Expand All @@ -128,7 +128,7 @@ export default class MarketplaceInfoFieldsClass extends Vue {
try {
const res = await this.$marketplaceApi.createWallet()
if (res.walletId) {
this.marketplaceInfo.endUserWallet = res.walletId
this.marketplaceInfo.endUserWalletId = res.walletId
this.updateInfo()
}
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions lib/marketplaceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ interface MetaData {

export interface MarketplaceInfo {
merchantId: string
merchantWallet: string
endUserWallet: string
merchantWalletId: string
endUserWalletId: string
}

export interface CreateMarketplacePaymentPayload {
Expand Down
4 changes: 2 additions & 2 deletions pages/debug/marketplace/payments/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ import MarketplaceInfoFields from '@/components/MarketplaceInfoFields.vue'
export default class CreatePaymentClass extends Vue {
isMarketplace!: boolean
marketplaceInfo: MarketplaceInfo = {
endUserWallet: '',
endUserWalletId: '',
merchantId: '',
merchantWallet: ''
merchantWalletId: ''
}
cvvRequired = true
formData = {
Expand Down
4 changes: 2 additions & 2 deletions pages/flow/charge/existing-card/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ interface Card {
export default class CardFlowClass extends Vue {
isMarketplace!: boolean
marketplaceInfo: MarketplaceInfo = {
endUserWallet: '',
endUserWalletId: '',
merchantId: '',
merchantWallet: ''
merchantWalletId: ''
}
cards!: Card[]
cardItems: string[] = []
Expand Down
4 changes: 2 additions & 2 deletions pages/flow/charge/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ export default class ChargeFlowClass extends Vue {
isSandbox: Boolean = !getLive()
isMarketplace!: boolean
marketplaceInfo: MarketplaceInfo = {
endUserWallet: '',
endUserWalletId: '',
merchantId: '',
merchantWallet: ''
merchantWalletId: ''
}

prefillForm(index: number) {
Expand Down