disable button until items are in cart
This commit is contained in:
parent
88dd66188e
commit
9645a6b81f
@ -19,8 +19,8 @@ export const checkout = functions.https.onRequest((request, response) => {
|
||||
intent: 'sale',
|
||||
payer: {payment_method: 'paypal'},
|
||||
redirect_urls: {
|
||||
return_url: 'https://fhsons.zakscode.com/success',
|
||||
cancel_url: 'https://fhsons.zakscode.com/cart'
|
||||
return_url: 'https://fhsons.zakscode.com/cart/success',
|
||||
cancel_url: 'https://fhsons.zakscode.com/cart/cancelled'
|
||||
},
|
||||
transactions: [
|
||||
{
|
||||
@ -52,6 +52,8 @@ export const checkout = functions.https.onRequest((request, response) => {
|
||||
return acc + row.price * row.quantity;
|
||||
}, 0);
|
||||
|
||||
console.info(req);
|
||||
|
||||
// Send request to PayPal
|
||||
let create = new Promise((res, rej) => {
|
||||
paypal.payment.create(req, (error, payment) => {
|
||||
|
@ -33,7 +33,7 @@
|
||||
<td class="pl-3">{{total() | currency}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button mat-raised-button class="float-right mt-3" color="primary" (click)="checkout()">Checkout</button>
|
||||
<button mat-raised-button class="float-right mt-3" color="primary" (click)="checkout()" [disabled]="total() <= 0">Checkout</button>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user