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

Remove gift card if its transaction errors #55

Open
pelletencate opened this issue Nov 13, 2019 · 0 comments
Open

Remove gift card if its transaction errors #55

pelletencate opened this issue Nov 13, 2019 · 0 comments
Labels

Comments

@pelletencate
Copy link
Collaborator

    // Creates a transaction with a payment method and an amount
    //
    // @param [PaymentMethod] paymentMethod the payment method to charge
    // @param [Number] amount the amount to charge to the payment method
    // @return [Transaction] the built transaction representing the charge
    charge(paymentMethod, amount) {
      if (
        this.transactions()
          .target()
          .detect(t => t.paymentMethod() == paymentMethod)
      )
        return

      return this.transactions().build({
        amount: amount,
        paymentMethod: paymentMethod
      })
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant