File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
components/settings/billing-page Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change 4242 {{ /if }}
4343 </div >
4444 <div class =" flex items-center justify-end" >
45- {{ #if (and charge.invoiceId charge.statusIsSucceeded )}}
45+ {{ #if (and charge.receiptUrl charge.statusIsSucceeded )}}
4646 <a
47- href ={{ charge.invoiceDownloadUrl }}
47+ href ={{ charge.receiptUrl }}
4848 target =" _blank"
4949 class =" text-teal-500 dark:text-teal-400 hover:text-teal-600 dark:hover:text-teal-300 font-semibold text-sm"
5050 data-test-download-invoice-link
5151 rel =" noopener noreferrer"
5252 >
53- Download Invoice
53+ View Invoice
5454 </a >
5555 {{ else if charge.statusIsFailed}}
5656 <span class =" text-gray-600 dark:text-gray-300 text-sm" >Payment failed</span >
Original file line number Diff line number Diff line change 11import Model , { attr , belongsTo } from '@ember-data/model' ;
2- import config from 'codecrafters-frontend/config/environment' ;
32import type UserModel from 'codecrafters-frontend/models/user' ;
43import { equal } from '@ember/object/computed' ; // eslint-disable-line ember/no-computed-properties-in-native-classes
54
@@ -10,7 +9,7 @@ export default class Charge extends Model {
109 @attr ( 'number' ) declare amountRefunded : number ;
1110 @attr ( 'date' ) declare createdAt : Date ;
1211 @attr ( 'string' ) declare currency : string ;
13- @attr ( 'string' ) declare invoiceId : string ;
12+ @attr ( 'string' ) declare receiptUrl : string ;
1413 @attr ( 'string' ) declare status : 'succeeded' | 'pending' | 'failed' ;
1514
1615 @belongsTo ( 'user' , { async : false , inverse : null } ) declare user : UserModel ;
@@ -23,14 +22,6 @@ export default class Charge extends Model {
2322 return Charge . buildDisplayString ( this . amount , this . currency ) ;
2423 }
2524
26- get invoiceDownloadUrl ( ) {
27- if ( ! this . invoiceId ) {
28- return null ;
29- }
30-
31- return `${ config . x . backendUrl } /invoices/${ this . invoiceId } /download` ;
32- }
33-
3425 get isFullyRefunded ( ) {
3526 return this . amountRefunded === this . amount ;
3627 }
You can’t perform that action at this time.
0 commit comments