Skip to content

Commit

Permalink
Improve gateway configuration helper naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel HUEZ authored and Manuel HUEZ committed Nov 18, 2016
1 parent 7f68d6e commit e7b2253
Show file tree
Hide file tree
Showing 15 changed files with 206 additions and 180 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The package's installation is done using composer. Simply add these lines to you
``` json
{
"require": {
"ProcessOut/ProcessOut-php": "^5.0.0"
"ProcessOut/ProcessOut-php": "^5.0.1"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function all($options = array())

/**
* Find a specific activity and fetch its data.
* @param string $activityId
* @param string $activityId
* @param array $options
* @return $this
*/
Expand Down
16 changes: 8 additions & 8 deletions src/AuthorizationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public function fetchCustomer($options = array())

/**
* Create a new authorization request for the given customer ID.
* @param string $customerId
* @param string $customerId
* @param array $options
* @return $this
*/
Expand All @@ -507,12 +507,12 @@ public function create($customerId, $options = array())
$path = "/authorization-requests";

$data = array(
"name" => $this->getName(),
"currency" => $this->getCurrency(),
"return_url" => $this->getReturnUrl(),
"cancel_url" => $this->getCancelUrl(),
"custom" => $this->getCustom(),
"customer_id" => $customerId
"name" => $this->getName(),
"currency" => $this->getCurrency(),
"return_url" => $this->getReturnUrl(),
"cancel_url" => $this->getCancelUrl(),
"custom" => $this->getCustom(),
"customer_id" => $customerId
);

$response = $request->post($path, $data, $options);
Expand All @@ -529,7 +529,7 @@ public function create($customerId, $options = array())

/**
* Find an authorization request by its ID.
* @param string $authorizationRequestId
* @param string $authorizationRequestId
* @param array $options
* @return $this
*/
Expand Down
20 changes: 10 additions & 10 deletions src/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,14 @@ public function create($options = array())
$path = "/coupons";

$data = array(
"id" => $this->getId(),
"amount_off" => $this->getAmountOff(),
"percent_off" => $this->getPercentOff(),
"currency" => $this->getCurrency(),
"iteration_count" => $this->getIterationCount(),
"max_redemptions" => $this->getMaxRedemptions(),
"expires_at" => $this->getExpiresAt(),
"metadata" => $this->getMetadata()
"id" => $this->getId(),
"amount_off" => $this->getAmountOff(),
"percent_off" => $this->getPercentOff(),
"currency" => $this->getCurrency(),
"iteration_count" => $this->getIterationCount(),
"max_redemptions" => $this->getMaxRedemptions(),
"expires_at" => $this->getExpiresAt(),
"metadata" => $this->getMetadata()
);

$response = $request->post($path, $data, $options);
Expand All @@ -523,7 +523,7 @@ public function create($options = array())

/**
* Find a coupon by its ID.
* @param string $couponId
* @param string $couponId
* @param array $options
* @return $this
*/
Expand Down Expand Up @@ -559,7 +559,7 @@ public function save($options = array())
$path = "/coupons/" . urlencode($this->getId()) . "";

$data = array(
"metadata" => $this->getMetadata()
"metadata" => $this->getMetadata()
);

$response = $request->put($path, $data, $options);
Expand Down
50 changes: 25 additions & 25 deletions src/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ public function fetchTokens($options = array())

/**
* Find a customer's token by its ID.
* @param string $tokenId
* @param string $tokenId
* @param array $options
* @return Token
*/
Expand Down Expand Up @@ -747,18 +747,18 @@ public function create($options = array())
$path = "/customers";

$data = array(
"balance" => $this->getBalance(),
"currency" => $this->getCurrency(),
"email" => $this->getEmail(),
"first_name" => $this->getFirstName(),
"last_name" => $this->getLastName(),
"address1" => $this->getAddress1(),
"address2" => $this->getAddress2(),
"city" => $this->getCity(),
"state" => $this->getState(),
"zip" => $this->getZip(),
"country_code" => $this->getCountryCode(),
"metadata" => $this->getMetadata()
"balance" => $this->getBalance(),
"currency" => $this->getCurrency(),
"email" => $this->getEmail(),
"first_name" => $this->getFirstName(),
"last_name" => $this->getLastName(),
"address1" => $this->getAddress1(),
"address2" => $this->getAddress2(),
"city" => $this->getCity(),
"state" => $this->getState(),
"zip" => $this->getZip(),
"country_code" => $this->getCountryCode(),
"metadata" => $this->getMetadata()
);

$response = $request->post($path, $data, $options);
Expand All @@ -775,7 +775,7 @@ public function create($options = array())

/**
* Find a customer by its ID.
* @param string $customerId
* @param string $customerId
* @param array $options
* @return $this
*/
Expand Down Expand Up @@ -811,17 +811,17 @@ public function save($options = array())
$path = "/customers/" . urlencode($this->getId()) . "";

$data = array(
"balance" => $this->getBalance(),
"email" => $this->getEmail(),
"first_name" => $this->getFirstName(),
"last_name" => $this->getLastName(),
"address1" => $this->getAddress1(),
"address2" => $this->getAddress2(),
"city" => $this->getCity(),
"state" => $this->getState(),
"zip" => $this->getZip(),
"country_code" => $this->getCountryCode(),
"metadata" => $this->getMetadata()
"balance" => $this->getBalance(),
"email" => $this->getEmail(),
"first_name" => $this->getFirstName(),
"last_name" => $this->getLastName(),
"address1" => $this->getAddress1(),
"address2" => $this->getAddress2(),
"city" => $this->getCity(),
"state" => $this->getState(),
"zip" => $this->getZip(),
"country_code" => $this->getCountryCode(),
"metadata" => $this->getMetadata()
);

$response = $request->put($path, $data, $options);
Expand Down
23 changes: 10 additions & 13 deletions src/Discount.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public function fillWithData($data)

/**
* Apply a new discount to the given subscription ID.
* @param string $subscriptionId
* @param string $subscriptionId
* @param array $options
* @return $this
*/
Expand All @@ -356,9 +356,9 @@ public function apply($subscriptionId, $options = array())
$path = "/subscriptions/" . urlencode($subscriptionId) . "/discounts";

$data = array(
"amount" => $this->getAmount(),
"expires_at" => $this->getExpiresAt(),
"metadata" => $this->getMetadata()
"amount" => $this->getAmount(),
"expires_at" => $this->getExpiresAt(),
"metadata" => $this->getMetadata()
);

$response = $request->post($path, $data, $options);
Expand All @@ -374,9 +374,9 @@ public function apply($subscriptionId, $options = array())
}

/**
* Apply a new discount to the given subscription ID from a coupon ID.
* @param string $subscriptionId
* @param string $couponId
* Apply a new discount on the subscription from a coupon ID.
* @param string $subscriptionId
* @param string $couponId
* @param array $options
* @return $this
*/
Expand All @@ -386,10 +386,7 @@ public function applyCoupon($subscriptionId, $couponId, $options = array())
$path = "/subscriptions/" . urlencode($subscriptionId) . "/discounts";

$data = array(
"amount" => $this->getAmount(),
"expires_at" => $this->getExpiresAt(),
"metadata" => $this->getMetadata(),
"coupon_id" => $couponId
"coupon_id" => $couponId
);

$response = $request->post($path, $data, $options);
Expand All @@ -406,8 +403,8 @@ public function applyCoupon($subscriptionId, $couponId, $options = array())

/**
* Find a subscription's discount by its ID.
* @param string $subscriptionId
* @param string $discountId
* @param string $subscriptionId
* @param string $discountId
* @param array $options
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public function all($options = array())

/**
* Find an event by its ID.
* @param string $eventId
* @param string $eventId
* @param array $options
* @return $this
*/
Expand Down
50 changes: 25 additions & 25 deletions src/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ public function fillWithData($data)

/**
* Authorize the invoice using the given source (customer or token)
* @param string $source
* @param string $source
* @param array $options
* @return Transaction
*/
Expand All @@ -582,7 +582,7 @@ public function authorize($source, $options = array())
$path = "/invoices/" . urlencode($this->getId()) . "/authorize";

$data = array(
"source" => $source
"source" => $source
);

$response = $request->post($path, $data, $options);
Expand All @@ -601,7 +601,7 @@ public function authorize($source, $options = array())

/**
* Capture the invoice using the given source (customer or token)
* @param string $source
* @param string $source
* @param array $options
* @return Transaction
*/
Expand All @@ -611,7 +611,7 @@ public function capture($source, $options = array())
$path = "/invoices/" . urlencode($this->getId()) . "/capture";

$data = array(
"source" => $source
"source" => $source
);

$response = $request->post($path, $data, $options);
Expand Down Expand Up @@ -658,7 +658,7 @@ public function fetchCustomer($options = array())

/**
* Assign a customer to the invoice.
* @param string $customerId
* @param string $customerId
* @param array $options
* @return Customer
*/
Expand All @@ -668,7 +668,7 @@ public function assignCustomer($customerId, $options = array())
$path = "/invoices/" . urlencode($this->getId()) . "/customers";

$data = array(
"customer_id" => $customerId
"customer_id" => $customerId
);

$response = $request->post($path, $data, $options);
Expand Down Expand Up @@ -784,14 +784,14 @@ public function create($options = array())
$path = "/invoices";

$data = array(
"name" => $this->getName(),
"amount" => $this->getAmount(),
"currency" => $this->getCurrency(),
"metadata" => $this->getMetadata(),
"request_email" => $this->getRequestEmail(),
"request_shipping" => $this->getRequestShipping(),
"return_url" => $this->getReturnUrl(),
"cancel_url" => $this->getCancelUrl()
"name" => $this->getName(),
"amount" => $this->getAmount(),
"currency" => $this->getCurrency(),
"metadata" => $this->getMetadata(),
"request_email" => $this->getRequestEmail(),
"request_shipping" => $this->getRequestShipping(),
"return_url" => $this->getReturnUrl(),
"cancel_url" => $this->getCancelUrl()
);

$response = $request->post($path, $data, $options);
Expand All @@ -808,7 +808,7 @@ public function create($options = array())

/**
* Create a new invoice for the given customer ID.
* @param string $customerId
* @param string $customerId
* @param array $options
* @return $this
*/
Expand All @@ -818,15 +818,15 @@ public function createForCustomer($customerId, $options = array())
$path = "/invoices";

$data = array(
"name" => $this->getName(),
"amount" => $this->getAmount(),
"currency" => $this->getCurrency(),
"metadata" => $this->getMetadata(),
"request_email" => $this->getRequestEmail(),
"request_shipping" => $this->getRequestShipping(),
"return_url" => $this->getReturnUrl(),
"cancel_url" => $this->getCancelUrl(),
"customer_id" => $customerId
"name" => $this->getName(),
"amount" => $this->getAmount(),
"currency" => $this->getCurrency(),
"metadata" => $this->getMetadata(),
"request_email" => $this->getRequestEmail(),
"request_shipping" => $this->getRequestShipping(),
"return_url" => $this->getReturnUrl(),
"cancel_url" => $this->getCancelUrl(),
"customer_id" => $customerId
);

$response = $request->post($path, $data, $options);
Expand All @@ -843,7 +843,7 @@ public function createForCustomer($customerId, $options = array())

/**
* Find an invoice by its ID.
* @param string $invoiceId
* @param string $invoiceId
* @param array $options
* @return $this
*/
Expand Down
Loading

0 comments on commit e7b2253

Please sign in to comment.