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

isSuccessful returns false for partial refund #5

Open
hillelcoren opened this issue Feb 9, 2017 · 4 comments
Open

isSuccessful returns false for partial refund #5

hillelcoren opened this issue Feb 9, 2017 · 4 comments

Comments

@hillelcoren
Copy link
Contributor

The driver currently checks that the state is equal to refunded to determine if the refund succeeded.

However, this fails when submitting a partial refund as the payment state is still captured.

  #request: RefundRequest {#1130 ▼
    #liveEndpoint: "https://wepayapi.com/v2/"
    #testEndpoint: "https://stage.wepayapi.com/v2/"
    #parameters: ParameterBag {#1127 ▼
      #parameters: array:8 [▼
        "accountId" => XXXXXXX
        "accessToken" => "STAGE_XXXXXXX"
        "type" => "goods"
        "testMode" => true
        "feePayer" => "payee"
        "amount" => 5.0
        "transactionReference" => "XXXXXXX"
        "refundReason" => "Refund issued by merchant."
      ]
    }
    #httpClient: Client {#1149 ▶}
    #httpRequest: Request {#1139 ▶}
    #response: null
  }
  #data: array:2 [▼
    "checkout_id" => XXXXXXXX
    "state" => "captured"
  ]
}
@w3guy
Copy link
Owner

w3guy commented Feb 19, 2017

What do you suggest as the right way to do this?

@hillelcoren
Copy link
Contributor Author

One (not so good) solution may be consider 'captured' as a valid state when checking if the refund succeeded.

@w3guy
Copy link
Owner

w3guy commented Feb 19, 2017

I could use 'captured' as a valid state but only if it is a partial refund hence this question. Is there a way i can determine from the response if it is a partial refund?

@hillelcoren
Copy link
Contributor Author

Not that I'm aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants