Skip to content

Error when trying to make a payment #52

@angieherrera

Description

@angieherrera

Hi!

I have successfully installed this plugin on a Craft 4.5.5 / Commerce 4.3.0 set up. However, whenever I try to make a payment, I get the following error:

TypeError
webdnalcommercelbraintree|responses|PaymentResponse:_construct(): Argument #1 (Sdata) must be of type array, Braintree|Result Error given, called in /[my]/[path]/[to]/vendor/webdna/commerce-braintree/src/gateways/Gateway.php on line 516

Full screenshot:
231014-1

The code to render the form looks like this:

<form id="paymentForm" method="post" action="">
   {{ csrfInput() }}
   {{ actionInput('commerce/payments/pay') }}
   {{ redirectInput('/store/checkout/order?number={number}') }}
   {{ hiddenInput('cancelUrl', '/store/checkout/payment'|hash) }}
   {{ hiddenInput('orderEmail', cart.email) }}

   {% namespace cart.gateway.handle|commercePaymentFormNamespace %}
      {{ cart.gateway.getPaymentFormHtml({})|raw }}
   {% endnamespace %}

   <button class="btn secondary">Pay Now</button>
</form>

That renders like so (note missing CVV field):
CleanShot 2023-10-16 at 09 32 25

I'm not sure what, if anything, needs to be adjusted in my code, or if this is an issue with the plugin.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions