Sha256: fe84b5a4c0e5f42767f7c444813e1161964b91f2f5a7fb75a2f5c302a219ea1f

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

% if mode == 'definition':
Balanced::Credit.reverse
% elif mode == 'request':
require 'balanced'
Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')

reversal = Balanced::Credit.fetch('/credits/CRxBIVaPCDZEbVgE1Jb0jkc')
credit.reverse(
  :amount => 3000,
  :description => 'Reversal for Order #1111',
  :meta => {
    'fulfillment.item.condition' => 'OK',
    'merchant.feedback' => 'positive',
    'user.refund_reason' => 'not happy with product'
  }
)

% elif mode == 'response':
#<Balanced::Reversal:0x007fcde09636f0
 @attributes=
  {"amount"=>3000,
   "created_at"=>"2014-12-17T21:26:06.246868Z",
   "currency"=>"USD",
   "description"=>"Reversal for Order #1111",
   "failure_reason"=>nil,
   "failure_reason_code"=>nil,
   "href"=>"/reversals/RVyHZ2toyTu9BCvGNLsOvLi",
   "id"=>"RVyHZ2toyTu9BCvGNLsOvLi",
   "links"=>{"credit"=>"CRxBIVaPCDZEbVgE1Jb0jkc", "order"=>nil},
   "meta"=>
    {"fulfillment.item.condition"=>"OK",
     "merchant.feedback"=>"positive",
     "user.refund_reason"=>"not happy with product"},
   "status"=>"pending",
   "transaction_number"=>"RV71F-IRJ-GYVF",
   "updated_at"=>"2014-12-17T21:26:06.517468Z"},
 @hyperlinks=
  {"credit"=>
    #<Proc:0x007fcde09614b8/lib/balanced/resources/resource.rb:56 (lambda)>,
   "events"=>
    #<Proc:0x007fcde093f020/lib/balanced/utils.rb:6 (lambda)>,
   "order"=>
    #<Proc:0x007fcde093e670/lib/balanced/utils.rb:6 (lambda)>}>

% endif

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
balanced-1.2.1 scenarios/reversal_create/ruby.mako