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

[BUG] starting a transaction of paymentMethod.type: "afterpay_default" is not possible due to a mismatch between the required payload and the PaymentRequest type #1379

Open
pvaneveld opened this issue Aug 1, 2024 · 0 comments
Labels
bug Something isn't working needs response

Comments

@pvaneveld
Copy link

pvaneveld commented Aug 1, 2024

Describe the bug
starting a transaction of paymentMethod.type: "afterpay_default" is not possible due to a mismatch between the required payload - which should contain shopperName.gender - and the PaymentRequest type - which does not contain shopperName.gender

To Reproduce

  • start a transaction (PaymentsApi.payments) of paymentMethod.type: "afterpay_default" using "@adyen/api-library": "18.1.0",
  • use a payload compatible with the PaymentRequestType, containing all the fields required for this payment method type. See the payload below as a reference
{
      "amount": {
        "currency": "EUR",
        "value": 798
      },
      "shopperIP": "someip",
      "merchantAccount": "account",
      "merchantOrderReference": "some-reference",
      "paymentMethod": {
        "type": "afterpay_default"
      },
      "reference": "reference",
      "returnUrl": "https://returnurl.nl/url",
      "storePaymentMethod": false,
      "lineItems": [
        {
          "sku": "someSKU",
          "description": "socks",
          "quantity": 1,
          "taxPercentage": 0.21,
          "amountIncludingTax": 299,
          "amountExcludingTax": 247,
          "taxAmount": 52,
          "productUrl": "https://www.image.nl/image.jpg"
        }
      ],
      "shopperLocale": "nl_NL",
      "shopperName": {
        "firstName": "John",
        "lastName": "Doe"
      },
      "billingAddress": {
        "country": "NL",
        "city": "Amsterdam",
        "street": "Fazantenweg",
        "houseNumberOrName": "1",
        "postalCode": "1021 HM"
      },
      "deliveryAddress": {
        "country": "NL",
        "city": "Amsterdam",
        "street": "Fazantenweg",
        "houseNumberOrName": "1",
        "postalCode": "1021 HM"
      },
      "telephoneNumber": "+31652336011",
      "shopperEmail": "john@doe.nl",
      "countryCode": "NL",
      "shopperReference": "somereference",
      "deviceFingerprint": "fingerprint",
      "dateOfBirth": "1978-05-04T22:00:00.000Z"
}
  • the request will result in the following error
HTTP Exception: 422. : Required field 'shopperName.gender' is not provided."
  • even when gender is included in the shoperName object, e.g. gender: "MALE", the same issue occurs.
  • submitting a similar payload via curl actually creates a transaction, indicating a problem in the library

Expected behavior

  • a payload that matches the PaymentRequest type does not result in errors about fields that are not present in this type.

Desktop (please complete the following information):

  • OS: [Mac]
  • Node Version: [20.9.0]
  • PNPM Version: [9.4.0]
@pvaneveld pvaneveld added the bug Something isn't working label Aug 1, 2024
@pvaneveld pvaneveld changed the title [BUG] [BUG] starting a transaction of paymentMethod.type: "afterpay_default" is not possible due to a mismatch between the required payload Aug 2, 2024
@pvaneveld pvaneveld changed the title [BUG] starting a transaction of paymentMethod.type: "afterpay_default" is not possible due to a mismatch between the required payload [BUG] starting a transaction of paymentMethod.type: "afterpay_default" is not possible due to a mismatch between the required payload and the PaymentRequest type Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs response
Projects
None yet
Development

No branches or pull requests

1 participant