4

BACKGROUND

I am writing a payment gateway plugin for NopCommerce 2.80. This is my first time writing code for a payment gateway. I am almost there, but having a few problems.

PROBLEMS

  • Firstly, in the ProcessPayment method, I need to return a ProcessPaymentResult, which has the following properties (Can someone please explain to me the difference between these?):

AuthorizationTransactionCode

AuthorizationTransactionId

AuthorizationTransactionResult

CaptureTransactionId

CaptureTransactionResult

The gateway I need to implement (Tranzila) has the following fields returned:

ConfirmationCode

AuthNumber

RefNumber

TempRef

and a few others which probably don't apply in this scenario. I don't know how to map these to what Nop is expecting...

  • Secondly, what is the Capture method for? I've looked at the PayPalDirect plugin, but it's not very clear. When is this method called?
David
  • 15,894
  • 22
  • 55
  • 66
Matt
  • 6,787
  • 11
  • 65
  • 112

1 Answers1

5

This fields are saved into the order after verifying that if processPaymentResult.Success is true. All of them are optional but you need to include them if you want to have some kind of reference between orders in nopcommerce and payment transactions in Tranzila.

  • AuthorizationTransactionId (optional) is a unique id genereated by you if you want to record the transaction

  • AuthorizationTransactionCode is the unique transaction Id generated by the payment gateway. In your case it might be RefNumber. But I would double-check.

  • AuthorizationTransactionResult is the whole response returned by the payment gateway. You could save just text or the whole XML response. This is again, just for future references.

The other 2 fields are used in deferred payments. They are set when the 'admin' captures the money from the admin panel.

  • CaptureTransactionId transaction code generated by the payment gateway
  • CaptureTransactionResult the whole message of that transaction
Carlos Martinez T
  • 6,458
  • 1
  • 34
  • 40