Swedbank-SPP / swedbank-payment-portal

Swedbank Payment Portal API library for PHP
Other
36 stars 21 forks source link

Unknown value '571' was given for enum SwedbankPaymentPortal\SharedEntity\Type\PurchaseStatus #10

Closed jsakars closed 7 years ago

jsakars commented 7 years ago

Unknown value '571' was given for enum SwedbankPaymentPortal\SharedEntity\Type\PurchaseStatus RuntimeException is being thrown when calling handlePendingTransaction on PayPalService class. This leads to cURL call not being made.

Here is the GetExpressCheckoutDetailsResponse XML:

<?xml version="1.0" encoding="UTF-8"?>
<Response version="2">
  <PayPalTxn>
    <ack>Success</ack>
    <addressnormalizationstatus>None</addressnormalizationstatus>
    <amt>24.20</amt>
    <billing_agreement_accepted>0</billing_agreement_accepted>
    <build>38544305</build>
    <checkoutstatus>PaymentActionNotInitiated</checkoutstatus>
    <correlationid>a357f8827cc65</correlationid>
    <currencycode>EUR</currencycode>
    <custom>****</custom>
    <desc>*********</desc>
    <errorcode>0</errorcode>
    <handlingamt>0.00</handlingamt>
    <insuranceamt>0.00</insuranceamt>
    <insuranceoptionoffered>false</insuranceoptionoffered>
    <invnum>****</invnum>
    <shipdiscamt>0.00</shipdiscamt>
    <shippingamt>0.00</shippingamt>
    <taxamt>0.00</taxamt>
    <timestamp>2017-09-05T10:45:48Z</timestamp>
    <token>EC-92X45596YN1435128</token>
    <version>124.0</version>
  </PayPalTxn>
  <datacash_reference>3300900018396017</datacash_reference>
  <information>User has not yet accessed PayPal account. Please re-submit transaction.</information>
  <merchantreference>****_460_req</merchantreference>
  <mode>LIVE</mode>
  <reason>PayPal: Customer login pending</reason>
  <status>571</status>
  <time>1504608347</time>
</Response>
Swedbank-SPP commented 7 years ago

Hi, thanks. We've fixed this issue in v0.8.20 version.

jsakars commented 7 years ago

@Swedbank-SPP it does not seem to be fixed to me:

image

Swedbank-SPP commented 7 years ago

Hello, could you show a steps how do you initiate payment and what steps you do after success/return url, and exactly where this error occurs? During initPayment or somewhere else?

jsakars commented 7 years ago

Sure. These steps are the ones documented on SPP integration guide.

  1. Initialize the payment

    $response = $this->spp->getPayPalGateway()->initPayment(...);
    return $response->getCustomerRedirectUrl($live);

    User gets redirected to PayPal

  2. Do nothing but click Cancel and return to ... link paypal

User gets redirected to $cancelUrl

  1. Call handlePendingTransaction method
    return $this->spp->getPayPalGateway()->handlePendingTransaction($merchantReference);

    This is were Exception is thrown and therefore callback is never triggered.

exception

Swedbank-SPP commented 7 years ago

Thanks for detailed explanation. Please try now with updated v0.8.21 version.

jsakars commented 7 years ago

Seems we are going into the loop :)

image

Callback is still not triggered but this time it comes from try-catch which is ignoring the exception.

I wonder if You have actually tested this Yourself?

Swedbank-SPP commented 7 years ago

Please try v0.8.24 version.

jsakars commented 7 years ago

image

I don't want to be rude but this is getting frustrating - please test the code Yourself before releasing it!

Swedbank-SPP commented 7 years ago

Hi. Fixed this in v0.8.25

jsakars commented 7 years ago

Finally it works 😌