globalpayments / php-sdk

GNU General Public License v2.0
49 stars 66 forks source link

Added currency to Transaction refund method #40

Open silasmontgomery opened 5 years ago

silasmontgomery commented 5 years ago
  1. Added $currency param to method
  2. Added withCurrency to the builder

Prior to this change was receiving error 'currency cannot be null for this transaction type' (heartland/portico).

silasmontgomery commented 5 years ago

Well, I definitely didn't check out the previous pull requests (#34) prior to making this one. This method of refunding is shown on "Full SDK Documentation > Credit Card" on Heartlands developer site (https://developer.heartlandpaymentsystems.com/Documentation/credit-card-payments) and is useful because you can refund from a transaction ID only. When using tokenization (not saving card data) I'm unsure of how to use $card->refund.

hpsTony commented 5 years ago

Hi Silas,

It's usually a good idea to rely on the refund-via-transactionID method exclusively, but if you need to bake in blind refunds here's a snippet you can use:

$card = new CreditCardData(); $card->token = "e9T4kb08g4dObHkZOwqs4446"; // Multi-use Token

$response = $card->refund(12)

->withCurrency("USD") ->execute();

On Fri, Nov 8, 2019 at 10:26 AM Silas Montgomery notifications@github.com wrote:

Well, I definitely didn't check out the previous pull requests (#34 https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_globalpayments_php-2Dsdk_pull_34&d=DwMCaQ&c=f7K5vTjsy0ldRUVHx_C48Q&r=_27fn_8_IhzJN4MY8P68scjUx2U8z-w6F9lyRqIndSk&m=RHzVtL_MClNetywGT25YdLt8g-jIcRY5L-cCUi9qG1c&s=34uO47ylruvbkxGDw07S3kIBSm-ttMntbkoO0ye_zJk&e=) prior to making this one. This method of refunding is shown on "Full SDK Documentation > Credit Card" on Heartlands developer site ( https://developer.heartlandpaymentsystems.com/Documentation/credit-card-payments) and is useful because you can refund from a transaction ID only. When using tokenization (not saving card data) I'm unsure of how to use $card->refund.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_globalpayments_php-2Dsdk_pull_40-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAMSYO2D5AXRGB4SUJ33RAA3QSWAIVA5CNFSM4JKYXXGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDSODFA-23issuecomment-2D551870868&d=DwMCaQ&c=f7K5vTjsy0ldRUVHx_C48Q&r=_27fn_8_IhzJN4MY8P68scjUx2U8z-w6F9lyRqIndSk&m=RHzVtL_MClNetywGT25YdLt8g-jIcRY5L-cCUi9qG1c&s=twPm-OGauIQ7LJ5r22hbPdGG6HQoNBUZrVvMLKafyyk&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMSYO2CM74DCVXVYBGQWY5TQSWAIVANCNFSM4JKYXXGA&d=DwMCaQ&c=f7K5vTjsy0ldRUVHx_C48Q&r=_27fn_8_IhzJN4MY8P68scjUx2U8z-w6F9lyRqIndSk&m=RHzVtL_MClNetywGT25YdLt8g-jIcRY5L-cCUi9qG1c&s=_SG80E8rv0dOCwaY8-ixP_jISwZNw4G6rECzDCEM1y0&e= .

--

Tony Smedal

Software Developer Heartland (866) 802-9753

A Global Payments Company

silasmontgomery commented 5 years ago

Thanks, that will work when requesting/saving a multi-use token but in the case of one-time charges it would seem the transaction ID would be the only way to refund without having the actual card data, correct?