Class: PaymentGateway::ForAll::Transaction

Inherits:
Base
  • Object
show all
Defined in:
lib/payment_gateway/for_all/transaction.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PaymentGateway::ForAll::Base

Instance Method Details

#capture(body) ⇒ Object

POST Capture Transaction

"merchantKey": "0123456789ABCDEF01...",
"transactionId": "1843246811",
"metaId": null,
"amount": null



53
54
55
# File 'lib/payment_gateway/for_all/transaction.rb', line 53

def capture(body)
  request(:post, endpoint_capture, body: body)
end

#create(body) ⇒ Object

POST Create Transaction

{

  "merchantKey": "xxxxxxxxxxxxxxxxx",
  "amount": 7500,
  "metaId": "random number, token or code",
  "overwriteMetaId": false,
  "softDescriptor": "Dr. Zeus Inc.",
  "paymentMethod": [
    {
      "cardNonce": "xxxxxxxxxxxxxxxxx",
      "cardBrandId": 2,
      "paymentMode": 1,
      "installmentType": 1,
      "installments": 1,
      "amount": 7500,
      "forceSplit": false
    }
  ],
  "customerInfo": {
    "fullName": "Joao Silva",
    "cpf": "02700790090",
    "phoneNumber": "515818282",
    "birthday": "1994-05-02",
    "emailAddress": "[email protected]",
    "zipCode": "902848",
    "address": "Rua exemplo 123",
    "neighborhood": "Bairro examplo",
    "city": "Cidade exemplo",
    "state": "Estado exemplo"
  },
  "autoCapture": true,
  "postbackURL": "www.example.com/postback/"
}


40
41
42
# File 'lib/payment_gateway/for_all/transaction.rb', line 40

def create(body)
  request(:post, endpoint_create, body: body)
end